About Me

Input Devices

This week, we had to measure something: adding a sensor to a microcontroller board that we have designed and read it. I added a ESP32-CAM and read it and an A4953: Full-Bridge Motor Driver. I used KiCad to design the board. This process took a lot longer than I expected because I had to design and then redesign the board two times. This took me a very long time to design because I still struggled to understand the logic of when to add a capacitor or connect a trace to ground. Nevertheless, I finally understood the purpose of jumper resistors and capacitors. So I'm happy that I'm learning the logic of what I'm doing. The first time I used the incorrect ESP32-CAM footprint. I mistakingly used the Radio_ESP-WROOM-02D. I found the correct footprint on SnapEDA. Here is what my design looked like before I replaced the footprint.
blink
Unfortunately, I didn't figure out this mistake until after I finished milling the board two times. :(Good news: I did get a lot more comfortable with the milling process. The first time that I milled the board, I think the end mill broke, which resulted in a board that looked like this:
blink
After I changed the end mill, the board milled correctly:
blink
While I was putting on my components, I realized that the ESP32-CAM footprint was incorrect. This mistake could have been avoided if I looked at the ESP32CAM that was in the CBA and compared the number of legs to the number of legs on the footprint. After, I discovered this mistake, I had to redesign the board, which took me a while because I'm still new to this. Here is the final board and schematic:
Here are the final components that I used:
blink
Here is the final board design on KiCad: blink After I had the final board design, I exported everything to Inkscape again and I started the milling process. The first time that I milled the board, I had the wrong cut depth, so the board didn't mill all of the way.
blink
The next time that I milled the board, I realized that it didn't mill the holes. So I tried to export the bottom layer from KiCad as an SVG, then use Inkscape, then mill the board. Unfortunately, the holes were not aligned with the footprint.
blink
So David suggested that I copy and paste the holes(the bottom layer in KiCad) to the Inkscape with the footprints, so that I can ensure that the alignment was perfect. Thankfully, this worked! Yay! I finally had a board design:
blink
blink
blink
Unfortunately, this was only the beginning of a lot of problems with my board. Once I realized that I wasn't getting 3V3 volts out of my regulator, I tried several things (which took several hours to debug. Thank you to Andres, Zack, David, and Anthony for your help!): (1) changed the resistors to 0 ohm resistors, (2) used a razor to cut traces near the jumper resistor, (3) desoldered the ESP32-CAM.
After this huge lesson, I still received the following error when I tried to upload the code "Failed to connect to ESP32: Timed out waiting for packet header". I used the CameraWebServer example on Arduino. I mainly just changed the code so that it connected to my hotspot. As a result, I followed a bunch of tutorials about resetting the ESP32-CAM and troubleshooting and moving the switch on and off(such as holding the BOOT/FLASH button until it flashes a couple times, holding the BOOT/FLASH button until the Arduino IDE says "connecting...", holding the BOOT/FLASH button until it is done uploading) from these websites: https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/ and https://randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/, but I could't seem to find a pattern for how to ensure that the code actually finishes uploading all of the time.
This is where Andres was a huge help. He suggested that I resolder the resistors and added some sort of copper adhesive tape because some of the copper was taken off when I desoldered some of the components. Unfortunately, it wasn't double sided copper tape, so he showed me how I needed to make sure the solder was around the tape. After using the voltmeter to check all of the traces on the board, we dedcided to replace the ESP32-CAM and add copper tape to parts of the board that came off. Next, I tried to upload the code again, but to no avail. After a few more tries,I realized that I needed to consistently check that my hotspot was connected and Voila! It started to work. I could finally take pictures, and stream videos. Yay!
blink
Also, I started to do this tutorial about image recognition for my final project, but I ran into some errors:
Link to image recognition tutorial
blink
Link to input devices files

Group Assignment

My group probed an input device's analog levels and digital signals. Anthony helped us use an oscilloscope to probe an ultrasonic sensor, which was connected to a PCB board. Anthony decided to put a lego sheet on top of the ultrasonic sensor. The oscillator was able to correctly measure the distance between the lego sheet and the ultrasonic sensor because Anthony was holding the sheet about .7 meters away from the sensor(around 2 meters there and back) and the time on the oscilloscope was around 2 milliseconds.
blink
blink
The green line is the trigger. We used the following formula to determine the distance of the lego sheet there and back from the sensor: time it takes for sound to travel to the lego sheet *(speed of sound) =343 m/s * 2 ms = 0.6 meters.

CameraWebServer code