6. Embedded Design and Fabrication
Posted April 11, 2024
I have previously finished all testing for the hardware and the circuit is ready but it’s built using a breadboard now I need to design a new PCB board and make sure all my circuit is fully integrated on this board.
As I have shown before my circuit is working 100% as I want and it is pushing data to the IOT platform as I want but I need now to make this complected messy looking circuit to a sleek lovely board with no complication when looking to it.
Let’s simplify our core project
- Now I want to design my circuit using KICad.
I have previously clarified how to use KICAD in details please refer to this LINK
Important thing to highlight –> This PCB is gonna be included within the main project housing so its dimension is constrained by the housing so for this reason I have decided to have my housing to be circular with (120 mm) diameter. So my PCB board has not to exceed (100 mm) in diameter to make sure it will fit inside with (20 mm) margin of control for me.
But to make things a bit more complicated and a bit more challenging for me I decided to build my PCB only using (80 mm) circle.
So let’s go Ahead and start building the schematic first
-
For the schematic I will go very fast and show only the main part I have built in the schematic.
-
I will start by adding the parts I’m gonna use.
- The XIAO ESP32c3.
- SCD30 (CO2 Sensor)
- DHT22.
- TVOC sensor
- Particulate Matter –> I will use normal headers as I’m using an adapter to convert from 2.5 mm to 1.25 mm headers.
- RGB Ring
- External power jack and battery –> I will need just for the circuit demonstration
- Those are gonna be the main component I’m going to use the rest are just resistors and LED.
Now Let me move to the connection of each component with the XIAOESP32C.
- I will use PIN D0 to check the battery connected (charge level).
Here as seen the battery is connected to a jack then this jack is pulled to another pin to check the battery level.
- This connection is a suggestion in SEEEDSTUDIO documentation
- Then I will use the D1 pin to control the RGB Ring.
-
Here the data in pin is connected with the D1 on the Xiao.
-
Then PIN D4 and D5 are going to be connected to the pull-up resistor for the I2C bus.
These resistor are going to be 10K ohm and pulled up to 3.3 volt.
- Then from these pins I will connect the (SCD30 sensor and the TVOC sensor)
These two sensors are connected to the I2C Bus.
-
Then I will connect two LED’s on the UART pins (D6 and D7).
-
Then I will take extension to connect the Particulate Matter sensor to the RX pin of the Xiao.
- Then I will connect the DHT data pin to PIN 8 on the XIAO and I will pull up this pin using 10K resistor.
- Finally this is the final schematic.
Now lets move to the board design.
- Now I will RUN the ERC which will show me what errors I have after connecting the schematic.
I have many errors (33) this is because I have many pins unconnected.
- Then I will Annotate the circuit and then move to Board design.
- Then When we move to the board design (PCB file) –> The file is empty and we need to start with updating the PCB from the schematic and then we start the sorting of the component and then connect them all together as needed.
- Then we press on update board and we place the component.
- Then I will Draw a circle demonstrating My PCB dimension (Its gonna be 40 mm in radius).
Here I can assign on which layer I want the circle and its dimension.
Locking the shape means you can’t select it if the selection filter at the right side of the screen is not checked.
- Then I will start sorting the component within the circle.
-
Now I will just continue sorting the component in a way that satisfy my needs and all the VIAS are connected.
-
Then I will Route the board and prepare the needed files for the fabrication process.
RAW FILES
KICAD FILES
Gerbers and drilling files
Fabrication
Now I will prepare the files for the milling using Flatcam software then I will use the SRM20 to fabricate my board.
- I will start by importing my file to flatcam (Gerber + Drill).
- Then I will start selecting my tool I want to use (0.4 mm end mil) then I will add my settings.
- Now Putting my settings for this BIT.
- Then I will Save the Job to be sent to printer.
- Then I will generate the drilling file.
- Then the settings for the drilling.
- Then Saving the drill CNC code.
Now both the route and the drill file are ready so I need to generate the Cutout file to get the PCB out from the Entire board.
- THen I will add the settings for the cutout like the gab size and the number of gabs in addition to the margin offset of the Cutout from the board.
- Now I can add the settings for the bit of CUTOUT.
- Then I will save the CNC Job.
Now All my files to cut the board are ready I only need to prepare the SRM20 and import the Files to V-panel.
More Information about how to prepare the machine and how to setup the bed, Please refer to this LINK
- Now after importing the files to V-panel and setting the tool I need only to hit start and watch my board getting ready.
- And here we go the PCB is ready, we only need to cutout the Board.
- NOw after cutting the board.
Now We only need to solder the board.
- The solder process is very simple I will start by connecting the small component to large ones.
- Then I will connect the RGB as it is gonna be connected on the backside of the board.
- Then I will connect the large component and test the board.
- Then I only need to connect the External USB C connector.
- After I solder it with the board and testing it.
This is gonna be only for powering purposes so if the board needs to be re-programed we need to connect the XIOA.
NOw I can say the Embedded part of the project is fully done and it has a great system integration from a very messy look breadboard to a sleek lovely brownish board with no wires hanging over the other.
Now My next step is to finalize the Housing Design and start the process of fabricating it.