6. Electronics design¶
Overview¶
The goal of this week was to test a circuit with a micro controller, do it in Wokwi, learn how to design a PCB board, and learn how to use my lab’s tools.
Files¶
Group Site¶
Here I worked with Jenna and Wilson to test the tools of the Lab. Specifically I tested a flashing circuit’s voltage per time or constant voltage as the LED flashes on and off.
Wokwi¶
Firstly I needed to come up with the idea of what my PCB was suppose to do. I decided to create a board that when a button is pressed an LED turns on using two resistors of 10 kilo ohms and one of 330 ohms. What happens is when the button state is changed to 1 it activates power to D2 which is connected to a 330 ohms resistors which is connected to the LED which then powers it. When button state is at zero the LED is connected to the 10k resistors and therefore does not light up.
Below is the base code I used for my Pull down Circuit.
int buttonState = 0;
void setup()
{
pinMode(D2, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
// read the state of the pushbutton value
buttonState = digitalRead(D2);
// check if pushbutton is pressed. if it is, the
// buttonState is HIGH
if (buttonState == HIGH) {
// turn LED on
digitalWrite(LED_BUILTIN, LOW);
} else {
// turn LED off
digitalWrite(LED_BUILTIN, HIGH);
}
delay(10); // Delay a little bit to improve simulation performance
}
Testing¶
Next, I took a breadboard, S3 micro controller, and all the necessary components and recreated it in real life. I had to change the design and code a little to use an external LED.
KiCad¶
Overview¶
I was given the choice between using KiCad or Eagle or both in my lab, and I choose to use KiCad as I already have much previous experience with creating PCBs on KiCad
Process¶
A. Fist Step I needed to download KiCad from the KiCad website.
B. Then I needed to go download the KiCad Fab Library found on the Fab Repo
C. After waiting 20 minutes and KiCad finally downloaded, I went to Libraries where I downloaded the Fab Academy one with all the components that I needed for this week to create my PCB
D. Next I created a schematic where I added in the components of a Seeed Xiao Esp32-S3, two SMD 1206 Resistors, one SMD button, and one SMD 1206 LED. I had to use the footprint library to fix some problems with the LED. Then I connected all the ports to the necessary spots.
E. I opened the PCB editor tab and clicked bring in Schematic which then proceeded to import all my components with the necessary footprints. From here I created the outline of the PCB including where the traces would run, the diameter of the traces, and how big the board would be.
F. Finally I needed to export the edge cuts and F.Cu. I did this by going to file, plot and then selecting edge cuts and F.Cu. From here I sent the files to the school gmail.
Problems¶
The only significant problem I had was finding the correct footprints for each of my components as I had no idea what kind or type to use. This cause problems as then I could not convert from the schematics to the PCB editor. I decided to just use the foot prints from the fab repo including the ESP 32-S3, resistors, LEDs, and push buttons.
Reflection¶
This week I learned how to successfully model, test, and then create the final design for a working, useful PCB. I explored using Wokwi and Kicad, and I used the Fab Academy’s Kicad repo to downloaded the Kicad libraries that I needed. I also learned how to test a circuit using an Oscilloscope to find the constant voltage per time for said circuit.