This week I worked on the code to pull acceleration data from the arduino and on the ethics assignment.
Interpreting the acceleration data proved to be a bit difficult. All of the code samples I found online for how to use the sensors were incomplete. The acceleration data was sent to the Arduino’s analog inputs using a scaled voltage. The first code sample I found only read the scaled voltages and did not apply any manipulations to the voltages, so it was confusing when I was getting readings in ~300-400 range. It required a bit of data sheet digging to figure out how exactly the scaled voltage corresponded to an acceleration measurement. After writing the code to map the range of voltage values to force in G’s, I noticed that the G force was a bit off. I expected 1G due to earth’s gravitation field but I was getting ~0.7g. I used a calculator to verify that my mapping equation was correct and that I just needed to recenter the mapping so that the voltage mapped to 1G instead of 0.7g.
I am a bit behind schedule. The ECG sensor and HR sensor didn’t arrive until Friday, so I was not able to start working on the code to pull data off the ECG sensor/HR sensor.
Next week, I will work on writing the code to pull HR data off the HR sensor and work on writing the code for BT transmission to the desktop application.