To collect data on a suspected sleeping disorder, I built this project to record my heart rate and movement throughout the night. I borrowed an ear clip pulse sensor from a stationary exercise bike and interfaced it with an Arduino using a simple circuit which normalizes the photo-transistor’s output voltage and amplifies fluctuations. The Arduino senses rises and falls in voltage on one of its analog inputs and counts them as heartbeats. Motion is sensed with a crudely built vibrations sensor attached to my bed. It consists of a coiled thin wire pendulum which makes intermittent contact with a loop shaped electrode during vibrations. It is wired to the Arduino just like a button. Originally I had all heart beat events reported to a running desktop computer for logging, but I disliked this because it seemed silly to keeps a ~200 watt machine powered up for 8+ hours to collect only kilobytes of data. I reduced sampling rates, and made some other compromises in data collection, and now the sleep monitor stores data in the ATmega328’s 2kb of ram. When I turn on my computer in the morning, I can download the data with a C# application and have it stored to a comma separated value format file. CSV files load easily into Excel for analysis.
A major component of this project was the incorporation of a salvaged alphanumeric LCD from a defective answering machine with caller ID. The screen’s controller is a hd44780 equivalent, but the glass itself has many custom elements. Above the standard two lines with 15 characters each, there are over 80 individually addressable segments/elements. Most are arranged in 7 segment groups to produce digits. They behave like the exploded pixels of what would have been three normal characters. To use them I have to assign the three exploded characters to custom char values. I then have to modify the pixel patterns of the three custom chars to turn the elements on and off. Having no documentation, I had to toggle one bit of CC memory at a time and take note of which element was effected by they change. After discovering the memory addresses for all 80 something elements, I had to write all the code which switched the elements on and off in the appropriate patterns to produce readable numbers on the display. It would have been much easier just to spend the 5 bucks and buy an even better non-custom display, but where’s the fun in that.
Edit: A schematic from which I built my circuit from can be found here http://members.shaw.ca/novotill/IrPulseMonitor/index.htm I only used a fraction of this circuit as I was able to do the rest of the signal processing in software. In the image there is text that runs along the top. My circuit only extends up to the “B” in earlobe. Including more of the circuit likely would have resulted in more accurate readings.
Duration : 0:8:39