Project 4: Communication
The purpose of this project was to use an external peripheral that communicates with the microcontroller using a serial protocol of some kind, write a driver program that can be operated remotely by another computer, and use the microcontroller to collect data with the notion of making a statistical case that the data collected was legitimate. In order to achieve these goals our group decided to use the Triple Axis Accelerometer and isolate the three different axes and prove that the values collected are correct. Any error found in the collected values would have been a result of not being able to completely isolate the axes or an error in the peripheral.
In this project we proved that we were able to create a driver program that we could operate from another computer in order to use an external peripheral and find statistical date to prove that we were able to successfully do these two things. We decided to use the triple axis accelerometer to achieve this. The main functionality that we observed in this project was sensing the amount of acceleration present in each of the three axes. When we were creating our driver program we created a program where the peripheral would collect a certain amount of data points for a certain amount of time, but we made it so that it would not start finding and printing these values until we typed a letter into the serial monitor. In order to prove that we were able to successfully use the accelerometer we chose to isolate the axes. We did this because an object that is not in motion will always only have an acceleration of 1G or 9.81m/s in the negative Y axis. We used this to move the accelerometer to three different positions, one with each of the axes facing downwards. The reason we did this was because in each of these different scenarios we would expect to see a value of 1G in the axis that is facing downwards and a 0 in all the other axes.
The code we used was: In this code whenever we type a g into the serial monitor it would begin to collect data and it would collect 100 meausrements with 100 ms in between each different point collected. This is a picture of how the accelerometer connects to the arduino: