Week 08. Electronics Design¶
Group Assignment:¶
- Use the test equipment in your lab to observe the operation of a microcontroller circuit board.
- Send a PCB out to a board house.
Takeaways:
- Double-check connections and settings before proceeding with any measurements or analysis.
- After calibration, verify that the Oscilloscope settings match the expected parameters.
- Ensure that the displayed waveform accurately represents the input signal.
- Use appropriate probes and cables for accurate measurements.
- Ensure proper grounding and insulation to prevent electrical hazards.
Individual Assignment:¶
- Use an EDA tool to design a development board to interact and communicate with an embedded microcontroller.
- Produce it, and test it.
Disclaimer: All the Assignments and Documentations are done and written by me, however after writing it myself, some I pass it through chatGPT to fix my language and grammar.
Exploring ESP32¶
With my final project in mind, I began delving into the ESP32 microcontroller to understand its capabilities. I started by learning about the ESP32 microcontroller online, focusing on its GPIO pins.
image source
I read through various resources to understand how the GPIO pins work and which ones are suitable for inputs and outputs. I decided on the GPIO pins I needed for my project, being careful not to choose too many to avoid complications. I made sure to include important pins like GND, 3.3V, and 5V PWR, as they are necessary for compatibility with different components.
Designing the PCB¶
- I downloaded KiCad from the provided link and followed the installation instructions for my operating system. Once installed, KiCad was ready for use on my computer.
- I cloned or downloaded the Fab Library from the provided repository and renamed the directory to ‘fab’ for easier management.
- Opening KiCad, I navigated to Preferences >> Manage Symbol Libraries and added ‘fab.kicad_sym’ as a symbol library. Similarly, I added ‘fab.pretty’ as a footprint library under Preferences >> Manage Footprint Libraries.
- I launched KiCad and created a new project. For this project as reference, I used Joanne’s example. Using the Schematic Editor, I designed the schematic by placing components onto the workspace.
- Components were added using the letter ‘A’ shortcut and other Shortcuts for KiCAD. Providing net label, I connected the components to establish the correct signal flow. To validate the schematic design, I ran the Electrical Rule Checker (ERC) under the Inspect menu.
- Below is the image of the PCB schematic
- I proceeded to assign footprints to components in preparation for PCB layout. Using the Tools menu, I accessed the Assign Footprint tool. Searching for appropriate footprints for each component, I ensured compatibility and alignment with the schematic design. I verified footprints in both 2D and 3D views for accuracy.
- Transitioning to the Board Editor, I opened the PCB board editor. I arranged components on the board, considering space constraints.
- I configured design rules and constraints under Edit Board Setup >> Design Rules >> Constraints, specifying parameters like minimum clearance, etc and also I gave pre-difined sizes for tracks.
- Validating the design, I ran the Design Rule Checker (DRC) to identify and address any potential errors or violations.
- To prepare the design for fabrication, I plotted it in the desired format (e.g., SVG). Navigating to File >> Plot, I selected the necessary layers to include in the plot, such as F.Cu (front copper layer) and Edge.Cuts. And also I exported svg file directly from file menu as well.
- Below is the image of the PCB traces
- After I am happy with my design, I searched for the necessary components required for my board.
Milling & Soldering¶
- Utilizing mods, I selected the ROLAND SRM 20 program to generate tool paths for the milling operation. To prepare for milling, I secured a sacrificial board using tape to protect the milling bed. Apply double-sided tape to the desired stock and firmly press it onto the bed. Inserted the chosen bit size into the set screw and tighten it with an Allen wrench. Utilize VPanel to set the machine origin and select RML files for milling operations. With VPanel, adjust the machine origin to the desired spot and ensured accurate positioning for milling tasks.
- Begin by tracing the mill using a 1/64 inch bit, ensuring the shield is closed and the machine is powered on. Next, set the origin and Z-position. Load the SVG file in Mods, adjust settings, and proceed with cutting, switching to a 1/32 inch bit as needed. After cutting, vacuum out debris, remove the cut part, and clean the board with alcohol or water for a finished PCB.
- After milling, I proceeded to solder the components with great care, particularly mindful of the ESP32’s small pin spacing.
Testing¶
- Firstly, since the ESP32 comes with a pre-installed bootloader, manual loading is unnecessary. Secondly, the ESP32 lacks native support for USB protocol. Therefore, I designed the board with an FTDI connector instead, requiring a USB/TTL converter or cable to establish communication between the MCU and the computer. For the FTDI connector, I utilized the VCC, GND, RX, and TX pins, disregarding the CTS and RTS lines, which remained unconnected. image from this link
- To connect it to my board, I directly linked the respective pins:
- VCC to VCC
- GND to GND
- RXD to RX
- TXD to TX
- I began by developing a program using the Arduino IDE for ESP32 Blink LED.
// LED on GPIO15
int ledPin = 15;
void setup() {
// set LED as output
pinMode(ledPin, OUTPUT);
// Serial monitor setup
Serial.begin(115200);
}
void loop() {
Serial.print("Hello");
digitalWrite(ledPin, HIGH);
delay(500);
Serial.println("world!");
digitalWrite(ledPin, LOW);
delay(500);
}
Remember: Flip the switch to prepare the ESP32 for a new program to be loaded and press the reset button to reset the ESP32. Using the Arduino IDE, compile and load the program onto the board and flip the switch back off to ensure proper configuration followed by pressing the reset button once more. Now, the program should execute as intended.
- I uploaded the program and faced an error saying “failed to connect to ESP32; no serial data received.” I tried to solve this issue by flipping switches and pressing the enable button. I also checked the power source to ensure the chip was receiving a stable 3.3V. I checked that all pins were connected as described in Boot Mode Selection and verified the voltages at each pin with a multimeter. The “high” pins were close to 3.3V, and the “low” pins were close to 0V, indicating proper voltage levels.
- During troubleshooting, I found that there was no continuity between the MCU_Rx pin on the chip and on the FTDI. This turned out to be due to poor soldering. I resoldered the connection, and finally, the problem was solved. It’s a valuable lesson to remember that 90% of the time, soldering is the problem.
- To test the functionality of my breakout pins, I modified the code by changing the pin number to 32 and uploaded it. Yes! It worked perfectly.