cover2

Pulse Sensor Fail

After such a smooth process with last week’s switch assignment, I got really ambitious for this week’s analog input assignment. Things didn’t go nearly as nicely this week.

What I Wanted to Do

I wanted to connect a pulse monitor my Arduino and play the sound of a heartbeat with each pulse. If I was able to get it working, then I was going to sew a strap of some type to attach it to my body (on the ear) and, finally, connect a transmitter so that the attachment on the body could be very lightweight.

My hope was to use it in aerial performance. I have a friend who did a trapeze performance with a leotard that lit up with her heartbeat. I didn’t see it, but just hearing about it and seeing pictures got me very excited. I have a pretty minimal performance style and think that an aerial performance piece to the tune of my own heart would be outstanding. Pushing it a bit further, it would be great to have two or more performers sending their heartbeats during a performance and to find a way to mix them.

For this week, I was just going to try to get the pulse input and the audio output.

What Actually Happened

Finding the pulse monitor was easy enough. I went to Tinkersphere and got this one.

Then I ran into a number of challenges:

  1. I needed to learn to solder. I bought the sensor with no wires so I could make the wires at the length I wanted. I went down to the shop and got a lesson. It went reasonably well.
  2. I tried to connect the breadboard with two leds per the Pulse Sensor instructions and blew out my two leds with too much voltage.
  3. Then I tried to use their code. Ha!
  4. When I ran their code, my computer wouldn’t recognize my Arduino port. I did a bunch of Googling which resulted in me installing new drivers. Eventually, after lots of downloading and wiggling of wires, it started working (still not sure what fixed it).
  5. Then, I was getting a “no such file exists” error. Again, a bunch of Googling, and this time it appeared that I had installed the Arduino software in the wrong place on my computer. It hadn’t caused a problem before, but reinstalling the software in my applications folder did the trick.
  6. Finally, when I got the code running, I was getting lots of question marks in my serial monitor. And a second year, Justin, told me that it was because my serial output was at the wrong baud rate. I changed it to 9600 from 115200 and it worked.
My first attempt.
My first attempt.

After lots of frustration with the sensor, I spoke to two second years (Justin and Thea) who had experience with the sensors. They said that the sensor was pretty buggy and also that its code was more than I needed.

I scrapped the sensor’s code and decided to write my own. It sorta worked, but I couldn’t get the range to work. So, I wrote to Benny and she told me, as I suspected, that the sensor was more complicated than a typical analog input sensor, and suggested that I prototype with something more straightforward.

Results

In the end, I made a very simple program with a photosensor and an led. When the sensor reading goes below a certain level, the led lights up. What I’d like to do from here is replace the photo sensor and led with the pulse sensor and the audio output.

The result.
The result.

For my own reference, here are things that Justin and Thea recommended looking into:

My Final Code