Wednesday, April 4, 2012

Arduino Working With All Sensors

Lead Author: Steven Schultz


Goals


The goal of this test is to make sure the Arduino works with all sensors running simultaneously.  This is important because all the sensors need to be running and taking data at all times during the flight.  We also need to make sure the code can use temperature readings from our TMP36 to calculate humidity and pressure.

Testing


To test this, we connected all the sensors to the Arduino Nano on a breadboard as shown in the picture below.


Each sensor is connected to different analog pins of the Arduino.  All of the analog pins are being used.  The sensors being used are: 2 temperature sensors, an accelerometer, a humidity sensor, and a pressure sensor.  We powered the Arduino by connecting it to a computer with a USB cable.  This also allowed us to view the data through the serial monitor of Arduino.  The code did not change much from the individual testing.  Each sensor has its own function which reads the voltage from the analog pin it is connected to, calculates its specific value based on the sensor, and returns the value to the main program.  These values are all recorded on the same line of the serial monitor.

Results


For the initial test, data was output to the serial monitor once per second.  This worked fine with no change to the code.  Then, we collected data overnight at a rate of 10 times per second.  After running for about 8 hours, the code was stopped.  Data was consistent and changed when expected.

Recommendations


The next step is to get all the sensors to record data to a data logging device.  We have chosen a SD data logging method.  Once we can write all the data to the SD card, we will mount all of the sensors and Arduino to a perf board and test again.  The final step will be to power the Arduino from batteries and calibrate the code to account for the change in input voltage.

No comments:

Post a Comment