This project is intended to log flight data from a 9 DOF sensor module to an SD card, and simultaneously transmit its GPS location via cellular networks to a server. This system allows the rocket to be found if the landing area of the system is beyond LOS.
Step 1: Parts List
1x ATmega328 Microcontroller (Arduino UNO, Nano)
1x Micro SD Breakout - https://www.sparkfun.com/products/13743
1x Micro SD Card - (size does not matter FAT 16/32 formatted) - Amazon Link
1x Gy-86 IMU - Amazon Link
1x ATmega328 Microcontroller (Arduino UNO, Nano)(each system needs its own micro)
1x Sim800L GSM GPRS Module - Amazon Link
1x SIM Card (must have data plan) - https://ting.com/ (ting only charges for what you use)
1x NEO 6M GPS Module - Amazon LInk
1x 3.7v lipo battery
1x 3.7-5v step-up converter (if you dont build the pcb)
1x Raspberry pi, or any computer that can host a php server
-Access to 3D printer
-BOM for pcb is listed in spreadsheet
-Gerbers are at github repo - https://github.com/karagenit/maps-gps
Step 2: Subsystem 1: Position Tracking
Once you have the parts for the system (NEO-6M GPS, Sim800L) in hand, you need to test the functionality of the systems independently so you wont have a headache trying to figure out what isnt working when you integrate the systems.
To test the GPS receiver, you can either use the software provided by Ublox (U-Center Software)
or the test sketch linked in the github repo (GPS Test)
1. To test with U-center software, simply plug the GPS receiver in via USB and select the com port in U-center, the system should automatically begin tracking your location after that.
2. To test with a micro-controller, upload the GPS-testing sketch to an arduino via the IDE. Then connect 5V and GND to the labeled pins on the receiver to the arduino and GPS RX pin to digital 3 and TX pin to digital 4 on the arduino. Finally open the serial monitor on the arduino IDE and set the baud rate to 9600 and verify the coordinates received are correct.
Note: A visual identifier of satellite lock on the NEO-6M module is that the red led indicator will blink every few seconds to indicate a connection.
To test the cellular module you will need to have a sim card registered with an active data plan, I recommend Ting because they only charge for what you use instead of a monthly data plan.
The goal for the Sim module is to send an HTTP GET request to the server with the location that is received by the GPS receiver.
1. To test the cell module insert the simcard into the module with the chamfered end facing out
2. Connect the sim module to GND and a 3.7-4.2v source, do not use 5v!!!! the module is not capable of running at 5v. Connect the Sim module RX to Analog 2 and TX to Analog 3 on the Arduino
3. Upload the serial pass-through sketch from the github to be able to send commands to the cell module.
Once you have verified that both systems work independently, you can move on to uploading the full sketch to the microcontroller github. you can open the serial monitor at 9600 baud to verify that the system is sending data to the webserver.
*dont forget to change the server ip and port to your own and make sure to find the APN for the cell provider you are using.
Move to the next step where we set up the server
Step 3: Server Setup
To setup a server to display the location of the rocket, I used a raspberry pi as the host, but you can use any computer.
Follow this tutorial on setting up lightphp on an RPI and then copy the php files from the github into the /var/www/html folder of your RPI. After just use the command
sudo service lighttpd force-reload
to reload the server.
Make sure to forward the ports associated with the server on your router so you can access the data remotely. On the rpi it should be port 80, and the external port can be an arbitrary number.
Its a good idea to set a static ip for the RPI so the ports you forward always point towards the RPI's address.
Step 4: Subsystem 2: Telemetry Logging
The telemetry program runs on a separate microcontroller from the position tracking system. This decision was made due to memory limitations on the ATmega328 preventing both programs being able to run on one system. Another choice of microcontroller with enhanced specifications could resolve this issue and allow the use of one central processor, but I wanted to use the parts I had on hand for ease of use.
Features: This program is based on another example I found online here.
- The program natively reads the relative altitude (altitude reading zeroed on startup), temperature, pressure, acceleration in the X direction (you will need to change the direction of acceleration read based off physical orientation of the sensor), and a timestamp (in millis).
- To prevent data from being logged while sitting on the launchpad and wasting storage space, the system will only begin writing data once it detects an altitude change (configurable in the program) and will stop writing data once it detects the rocket has returned to its original altitude, or after a flight time of 5 min has elapsed.
- The system will indicate that it is powered on and writing data via a single indicator LED.
To test the system first connect the SD card breakout
Arduino SD Card
Pin 4 ---------------- CS
Pin 11 -------------- DI
Pin 13 -------------- SCK
Pin 12 -------------- DO
Now connect the GY-86 to the system via I^2C
Pin A4 -------------- SDA
Pin A5 -------------- SCL
Pin 2 ---------------- INTA
On the SD card create a file in the main directory named datalog.txt this is where the system will write data to.
Before uploading the Data_Logger.ino sketch to the microcontroller change the value of ALT_THRESHOLD to 0 so the system will ignore the altitude for testing. After uploading, open the serial monitor at 9600 baud to view the output of the system. Ensure that the system is able to connect to the sensor and that data is being written to the SD card. Unplug the system and insert the SD card into your computer to verify that data was written on the card.
Step 5: System Integration
After verifying that each part of the system works in the same configuration used on the main PCB its time to bring it all together and get ready for launch! I have included the Gerbers and EAGLE files for the PCB and schematic in the github . you will need to upload the gerbers to a manufacturer such as OSH park or JLC to have them produced. These boards are two layers and are small enough to fit into most manufactures 10cmx10cm category for cheap boards.
Once you have the boards back from the manufacture its time to solder all the components found in the spreadsheet and the parts list onto the board.
After everything is soldered you will need to upload the programs to the two microcontrollers. To save board space I did not include any USB functionality but did leave the ICSP and serial ports broken out so you can still upload and monitor the program.
- To upload the program follow this tutorial on using an Arduino board as a programmer. Upload SimGpsTransmitter.ino to the ICSP_GPS port and Data_Logger.ino to ICSP_DL port (The ICSP port on the PCB is the same layout as what is found on standard Arduino UNO boards).
- Once all programs are uploaded you can power the device from the battery input with 3.7-4.2V and utilize the 4 indicator lights to verify the system is working.
- The first two lights 5V_Ok and VBATT_OK indicate that the battery and 5v rails are powered.
- The third light DL_OK will blink every 1 second to indicate that the telemetry logging is active.
- The last light SIM_Transmit will turn on once the cellular and GPS modules are connected and data is being sent to the server.
Step 6: Enclosure
The rocket that I am designing this project around has an internal diameter of 29mm, in order to protect the electronics and allow the assembly to fit inside the cylindrical body of the rocket I made a simple two part 3d printed case that is bolted together and has viewing ports for the indicator lights. STL files for printing and original .ipt files are in the github repo. I did not model this as I was unsure of the battery I would use at the time, but I manually created a recess for a 120 mAh battery to sit flush with the bottom of the case. This battery is estimated to give ~45min maximum runtime for the system at ~200mA power consumption (This is dependant on processor usage and power draw for data transmission, the SIM800L is quoted to draw upwards of 2A in bursts during communication).
Step 7: Conclusion
This project was a pretty straightforward implementation of two separate systems, given that I was just using discrete modules found on Amazon the overall system integration is a bit lackluster as the overall size of the project is quite large for what it does. Looking at offerings from some manufacturers, utilizing a SIP that includes both cellular and GPS would greatly reduce the overall package size.
I am certain that after more in flight testing I will have to make some modifications to the program and will be sure to update the Github repo with any changes.
Hope you enjoyed this project, feel free to contact me about any questions you might have.
This is an entry in the
Arduino Contest 2019