Introduction: Temperature CubeSat Ben & Kaiti & Q Hour 1

Have you ever wanted to make something yourself that can be sent to space and take the temperature of another planet? In our High school physics class, we where assigned to build a CubeSat with a functioning arduino with the main question How can we get this working in Mars? We decided to have it measure temperature on the planet, because who wouldn't want to know how hot mars is? However, we needed to make it out of something affordable, but also durable. Therefore, we used Legos. This made the CubeSat durable, and helped us reach the sizing dimensions pretty easily-even if all the pieces where a little pesky! Our goal was to have a fully functioning sensor that can take temperature of the surrounding area, and a protective CubeSat around it.

Step 1: Gathering Materials/sketching the CubeSat

The very first thing your going to want to do is sketch the CubeSat. You will need to have an idea of what you want to build before you build it. One of the picures above is of CubeSat sketches we made. Next, gather your materials. For the CubeSat we are building, we are using Legos. We chose Legos because they are easy to get and put together, and at the same time they are durable and will perform the required tasks well. So, you will need to get some Legos. get a couple wide base pieces, that are 10cm X 10 cm X 10 cm, or a few base pieces that can be put together to a 10 by 10 piece. For our CubeSat, we had to get multiple base pieces and put them together to make a 10 cm by 10 cm base. You will also need to get Legos to make a roof piece the same size. After you get those Legos, you will need to get a ton of little Legos to build up the walls of the CubeSat. Make sure these Legos are fairly skinny, so they do not take up too much of the interior of the CubeSat.

Step 2: Building the Cubesat

First, we built this 10x10x10 beauty. It took a lot of different designs. First we had a shelf in the middle but we later decided that was unnecessary to have. If you choose to have a shelf in the middle, I would recommend only one shelf because you will have to take it apart every time you put in and take out your Arduino and sensor. We added little windows so we can have a quick look inside while the top is closed so we can see everything working smoothly. To make the CubeSat more stable, we put together two layers of Lego at the bottom. The more stable the better, because this CubeSat will need to be able to survive many different obstacles.

Step 3: Wiring and Coding the Arduino

The second step of this project is where you will need to wire the arduino. This step is very important, because, if this is not done right then the cube sat will not be able to read temperature. To complete the wiring of the arduino, you will need some materials. These materials are a battery, arduino, an SD card, jumper wires, a breadboard, a temperature sensor, and a computer. The computer will be used to see if the wiring is working right. Here is a website that was very helpful in guiding us on how to wire the arduino:

https://create.arduino.cc/projecthub/TheGadgetBoy/...

The pictures and fritzing diagram above may help you as well. The coding of the arduino wil also be tested on the computer to see if its working. If everything is working, then the arduino can be taken out of the computer, and is ready to go.

Code:

// Data wire is plugged into port 2 on the Arduino

#define ONE_WIRE_BUS 2

File sensorData;

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)

OneWire oneWire(ONE_WIRE_BUS);

// Include the libraries we need

#include

#include

#include

// Pass our oneWire reference to Dallas Temperature.

DallasTemperature sensors(&oneWire);

// arrays to hold device address

DeviceAddress insideThermometer;

/*

* Setup function. Here we do the basics

*/

void setup(void)

{

pinMode (10, OUTPUT);

SD.begin(4);

// start serial port

Serial.begin(9600);

Serial.println("Dallas Temperature IC Control Library Demo");

// locate devices on the bus

Serial.print("Locating devices...");

sensors.begin();

Serial.print("Found ");

Serial.print(sensors.getDeviceCount(), DEC);

Serial.println(" devices.");

// report parasite power requirements

Serial.print("Parasite power is: ");

if (sensors.isParasitePowerMode()) Serial.println("ON");

else Serial.println("OFF");

/*Assign address manually. The addresses below will beed to be changed

to valid device addresses on your bus. Device address can be retrieved

by using either oneWire.search(deviceAddress) or individually via

sensors.getAddress(deviceAddress, index) Note that you will need to use your specific address here

insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };

Method 1:

Search for devices on the bus and assign based on an index. Ideally,

you would do this to initially discover addresses on the bus and then

use those addresses and manually assign them (see above) once you know

the devices on your bus (and assuming they don't change).

*/ if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");

// method 2: search()

// search() looks for the next device. Returns 1 if a new address has been

// returned. A zero might mean that the bus is shorted, there are no devices,

// or you have already retrieved all of them. It might be a good idea to

// check the CRC to make sure you didn't get garbage. The order is

// deterministic. You will always get the same devices in the same order

//

// Must be called before search()

//oneWire.reset_search();

// assigns the first address found to insideThermometer

//if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");

// show the addresses we found on the bus

Serial.print("Device 0 Address: ");

printAddress(insideThermometer);

Serial.println();

// set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)

sensors.setResolution(insideThermometer, 9);

Serial.print("Device 0 Resolution: ");

Serial.print(sensors.getResolution(insideThermometer), DEC);

Serial.println();

}

// function to print the temperature for a device

