Week 7: Input Devices
Prior Experience: 2/5
I have some experience using input devices such as a temperature sensor, motion sensor, a microphone, an IMU, and a button in 6.08.
The Idea
I wanted to do something with a Hall Effect sensor because I've never worked with them before, and it seems like it could be applicable for my final project idea (for detecting/identifying the puzzle tiles).
PCB Design
I took inspiration from Neil's files on the website, and designed a simple PCB with a XIAO ESP32C3, breakout pins, and a single hall effect sensor. Initially, I had the hall effect sensor connected to 5V instead of 3.3V, but Anthony thankfully let me know before I milled that the sensor is not rated for 5V.
Milling
Milling was straightforward. I followed the same process I did in week 5 using the Othermill and Bantam software.
Soldering
I finally learned how to use the soldering iron to solder the more traditional way. I used the soldering iron for the microcontroller since it's so big. First, Anthony helped do the first pad by heating it up, putting a little bit of solder on the pad, placing the micrcontroller down, reheating, and putting a bit more solder on top. This ensured that the part would stay in place. It was really difficult at first. The solder kept just going onto the iron and not the board. I also was using the lead-free solder, which may have made it a bit more difficult. I finally started to get the hang of it on the last few pins. I think this took me way longer than it should've, like more than half an hour.
Programming
In loop, I just read the value of the sensor and then printed it out. I also made a version that would print out "North", "South", or "None" depending on the presence/orientation of the magnet.
Testing
It works as expected! As I bring the magnet closer to the sensor, the voltage reading either goes up or down depending on the orientation of the magnet.
In this version, when I bring the magnet very close to the sensor, it prints "North" or "South" depending on the orientation. It prints "None" otherwise.
Files
- PCB
- Code