go home
👁️












10/04/23

This assignment is designing a PCB for a microcontroller



I really had to spend a lot of time just understanding the assignment, I wasn't sure if we were using the microcontroller boards we were given or if we are to use the actual microcontrollers. I also wasn't sure what the possibilities were. I spent multiple days thinking about what I wanted to make and why.
I wanted to use the ESP32-CAM, so I can make a DJ USB that streams video from itself


image from seeed studio


I wasnt sure what all the already added components where so i asked chatGPT
The ESP32-CAM doesn’t come with a USB connector, so you need an FTDI programmer to upload code through the U0R and U0T pins (serial pins).
I started off using Hello wold on PCBSVG
this design already had the header_FTDI which allows a connection to FTDI programmer I wanted to add a nice place for the omnivison OV2640 2 megapixel camera to connect to

this also uses the I2C COMMUNICATION PROTOCOL. I used this website to learn about it: https://www.circuitbasics.com/basics-of-the-i2c-communication-protocol/
you can see how i wander about in this world

I asked chatgpt about how to connect a camera to the the ESP32 CAM, it led me astray

I'm not sure if this information is correct, but the information that I needed was that it has a gold plated connector strip built in that fits the OV2640. I learned that from this video
but before I knew that i found the OV2640 kicad_mod to download into SVG PCB. I decided to leave it in the schematic to illustrate it is there even though the ESP32-CAM mod doesnt list the connector strip.

next I need to add USB interface so that it can be plugged into a CDJ.
I looked online and everyone seems to be using this FT232RL
C1 and C2 are decoupling capacitors to reduce the supply noise
I was having trouble during the routing to not have the wires cross
I ended up flipping the USB out, as that solves most USB related connection issues

My final design!