void printTemperature(DeviceAddress deviceAddress)

{

// method 1 - slower

//Serial.print("Temp C: ");

//Serial.print(sensors.getTempC(deviceAddress));

//Serial.print(" Temp F: ");

//Serial.print(sensors.getTempF(deviceAddress)); // Makes a second call to getTempC and then converts to Fahrenheit

// method 2 - faster

float tempC = sensors.getTempC(deviceAddress);

if(tempC == DEVICE_DISCONNECTED_C)

{

Serial.println("Error: Could not read temperature data");

return;

}

sensorData = SD.open("log.txt",FILE_WRITE);

if (sensorData) {

Serial.print("Temp C: ");

Serial.print(tempC);

Serial.print(" Temp F: ");

Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit

sensorData.println(tempC);

sensorData.close();

}

}

/*

* Main function. It will request the tempC from the sensors and display on Serial.

*/

void loop(void)

{

// call sensors.requestTemperatures() to issue a global temperature

// request to all devices on the bus

Serial.print("Requesting temperatures...");

sensors.requestTemperatures(); // Send the command to get temperatures

Serial.println("DONE");

// It responds almost immediately. Let's print out the data

printTemperature(insideThermometer); // Use a simple function to print out the data

}

// function to print a device address

void printAddress(DeviceAddress deviceAddress)

{

for (uint8_t i = 0; i < 8; i++)

{

if (deviceAddress[i] < 16) Serial.print("0");

Serial.print(deviceAddress[i], HEX);

}

}

ReplyForward

Step 4: Checking Over the Cubesat

Now that the CubeSat, code, and wiring of the a Arduino is complete, you be running tests soon. If these tests are failed, your CubeSat could potentially be completely destroyed, along with your Arduino. Therefore, you will want to make sure your Arduino is ready for this. That is where this step comes in to play, checking over the CubeSat. First, you will need to place your Arduino securely inside the CubeSat, and make sure it will not jiggle around. Then, you will need to make sure that all pieces of the CubeSat are securely in place. There can be no loose pieces, or the CubeSat will be more likely to come apart during the tests. If you firmly check over your CubeSat, then the tests it goes through should be passed easily.

Step 5: Stringing Up the CubeSat

This step will be in preparation for the first test the CubeSat will go through. In the test, the CubeSat will be swung around at a fast pace in a circle for 30 seconds. You will need to make sure the CubeSat is strung up tightly so it does not come flying off. We tied 2 strings completely around the CubeSat, and tied them tightly. Then, we added another long string, that was tied around the first two. We knotted this string multiple times at the top and bottom so it was as secured as possible. This may take multiple attempts because you want to make the string perfect so it will not come loose during flight.

Step 6: The Swing Test

For safety in this step, be sure to wear goggles to protect your eyes. In this step, you will be running the CubeSat through a test to see if it protects the Arduino well enough for it to perform its task (finding temperature). The first test is the one that needs the stringing. In this test, the Arduino will be swung around (as shown in the picture/video above)- (sometimes the video has trouble loading). A model Mars may be placed in the middle. To successfully complete this test, the Arduino will need to have swung around without coming unattached, which is why it needs to be strung up well, and they Arduino will need to be fully functioning after the test is finished. That is why you need to make sure the Arduino is secured well in the CubeSat.

Step 7: Test #2- the Shake Test

In this step your CubeSat will be going through test #2. This test is the shake test. In this test, the CubeSat will be placed in a holder as shown in the picture/video (sometimes the video has trouble loading) above and will be shaken violently back and forth for 30 seconds. In order to pass this test, your CubeSat and Arduino will need to still be fully functioning after they are shaken.

Step 8: Results/Completed Temperature CubeSat

In the end, our CubeSat was able to successfully record the temperature while going through every test. The data consistently read 26-30 degrees Celsius in every test. This is the same as 78-86 degrees Fahrenheit. However, we ran in to some problems on the way. For example, multiple times the coding of the arduino did not work, and read 126 degrees Celsius. It took multiple attempts to achieve the correct temperature. Some advice I would give to anyone doing this project would be to try multiple variations of code and wiring, and to make sure your arduino fits tightly in to the CubeSat. You may need to tighten the gap inside the CubeSat to make sure the arduino fits perfectly inside. We had some problem with the arduino being too loose in the CubeSat.

In this project, you will also need to apply your knowledge of physics. Physics knowledge of technology, energy, and force will need to be applied throughout the project. Throughout the project we learned more about the solar system, and new technologies like CubeSats. We also learned about gravitational force, and how this force might effect the CubeSat. One very important topic with this project was satellite motion. We learned about satellite motion by using velocity, net force, and gravity. This would help us find the projectiles of satellites.

Once your CubeSat and arduino have successfully passed the tests, and work properly, you are finished. Your CubeSat should be able to survive the atmosphere of Mars. Make sure that the sensor successfully recorded temperature throughout the tests as well. Your CubeSat is ready to go to space!

Arduino Contest 2019

Participated in the
Arduino Contest 2019