Tornado research has been done by many skilled meteorologists but rarely does the public help. Cost, skill and design ideas likely hamper this. With more storm chasers getting close to tornadoes, an opensource project equipped with inexpensive, easy to access sensors and a simple design, is needed. This project will help severe weather researchers attain useful data from many storms without a large scientific team and lots of funding. Also it will include storm chasers in scientific research!
Original idea of a rocket sensor probe is from Team Dominator.
Notice: Launching a rocket in a thunderstorm is dangerous due to the possibility of triggering a lightning bolt. Please do not be near the rocket when launching in this environment. Also, tornadoes are extremely dangerous and your life is not worth data. please use at your own risk!
How to Assemble:1. Reyax RYLR890 LoRaModuleSetup
To setup the module, you must connect the Reyax RYLR890 to a Serial Adapter such as the one provided in the code header. The GND and 3.3v are connected like read and the TX pins and the RX pins must be flipped. This means the TX pin on the Serial Adapter must be connected to the RX pin and the RX pin on the Serial Adapter must be connected to the TX pin on the module. Once done, plug it into your computer, open the Arduino IDE, choose the correct COM port in Tools/Port and then open the Serial Monitor in Tools/Serial Monitor. In the top there is a white line to type. Type in AT and it should output +OK. If it does not, recheck the wiring or COM port. If it returns +OK, do the following commands:
- AT+RESET
- AT+ADDRESS=1 (Change this number to your favorite number. Do not use 1)
- AT+IPR=38400
- AT+PARAMETER=12, 4, 1, 7
- AT (Change baud rate on Serial Monitor to 38400 before doing this. Should get +OK)
The Reyax module is ready to use!
Now we should do this for the second module, but change the address to another number that is not the number you chose, 1 or 0. Remember these numbers because in the code you will have AT+SEND= and you will put the receiver address number there.
2. Pinouts/Wiring
Here is where the wires will go. The wiring of the resistors is a bit tricky so I have provided an image below to show you how they are to be wired. If you are assembling a rocket, ports on the Nano that have multiple wires leading to it, I soldered a lead wire and then tied the multiples to the other rends and then soldered and taped those junctions. I have that pictured below to describe what I mean here.
Sensor --> Nano Every
1. MPL3115A2
Vin --> 5v
GND --> GND
SCL --> A5
SDA --> A4
2. SHT31
Vin --> 5v
GND --> GND
SCL --> A5
SDA --> A4
3. Ultimate GPS
Vin --> 5v
GND --> GND
RX --> D7
TX --> D8
4. MicroSD card Breakout
5v --> 5v
GND --> GND
CLK --> D13
DO --> D12
DI --> D11
CS --> (ChipSelect) D10
5. LoRa Module
VDD --> 3.3v
GND --> GND
RX --> D9
10k Ohm Resisitor D9 --> RX
5k Ohm Resistor RX --> GND
6. LED Lights
1. D2 and GND for Transmission
2. D3 and GND for GPS
Here is how to wire the resistors. The Ground wire will be split in half and should have another wire attached to it that leads to the ground pin. It passes through the ground wire.
Here is what I mean with adding a leader wire. It would be wired in parallel.
*I wired this in a way that the LoRa module and GPS antenna were put in the very tip of the nose cone like so. The wires from the 3.3v port on the Nano Every were extended to fit it like so.
3. Code
Now that you have assembled and wired the components of the rocket, it is time to test with the code.
First you must download the libraries which include:
1. TinyGPSPlus
2. SD
3. Adafruit_MPL3115A2
4. Adafruit_SHT31.h
5. SoftwareSerial
Go to Tools/Manage Libraries and type each of these in and install them. Once done, you are set to copy/paste the code and upload to the Nano Every using the arrow in the top left corner of the IDE.
Lets Understand the code:
- The header files below import the functions and methods from the libraries you installed. They interface with the sensors.
#include "Adafruit_SHT31.h"
#include <Adafruit_MPL3115A2.h>
#include <SPI.h>
#include <SD.h>
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include "TinyGPS++.h"
- The next lines define which ports on the Nano Every will use for the LEDs, Create TX and RX ports with Software Serial ports and create global variables to be used in each parts of the code.
#define pin 2 // Used with the LED
#define gpsPin 3 //Used with GPS
SoftwareSerial GPS(8, 7); // RX, TX
SoftwareSerial Reyax(8, 9); // RX, TX
TinyGPSPlus tinygps;
Adafruit_SHT31 sht31 = Adafruit_SHT31(); // Initialize SHT31 sensor
Adafruit_MPL3115A2 baro; // Setup the pressure for the MPL3115A2 sensor (value put in below)
const int chipSelect = 10; // port for CS with the SD card
const double currentPressure = 1013.26; //Change this to correct pressure in hPa for accurate results
int id = 0;
- The setup checks the wiring and makes sure everything is working properly. The SD card reader may run into issues the most so be careful with the wiring of that. Here is the setup code for the Transmitter:
// initialize digital pin LED_BUILTIN as an output.
pinMode(pin, OUTPUT); // Initialize LED as output for Transmission
pinMode(gpsPin, OUTPUT); // Initialize LED as output for GPS fix
Serial.begin(9600); // Start the serial ports
Reyax.begin(38400); // Start the Reyax module Software Serial port
GPS.begin(9600); //Start the GPS module
// Make sure all sensors are initialized, wired correctly and are operational
Serial.println("SHT31 test"); //Test SHT31 Sensor
if (! sht31.begin(0x44)) { // Set to 0x45 for alternate i2c addr
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
Serial.println("Adafruit_MPL3115A2 test!"); //Test MPL3115A2 sensor
if (!baro.begin()) {
Serial.println("Could not find sensor. Check wiring.");
while (1);
}
// use to set pressure for current location
baro.setSeaPressure(currentPressure);
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
while (1);
}
Serial.println("card initialized.");
Serial.println("Setup complete");
//Loop will start once this is printed to Serial Monitor.
- The loop function will run continuously in a loop until you return from it or power off the device.
- This segment of code checks if there is data available and then parse's the GPSs' NMEA statement to obtain the data latitude, longitude, altitude and speed.
while (GPS.available() > 0) {
if (tinygps.encode(GPS.read())) { // Did a new valid sentence come in?
digitalWrite(gpsPin, HIGH); // turn the LED
delay(100);
digitalWrite(gpsPin, LOW); // turn off the LED
}
}
- This code creates empty strings and then puts the data from the sensors into the strings to be used to transmit and save data to an SD card.
String pressureString = ""; // empty strings for data
String altitudeString = "";
String temperatureString = "";
String humidityString = "";
String latitudeString = "";
String longitudeString = "";
String speedString = "";
String idString = "";
String hourString = "";
String minuteString = "";
String secondString = "";
String timeString = "";
String dataString = "";
pressureString.concat(baro.getPressure()); //Concatenate values into String
altitudeString.concat(tinygps.altitude.meters());
temperatureString.concat(baro.getTemperature());
humidityString.concat(sht31.readHumidity());
latitudeString.concat(String(tinygps.location.lng(),6));
longitudeString.concat(String(tinygps.location.lat(),6));
speedString.concat(tinygps.speed.kmph());
hourString.concat(tinygps.time.hour());
minuteString.concat(tinygps.time.minute());
secondString.concat(tinygps.time.second());
- This code creates the timeString and DataString into the formats we want. Time String is in XX:XX:XX being captured in UTC time and the data string is saved as Comma Separated Values (CSV) for easy saving. Also included is a counter variable ID to help determine what observation was collected.
timeString += hourString; // Create time string in XX:XX:XX format
timeString += ":";
timeString += minuteString;
timeString += ":";
timeString += secondString;
idString = String(id++);
dataString += idString;
dataString += ",";
dataString += temperatureString; //For transmission separated by ,
dataString += ",";
dataString += humidityString;
dataString += ",";
dataString += pressureString;
dataString += ",";
dataString += altitudeString;
dataString += ",";
dataString += latitudeString;
dataString += ",";
dataString += longitudeString;
dataString += ",";
dataString += speedString;
dataString += ",";
dataString += timeString;
- This code is what transmits the data. It uses the AT command "AT+SEND=" to send the data to a specific address. This is where you need to write the receiver address you selected in step 1. It creates a string as so: AT+SEND=0, number of characters in the dataString, dataString. After this an LED light blinks to signal data has been sent.
String first = "AT+SEND=0,";
first += String(dataString.length());
first += ",";
first += String(dataString);
Reyax.println(first);
digitalWrite(pin, HIGH);
delay(100);
digitalWrite(pin, LOW);
- This code saves the dataString data into the SD card. Since it is being implemented as CSV data, the filename bust be.csv. Also, only 1 file may be open at a time and you must close the file after use. If you receive the error, you are not saving data.
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
}
else {
Serial.println("error opening datalog.txt");
}
- The receiver has similar code, but parsing the +RCV statement must be done to take out the data we want. The first part checks if there is data being transmitted. If recieved, it will reac it and save it into a string received. Next it signals that it has recieved the data by flashing an LED. After that it parses the statement. The substring from parser plus one character (a comma) that goes until it reaches the comma of the next substring is the length of the dataString. Next substring is the data we want to read and it is saved into the string message. The message variable is then used in similar code discussed above to save to the SD card.
if (Reyax.available()) {
String received = Reyax.readString();
digitalWrite(pin, HIGH);
delay(100);
digitalWrite(pin, LOW);
if (received.indexOf("+RCV") >= 0) {
int parser, parser_1, parser_2, parser_3;
parser = received.indexOf(",");
parser_1 = received.indexOf(",", parser + 1);
parser_2 = received.indexOf(",", parser_1 + 1);
int lenMessage = received.substring(parser + 1, parser_1).toInt();
String message = received.substring(parser_1 + 1, parser_1 + lenMessage + 1);
}
}
*Do not copy and paste from the code blocks above. Use the code in the code section.
Once you have coded the device, test it out. The GPS data takes a good bit to be seen once it receives a fix (connection to satellites). The sensors should return data immediately.
4. Assemble the Rocket
Once you have wired and coded your sensor device, it is time to put it into the rocket. I used an Estes Loadstar II kit since it has a capsule that fit this device. I modified the nose cone and bottom piece to fit the Reyax in the top and a 9V battery in the bottom section. You can use a hobby knife to cut out those sections. I put it together as so:
- The Reyax module and GPS antenna in the nose cone.
- The bulk of the sensors in the clear tube.
- The 9v battery in the bottom section.
I glued the nose cone to the clear plastic tube, and I have not glued together the bottom section so I can attach the 9v battery to the wires. When I am ready to use it, I will glue it together and complete assembly. Here is a photo of my rocket sesor section:
5. Tips
- Poke tiny holes in the clear plastic section to allow air flow for temperature and humidity.
- This rocket with the parachute will act as an air parcel moving throughout the atmosphere.
- Put something in the rocket that allows someone to call you if found. This will have every data point and finding it will reap the best data set. If it travels over 5 miles, then you wont be able to find it based on GPS coordinates.
- Try to find it right after deployment. Follow the storm so the reciever can pick up the data points once it hits the ground.
Good Luck and feel free to message me on twitter if you make it, have data or have questions at @tknep3.
Comments