During our first semester at Penn, we realized many of our friends (and even us sometimes) don't sleep the full 8 hours required for us to be healthy. This had a lot of negative effects on our lives that are not directly perceivable: like lower academic performance, worse mood and mood swings, and decrease in happiness. We wanted to find a way to make quality of sleep quantifiable, because a doctor currently can only qualitatively determine the quality of our sleep during a checkup.
What it does
It measures biometric values during our sleep, aggregates the data, and sends it over wifi to a library where it can be stored, manipulated, and analysed. The data is worked on before being sent: it's cleaned up and scale-adjusted. It also uses some of the data provided to determine other important information (e.g. heartbeat to determine BPM).
How to use it
The Sleep Sensor Glove is a very easy to use product. Your doctor creates a channel on thingspeak specifically for your information and programs its "write key" into the arduino. After that, it's all plug-and-play. Wear the comfortable glove, attach the arduino on your arm tightly and let the sandman do his job!
This glove includes a temperature sensor, an accelerometer, and a pulse (heart rate) monitor. Each sensor is carefully soldered to wires we cut ourselves which makes sure the sensors are always connected to the arduino. Each Sensor has three main pins: 5V, Ground, and one or multiple Signal pins. We mounted a mini-breadboard on the arduino to be able to connect all the sensors to their respective pins without compromising the slick and miniaturized design of the Glove. The Sensors were then glued into the inside of the glove carefully and positioned to be in full contact with the wearer's skin at all times. The raw Data from the Sensors is turned into values we want and can read: all sensors originally output an Analog voltage value between 0 and 5V (digitized to be an integer between 0 and 1023). The accelerometer gives us three different accelerations (x y z). We find the value of the overall acceleration vector's magnitude by applying the extended pythagoras theorem on the three values. As for the Pulse sensor, which outputs a heart rate, we use the "PulseSensorPlayground" library to determine BPM. It does this by determining the change in the distance between a beat and the one after it. We use thingspeak to store all the data aggregated over a night's sleep which gives us great insight into our health.
Quite honestly, we faced many problems during the making of this project. First and foremost, our original goal of sending 5+ streams of data over thingspeak and then analysing it using the online MATLAB editor proved to be way too ambitious. We discovered that the arduino wifi has many memory limitations (especially after including the wifi library "Ciao"). Thus, we could not send more than 2 streams of Data over thingspeak and had to settle with just serial plotting the pulse and BPM data (arduino Mega's were not available in the lab). Moreover, many sensors broke after we glued them (we had to replace the temperature sensor 5 times). We solved that last one by laying down the glue on the glove and waiting for it to cool just enough so that it wouldn't break the sensor but hot enough that it would still stick. Every time our project didn't work, we had to deconstruct the whole thing and test out every component individually. I can confidently we've taken apart and rebuilt our project entirely over 20 times after it was completed because of a random bug like a wire short circuiting another or the SD card shield (which we eventually stopped using) malfunctioning.