Pressure Sensors

Pressure sensor used to light a LED

This week’s labs had us build circuits that are activated by some sort of analog input.  I enjoy working with pressure sensors, so I decided to stick with them.

The first lab had me running a servo motor. The wiring and code seemed straightforward, and I was confident that I would get it up and running quickly. Unforchentely, I ran into a problem that I couldn’t explain. The servo wouldn’t turn on. I started my troubleshooting by mapping out the pressure sensor to make sure I was getting a reading. The pressure sensor was working correctly. I checked power to the servo next. I had power. Usually, my problem comes from my code, so I checked and re-checked it. Everything looked to be in order, so I decided to tear apart the circuit and rebuild it. After the rebuild, the servo was still not working. At this point, I needed a break. The next day a few of my classmates troubleshot the circuit with me. Eventually, someone mentioned that the servo might be broken. Quickly we switched it out, and everything worked perfectly. I tried two other servos, and they also worked. Lesson learned. 

Top down sketch of a breadboard layout. A pressure sensor is running a servo.

 

Video: Servo

The second lab was to run tones through a speaker and control them with sensors. 

Again, I couldn’t get the final device to activate. Power was running to my sensors and the speaker, but no sound was coming out. I thought back to my last lab and tested to see if my speaker was functioning and that my solder was good. Everything checked out. Something had to be wrong with my code. Eventually, I noticed that I had not mapped the sensor range correctly. After correcting for the proper mapping, the speaker worked! A much quicker fix then the servo lab. 

Example 1: Two pressure sensors running a speaker. 

Top down sketch of a breadboard layout. Two pressure sensors running a speaker.

Video: Two pressure sensors running a speaker

Video: “pitches.h” library example

Example 2: Three pressure sensors running a speaker.

Top down sketch of a breadboard layout. Three pressure sensors running a speaker.

Video: Three pressure sensors running a speaker

To wrap up this week my partner Stephanie Chen and I started to design our first project. We decided to make a padlock using four buttons. We started researching how to make this happen and developed a basic circuit sketch. We hope to get the circuit running, then change out the controls and build nice housing. 

Top down sketch of a breadboard , four switches, 2 LEDS.

Leave a Reply

Your email address will not be published. Required fields are marked *