Introduction: Cubesat With Air Quality Sensor and Arduino

CubeSat creators: Reghan, Logan, Kate, and Joan


Have you ever wondered how to create a Mars orbiter to collect data about the atmosphere and air quality of Mars? Throughout this year in our physics class, we have learned how to program Arduinos to be able to collect data on Mars. We started the year learning about how to get out of the earths aptomosphere and have slowly progressed to designing and building CubeSats that could orbit around Mars and collect data about Mars surface and its atmosphere.

Step 1: Materials Needed

    • MQ 9 Gas Sensor
    • Metal robot parts
    • Arduino
    • bread board
    • screws & nuts

    Step 2: Tools & Safety

    • Dremel
    • Bolt cutter
    • Pliers
    • Wheel sander
    • Grinder
    • Hacksaw
    • Sand paper
    • Tape & string to secure sensor, Arduino, etc. to CubeSat (if needed)
    • Safety goggles
    • Gloves

    Step 3: How to Build Cubesat & Wire Arduino

    Fritzing Diagrams to Wire Arduino & Sensor

    The MQ-9 is a semiconductor for CO/Combustible gas.

    Cubesat Restrictions:

    1. 10x10x10
    2. Can't weigh more than 1.3 kg (about 3 lbs.)

    How To Build a Cubesat:

    CAUTION: To cut the metal use a band saw or a hack saw, and wear goggles and gloves.

    1. Cut 2 sheets of metal into a 10x10 cm square or if you do not have the correct size of metal connect 2 pieces of metal using a plastic connector and some screws and nuts.

    2. Cut 4 pieces of 10 cm tall corner pieces of metal. These will be the corners of the Cubesat.

    3. Cut 8 pieces of 10 long flat narrow sticks of metal.

    4. Start by connecting the corner pieces to one of the flat 10x10cm squares that were cut in step 1. Have the screws face to the outside of the Cubesat.

    5. Add 4 horizontal supports (long flat sticks) to the corner pieces, these should go about half way up on the corner pieces. There should be four of these, one on each side.

    6. Add 4 vertical supports (long flat sticks), these will connect to the horizontal supports in the center.

    7. Use hot glue to connect the vertical supports to the base, where the corner parts are connected.

    8. Place the other 10x10 cm square on top, attach this with 4 screws (one in each corner). Do not attach until the arduino and sensors are in the CubeSat.

    Code for the MQ-9 sensor:

    #include //(Serial Peripheral Interface communicating with devices over short distances)

    #include // (sends and connects data to the sd card)

    #include // (uses wires to connect and move data and information)

    float sensorVoltage; // (read the sensor voltage)

    float sensorValue; // (print out the sensor value read)

    File Data; // (variable for writing to file)

    //end pre setup

    void setup() //(actions are performed in setup but no information/data is recoreded)//


    pinMode (10,OUTPUT); //must set pin 10 to output even if not used

    SD.begin(4); //begins sd card with CS set to pin 4


    sensorValue = analogRead(A0); //(analog pin set to zero)

    sensorVoltage = sensorValue/1024*5.0;


    void loop()// (run loop again and do not record information/data)


    Data ="Log.txt", FILE_WRITE); //opens file called "Log"

    if (Data) { //will only do rest if file successfully created

    Serial.print("sensor voltage = "); //(print/record sensor volatage)


    Serial.println(" V"); //(print data in volatages)



    delay(1000); // (delay for 1000 milliseconds then restart data collection)



    Step 4: Results & Lessons Learned


    Physics--> We expanded our knowledge of Newton's laws, specifically his first law. This law states that an object in motion will stay in motion, unless acted upon by an outside force. The same concept applies for objects at rest. When our CubeSat was orbiting, it was at constant speed.. so in motion. If the string were to break, our CubeSat would have gone flying in a straight line at the specific point of its orbit where it snapped.

    Quantitative--> When the orbit started, we got 4.28 for a while, then it changed to 3.90. This determines the voltage

    Qualitative--> Our CubeSat orbited Mars, and collected data on the atmosphere. We used propane (C3H8) to add to the atmosphere for our MQ-9 sensor to detect and measure the difference. The flight test went really well due to the lagging of the mars orbiter. The CubeSat flew in a circular motion, with the censor pointed inward towards mars.

    Lessons Learned:

    The biggest lesson learned throughout this project was to persevere through our struggles. The hardest part of this project was probably figuring out how to setup and code for the SD card to collect our data. It gave us a lot of trouble because it was a long trial-and-error process, which was a bit frustrating, but eventually we figured it out.

    We learned how to be creative and use tools to create a 10x10x10 CubeSat that will help measure air pollution with the MQ-9 gas sensor. We used power tools like a Dremel, bolt cutter, big wheel grinder, and hacksaw to cut our metal to the correct size. We also learned how to correctly plan out our design from the ideas in our heads to the paper, and then execute the plan. Not perfectly of course, but the planning helped us stay on track.

    Another skill we learned was how to code the MQ-9 sensor into the Arduinos. We used the MQ-9 gas sensor because our key objective was to make a CubeSat that would be able to measure the air quality in Mar's atmosphere.

    Arduino Contest 2019

    Participated in the
    Arduino Contest 2019