34 SERVO 08.2017
being sure the sensors saturated at 65535 — the full 16-bit
reading — then by holding a phone displaying a solid screen
of pure red, green, or blue, and ensuring that the
corresponding values spiked. In ambient lighting, my sensor
values were all well below the maximum value.
Next up: the GPS. Upload the GPS_Test sketch (Figure
6) and open the serial monitor. Make sure your GPS has an
open view of the sky, and give it a few minutes to get a
lock. I find having a 15’ USB extension cable around is
great to be able to stay at my bench and have the
hardware running outside on the back patio.
This test sketch just displays the latitude, longitude, and
elevation of the GPS. We are not looking to show off
the bells and whistles here, just do a simple
After a lock is achieved, copy the latitude and
longitude into the Google Maps search
( https://www.google.com /maps) and make sure the
location shown is indeed where you are. My older GPS
module took quite a while to lock but it was surrounded
by buildings, likely complicating things with significant
Finally, we need to test the SD card writing. This
part actually was the trickiest because different Arduino
boards will use different pins for the chip select CS line.
Insert a FAT formatted card into the SD slot. If you need
a good formatting utility, the official tool from the SD
Association is highly recommended
( https://www.sdcard.org/ downloads/formatter_ 4).
Upload the SD_Card_Test sketch (Figure 7). This is a
simple writing test. The card should have a file named
“testing.txt” on it after the sketch runs that contains a line
of test text.
Now that all of the unit tests are passing, we’ll upload
the flight firmware and give the integration test a go.
Upload the GST_SD_Logger sketch from the Flight_Sketch
directory. There are a few serial messages displayed to help
troubleshoot if things are getting stuck somewhere, but
since we’ve already tested each module the sketch should
run smoothly, blinking the onboard LED during writing and
logging data once per second.
Figure 8: Velcro straps and double-stick tape made quick work of securely
mounting the Wildfire and breadboard to the flight deck of the H-Quad.
Figure 9: Electrical tape temporarily affixed the sensors to the side of
the airframe facing the ground (or nadir) direction.
Figure 7: SD card unit