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.
Excelent. I suggest SD-card memory, because it's cheaper to store long data. Do you have a blog or something like that with project details? My regards.
giancarlocpy 1 year ago
@giancarlocpy I may have tried SD Card storage if I thought of it but I don't remember there being an Arduino library available for it at the time. As far as a blog, no I don't have one now but I my set up something in the future. I went through a phase where I was doing a lot of YouTube vids and science projects, then I got distracted for a while, and soon I think I will start getting back into it. My plan is to better document my projects and share as much as I can so others can reproduce.
npaltmp 1 year ago
Very nice project. I wonder why instead of logging it into the limitted Arduino's memory, you did not use your computer to log the data. I've just started with the Arduino, but I've been using Basic Stamp for a while and take a look at the PLX-DAQ from Parallax, should not be hard to modify and use it to log your data.
hnilom 1 year ago
@hnilom I'm a little obsessive about energy efficiency and always turn my computer off when I'm not using it. I originally was logging directly to the computer but added the logging on Arduino feature to stay green. Probably only prevented the burning of half a lump of coal but at least it made me feel like I was making a difference. :) I also did it for the challenge.
npaltmp 1 year ago