The code:
const C_1206 = footprint({"1":{"shape":"M -0.032,0.034L 0.032,0.034L 0.032,-0.034L -0.032,-0.034L -0.032,0.034","pos":[-0.06,0],"layers":["F.Cu","F.Mask"],"index":1},"2":{"shape":"M -0.032,0.034L 0.032,0.034L 0.032,-0.034L -0.032,-0.034L -0.032,0.034","pos":[0.06,0],"layers":["F.Cu","F.Mask"],"index":2}});
const FT232rl = footprint({"1":{"pos":[-0.16633858267716534,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"2":{"pos":[-0.140748031496063,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"3":{"pos":[-0.11515748031496062,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"4":{"pos":[-0.08956692913385826,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"5":{"pos":[-0.0639763779527559,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"6":{"pos":[-0.038385826771653545,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"7":{"pos":[-0.012795275590551181,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"8":{"pos":[0.012795275590551181,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"9":{"pos":[0.038385826771653545,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"10":{"pos":[0.0639763779527559,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"11":{"pos":[0.08956692913385826,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"12":{"pos":[0.11515748031496062,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"13":{"pos":[0.140748031496063,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"14":{"pos":[0.16633858267716534,-0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"15":{"pos":[0.16633858267716534,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"16":{"pos":[0.140748031496063,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"17":{"pos":[0.11515748031496062,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"18":{"pos":[0.08956692913385826,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"19":{"pos":[0.0639763779527559,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"20":{"pos":[0.038385826771653545,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"21":{"pos":[0.012795275590551181,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"22":{"pos":[-0.012795275590551181,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"23":{"pos":[-0.038385826771653545,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"24":{"pos":[-0.0639763779527559,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"25":{"pos":[-0.08956692913385826,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"26":{"pos":[-0.11515748031496062,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"27":{"pos":[-0.140748031496063,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]},"28":{"pos":[-0.16633858267716534,0.14271653543307086],"shape":"M -0.007874015748031496 0.02952755905511811 L 0.007874015748031496 0.02952755905511811 L 0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 -0.02952755905511811 L -0.007874015748031496 0.02952755905511811 ","layers":["F.Cu","F.Mask","F.Paste"]}});
const USB_A_plug = footprint({"GND":{"shape":"M -0.05,0.02L 0.242,0.02L 0.242,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,0.138],"layers":["F.Cu","F.Mask"],"index":1},"D+":{"shape":"M -0.05,0.02L 0.202,0.02L 0.202,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,0.039],"layers":["F.Cu","F.Mask"],"index":2},"D-":{"shape":"M -0.05,0.02L 0.202,0.02L 0.202,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,-0.039],"layers":["F.Cu","F.Mask"],"index":3},"5V":{"shape":"M -0.05,0.02L 0.242,0.02L 0.242,-0.02L -0.05,-0.02L -0.05,0.02","pos":[0,-0.138],"layers":["F.Cu","F.Mask"],"index":4}});
// const OV2640 = footprint({"P12":{"pos":[0.00984251968503937,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P11":{"pos":[0.02952755905511811,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P10":{"pos":[0.049212598425196846,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P9":{"pos":[0.0688976377952756,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P8":{"pos":[0.08858267716535433,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P7":{"pos":[0.10826771653543307,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P6":{"pos":[0.1279527559055118,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P5":{"pos":[0.14763779527559054,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P4":{"pos":[0.1673228346456693,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P3":{"pos":[0.18700787401574803,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P2":{"pos":[0.20669291338582677,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P1":{"pos":[0.2263779527559055,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P24":{"pos":[-0.2263779527559055,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P23":{"pos":[-0.20669291338582677,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P22":{"pos":[-0.18700787401574803,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P21":{"pos":[-0.1673228346456693,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P20":{"pos":[-0.14763779527559054,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P19":{"pos":[-0.1279527559055118,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P18":{"pos":[-0.10826771653543307,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P17":{"pos":[-0.08858267716535433,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P16":{"pos":[-0.0688976377952756,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P15":{"pos":[-0.049212598425196846,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P14":{"pos":[-0.02952755905511811,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P13":{"pos":[-0.00984251968503937,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P25":{"pos":[0.3543307086614173,0.08031496062992126,3.543307086614173],"shape":"M -0.07874015748031496 0.03937007874015748 L 0.07874015748031496 0.03937007874015748 L 0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 0.03937007874015748 ","layers":["F.Cu","F.Mask","F.Paste"]},"P26":{"pos":[-0.3543307086614173,0.08031496062992126,3.543307086614173],"shape":"M -0.07874015748031496 0.03937007874015748 L 0.07874015748031496 0.03937007874015748 L 0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 0.03937007874015748 ","layers":["F.Cu","F.Mask","F.Paste"]}});
const header_FTDI = footprint({"GND":{"shape":"M 0.05,0.025L -0.05,0.025L -0.0509,0.025L -0.0517,0.025L -0.0535,0.0248L -0.0552,0.0244L -0.056,0.0243L -0.0578,0.0237L -0.0593,0.0232L -0.0602,0.0229L -0.061,0.0225L -0.0618,0.0221L -0.0625,0.0216L -0.0633,0.0212L -0.064,0.0208L -0.0654,0.0197L -0.0661,0.0191L -0.0668,0.0186L -0.0686,0.0168L -0.0691,0.0161L -0.0697,0.0154L -0.0708,0.014L -0.0712,0.0133L -0.0716,0.0125L -0.0721,0.0118L -0.0725,0.011L -0.0729,0.0102L -0.0732,0.0093L -0.0737,0.0078L -0.0743,0.006L -0.0744,0.0052L -0.0748,0.0035L -0.075,0.0017L -0.075,0.0009L -0.075,0L -0.075,-0.0009L -0.075,-0.0017L -0.0748,-0.0035L -0.0744,-0.0052L -0.0743,-0.006L -0.0737,-0.0078L -0.0732,-0.0093L -0.0729,-0.0102L -0.0725,-0.011L -0.0721,-0.0118L -0.0716,-0.0125L -0.0712,-0.0133L -0.0708,-0.014L -0.0697,-0.0154L -0.0691,-0.0161L -0.0686,-0.0168L -0.0668,-0.0186L -0.0661,-0.0191L -0.0654,-0.0197L -0.064,-0.0208L -0.0633,-0.0212L -0.0625,-0.0216L -0.0618,-0.0221L -0.061,-0.0225L -0.0602,-0.0229L -0.0593,-0.0232L -0.0578,-0.0237L -0.056,-0.0243L -0.0552,-0.0244L -0.0535,-0.0248L -0.0517,-0.025L 0.05,-0.025L 0.05,0.025","pos":[0,0.25],"layers":["F.Cu","F.Mask"],"index":1},"CTS":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0,0.15],"layers":["F.Cu","F.Mask"],"index":2},"VCC":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0,0.05],"layers":["F.Cu","F.Mask"],"index":3},"Tx":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0,-0.05],"layers":["F.Cu","F.Mask"],"index":4},"Rx":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0,-0.15],"layers":["F.Cu","F.Mask"],"index":5},"RTS":{"shape":"M -0.05,0.025L 0.05,0.025L 0.05,-0.025L -0.05,-0.025L -0.05,0.025","pos":[0,-0.25],"layers":["F.Cu","F.Mask"],"index":6}});
const ESP32_CAM = footprint({"+5V":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.385,0.35],"layers":["F.Cu","F.Mask"],"index":1},"GND1":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.515,0.25],"layers":["F.Cu","F.Mask"],"index":2},"GND2":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.385,-0.35],"layers":["F.Cu","F.Mask"],"index":9},"GND3":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.385,0.05],"layers":["F.Cu","F.Mask"],"index":13},"IO12":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.385,0.15],"layers":["F.Cu","F.Mask"],"index":3},"IO13":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.515,0.05],"layers":["F.Cu","F.Mask"],"index":4},"IO15":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.385,-0.05],"layers":["F.Cu","F.Mask"],"index":5},"IO14":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.515,-0.15],"layers":["F.Cu","F.Mask"],"index":6},"IO2":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.385,-0.25],"layers":["F.Cu","F.Mask"],"index":7},"IO4":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[-0.515,-0.35],"layers":["F.Cu","F.Mask"],"index":8},"U0T":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.515,-0.25],"layers":["F.Cu","F.Mask"],"index":10},"U0R":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.385,-0.15],"layers":["F.Cu","F.Mask"],"index":11},"VCC":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.515,-0.05],"layers":["F.Cu","F.Mask"],"index":12},"IO0":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.515,0.15],"layers":["F.Cu","F.Mask"],"index":14},"IO16":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.385,0.25],"layers":["F.Cu","F.Mask"],"index":15},"3V3":{"shape":"M -0.0395,0.0195L 0.0395,0.0195L 0.0395,-0.0195L -0.0395,-0.0195L -0.0395,0.0195","pos":[0.515,0.35],"layers":["F.Cu","F.Mask"],"index":16}});
const slide_switch = footprint({"1":{"shape":"M -0.0195,0.0235L 0.0195,0.0235L 0.0195,-0.0235L -0.0195,-0.0235L -0.0195,0.0235","pos":[-0.098,0.1],"layers":["F.Cu","F.Mask"],"index":1},"2":{"shape":"M -0.0195,0.0235L 0.0195,0.0235L 0.0195,-0.0235L -0.0195,-0.0235L -0.0195,0.0235","pos":[0,0.1],"layers":["F.Cu","F.Mask"],"index":2},"3":{"shape":"M -0.0195,0.0235L 0.0195,0.0235L 0.0195,-0.0235L -0.0195,-0.0235L -0.0195,0.0235","pos":[0.098,0.1],"layers":["F.Cu","F.Mask"],"index":3}});
// const OV2640 = footprint({"P12":{"pos":[0.00984251968503937,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P11":{"pos":[0.02952755905511811,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P10":{"pos":[0.049212598425196846,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P9":{"pos":[0.0688976377952756,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P8":{"pos":[0.08858267716535433,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P7":{"pos":[0.10826771653543307,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P6":{"pos":[0.1279527559055118,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P5":{"pos":[0.14763779527559054,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P4":{"pos":[0.1673228346456693,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P3":{"pos":[0.18700787401574803,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P2":{"pos":[0.20669291338582677,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P1":{"pos":[0.2263779527559055,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P24":{"pos":[-0.2263779527559055,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P23":{"pos":[-0.20669291338582677,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P22":{"pos":[-0.18700787401574803,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P21":{"pos":[-0.1673228346456693,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P20":{"pos":[-0.14763779527559054,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P19":{"pos":[-0.1279527559055118,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P18":{"pos":[-0.10826771653543307,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P17":{"pos":[-0.08858267716535433,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P16":{"pos":[-0.0688976377952756,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P15":{"pos":[-0.049212598425196846,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P14":{"pos":[-0.02952755905511811,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P13":{"pos":[-0.00984251968503937,0,3.543307086614173],"shape":"M -0.012795275590551181 0.005905511811023622 L 0.012795275590551181 0.005905511811023622 L 0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 -0.005905511811023622 L -0.012795275590551181 0.005905511811023622 ","layers":["F.Cu","F.Mask","F.Paste"]},"P25":{"pos":[0.3543307086614173,0.08031496062992126,3.543307086614173],"shape":"M -0.07874015748031496 0.03937007874015748 L 0.07874015748031496 0.03937007874015748 L 0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 0.03937007874015748 ","layers":["F.Cu","F.Mask","F.Paste"]},"P26":{"pos":[-0.3543307086614173,0.08031496062992126,3.543307086614173],"shape":"M -0.07874015748031496 0.03937007874015748 L 0.07874015748031496 0.03937007874015748 L 0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 -0.03937007874015748 L -0.07874015748031496 0.03937007874015748 ","layers":["F.Cu","F.Mask","F.Paste"]}});
// OV2640 camera
 
// @version: v0.1.0
// commands:
//  - SHIFT+ENTER: render
//  - drap & drop file: kicad import


// constants
const width = 1.3 // board width
const height = 2.15 // board height
const x = 1 // x origin
const y = 1 // y origin
const zt = 0 // top z
const zb = -0.06 // bottom z
const w = .015 // wire width
const mask = .004 // solder mask size
const border = 0.05 // rendering border


/* -- DECLARE_PCB -- */
let board = new PCB();



/* -- ADD_COMPONENTS -- */
let J1 = board.add(header_FTDI, {translate: pt(x+width-0.35, y+height/2), rotate: 0, label: 'J1 FTDI\n3.3V'});
let ESP = board.add(ESP32_CAM, {translate: pt(x+0.45, y+0.75), rotate: -90, label: 'ESP32-CAM'});
let S1 = board.add(slide_switch, {translate: pt(ESP.padX("IO0"), ESP.padY("IO0")-0.185), label: 'prog run'});
// let ov = board.add(OV2640, {translate: pt(x+width/2, y+height-0.98), rotate: 0, label: 'OV2640'});
let usb = board.add(USB_A_plug, {translate: pt(x+width/2, y+height-0.049), rotate: -90, label: 'OV2640'});
let ft = board.add(FT232rl, {translate: pt(x+width/2+0.3, y+height-0.55), rotate: -270, label: 'FT232RL'});
let c1 = board.add(C_1206, {translate: pt(x+width-1.1, y+height-0.4), rotate: -90, label: 'c1 0.1u'});
let c2 = board.add(C_1206, {translate: pt(x+width-1.05, y+height-0.65), rotate: -90, label: 'c2 10uf'});
let c3 = board.add(C_1206, {translate: pt(x+width-0.85, y+height-0.5), rotate: -90, label: 'c3 0.1u'});

let usbW = 0.4;
let usbH = 0.273;

let interior = geo.path(path([x, y+height - usbH],
                             [x + (width/2) - (usbW/2), y+height - usbH],
                             [x + (width/2) - (usbW/2), y+height],
                             [x + (width/2) + (usbW/2), y+height],
                             [x + (width/2) + (usbW/2), y+height - usbH],
                             [x+width, y+height- usbH],
                             [x+width, y],
                             [x, y]
              
                            ));


board.addShape("interior", interior);


/* -- ADD_WIRES -- */
board.wire(path(ft.pad("18"),
                 [1.95, 2.65], [1.95, 2.8],
                ), w);

board.wire(path(ft.pad("7"), [2.25, 2.6], [2.25, 2.55],
                  ), w);

board.wire(path(ft.pad("21"), [1.7, 2.6], [1.7, 2.35],
                   ESP.pad("GND1")), w);
board.wire(path(ft.pad("26"), [1.7, 2.45], [1.7, 2.35],
                   ESP.pad("GND1")), w);
board.wire(path(ft.pad("25"), [1.7, 2.5], [1.7, 2.35],
                   ESP.pad("GND1")), w);

board.wire(path(c3.pad("2"), [1.55, 2.6], [1.55, 2.7],
                 ft.pad("17")), w);
board.wire(path(c3.pad("1"), [1.35, 2.75], [1.35, 2.65]), w);

board.wire(path(ft.pad("1"), [2.1, 2.35], [2.05, 2.35], [2.05, 2.17], [1.75, 2.2], [1.75, 1.93],
                 ), w);

board.wire(path(ft.pad("5"), [2.2, 2.53], [2.2, 2.05],
                 J1.pad("Tx")), w);

board.wire(
path( ft.pad("15"),  [1.7, 2.8], [1.7, 2.85],usb.pad("D+")), 
.015
);
board.wire(
path( ft.pad("16"),  [1.6, 2.75], [1.6, 2.8], [1.6, 2.85],usb.pad("D-")), 
.015
);
board.wire(path(usb.pad("GND"),
                 [1.8, 2.8], [2.25, 2.8],
                [2.25, 1.55], [1.5, 1.55], ESP.pad("GND3"),), w);


board.wire(path(c1.pad("1"),
                [usb.padX("5V"), usb.padY("5V")-usbH],
                usb.pad("5V")), w);

board.wire(path(
                [1.1, 2.15],
                ESP.pad("GND2"), [1.1, 2.05], [1.1, 2.15], [1.05, 2.15], [1.05, 2.6], [1.2, 2.65],), w);

board.wire(path(ft.pad("20"),
                [1.65, 2.65],
                [1.65, 2.45], c2.pad("2"),), w);


board.wire(path(c2.pad("1"),
                [c2.padX("1")+0.1, c1.padY("2")-0.1],[c2.padX("1")+0.1, c1.padY("2")+0.0],
                c1.pad("2"),), w);

board.wire(path(ESP.pad("+5V"),
                [ESP.padX("+5V"), J1.padY("VCC")],
                J1.pad("VCC"),), w);

board.wire(path(ESP.pad("GND1"),
                [J1.padX("GND"), ESP.padY("GND1")],
                J1.pad("GND"),), w);

board.wire(path(ESP.pad("GND2"),
                [ESP.padX("GND2"), J1.padY("VCC")],
                [ESP.padX("GND1"), J1.padY("VCC")],
                ESP.pad("GND1"),), w);

board.wire(path(ESP.pad("U0T"),
                [ESP.padX("U0T"), J1.padY("Rx")],
                J1.pad("Rx"),), w);

board.wire(path(ESP.pad("U0R"),
                [ESP.padX("U0R"), J1.padY("Rx")-.05],
                [J1.padX("Tx")+.1, J1.padY("Rx")-.05],
                [J1.padX("Tx")+.1, J1.padY("Tx")],
                J1.pad("Tx"),), w);

board.wire(path(S1.pad("1"),
                [ESP.padX("GND2"), S1.padY("1")],
                ESP.pad("GND2"),), w);

board.wire(path(S1.pad("1"),
                [ESP.padX("GND3"), S1.padY("1")],
                ESP.pad("GND3"),), w);

board.wire(path(S1.pad("2"),
                ESP.pad("IO0"),), w);


// rendering
renderPCB({
  pcb: board,
  layerColors: {
    "interior": "#002d00ff",
    "B.Cu": "#ff4c007f",
    "F.Cu": "#be7a27cc",
    "B.Mask": "#ff814bff",
    "F.Mask": "#ffa50aff",
    "padLabels": "#ffff99e5",
    "componentLabels": "#00e5e5e5",
  },
  limits: {
    x: [x-border, x+width+border],
    y: [y-border, y+height+border]
  },
  mm_per_unit: 25.4
})

week 5 week 5 week 5

































Happy dance!