Skip to content

Getting Started

About the Arduino Uno

An Arduino Uno microkontroller. (Wikipedia)

Arduino Uno R3. Photo: Wikipedia

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators.

The Arduino Uno microcontroller board is based on the ATmega328. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analogue inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery.

Boards sold outside the USA are named Genuino, so when we write Arduino Uno, it means Arduino Uno or Genuino Uno.

To get started you have your Arduino UNO board in front of you, a computer and a standard USB cable (A plug to B plug): the kind you would connect to a USB printer.

The open source Arduino environment makes it easy to write code and upload it to the I/O board. It runs on Windows, Mac OS X and Linux. The environment is written in Java and based on Processing, AVR-gcc, and other open source software.

Here are some examples on Arduino projects
  • Make an automatic night light which switches on when its dark
  • Intrusion alarm
  • Thermostat
  • Line Follower Robot
  • Ham radio Morse code keyed/propagation beacon.
  • Graphical calculator that graphs serial inputs on a graphical LCD.
  • Wi-Fi controlled RC-Car

Many more ideas can be found at http://arduino.cc/playground/Projects/Ideas

Assembly guide

Component list

Component list

  • Arduino Uno R3
  • Header socket (Female pin connector) 7-pin and 2-pin
  • OpenLog Data logger (and an SD-card)
  • CanSat Shield (Circuit board)
  • Jumpers
  • APC220 Radio transmitter/receiver
  • Temperature sensor NTC (NTCLE100E3103JB0)
  • Resistor 1 x 10 kOhm (resistors in the photo is just examples, make sure to choose a resistor with the correct resistance)
  • Header (Male pin connector) 2 x 32-pin
  • GY-91 – 10 DOF multi sensor module with MPU-9255 and BMP280

Component source suggestions

Amont Component Source suggestion
1 Arduino Uno R3 Farnell
1 Resistor 10 kOhm Farnell
2 36 Breakaway headers Farnell
5 (7) Jumper 2.54mm 2p Farnell
1 USB2.0 Cable A/B Farnell
1 Vishay, NTCLE300E3103SB Farnell
1/2 Coax Cable RG316 Farnell
1 Battery Connector Farnell
1 Female Headers 7p Farnell
1 Female Headers 2p Farnell
1 MicroSD Card 8GB
1 Radio - APC220 DFRobot TEL0005
1 Digital 10-DOF Sensor GY-91 Banggood.com (China) eller QXL.no
1 Parachute 18 inch Nylon Apogeerockets 29112
1 Logger - OpenLog Sparkfun DEV-13712
1 Aalborg sensor shield Andøya Space

The sensor shield has been designed at the University of Aalborg by Professor Jens Dalsgaard Nielsen and Simon Jensen to include a few components and fit on top of the Arduino Uno R3 Board:

  • Communication radio (APC220) with antenna
  • Temperature sensor (NTC 10k)
  • Digital 10-DOF sensor GY-91 or GY-80/87/88
  • SD storage card (OpenLog)

Complete Arduino Uno with sensor shield

Assembly steps

This section will show you step by step how to assemble the components for the Arduino Uno CanSat kit.

Step 1

Cut the header in to the following lengths:

  • 6 pins (H1)
  • 10 pins (H2)
  • 8 pins (H3)
  • 8 pins (H4)

Headers

Step 2

Insert the headers into the Arduino board with the short end up.

Headers

Step 3

Mount the shield board on top of the Arduino Uno. Note: The board should fit only one way.

Headers

Step 4

Solder all the pins on the top of the circuit board and then remove it from the Arduino Uno. Make sure not to heat the pins too long while soldering. Too long exposure to heat might damage the Arduino board.

Headers

Step 5

Cut out two lengths of 5-pin header, one length of 4-pin header and one length of 2 pin-header. Place them on the top of the shield board and solder them on the bottom (soldering side) as shown in the illustration. (Placed at the J1-J5, J7 and J8 position). To keep the 5-pin headers in place when soldering, it can be useful to put in 2-3 jumpers across the headers.

Headers

Step 6

Solder the GY-91 (or Gy-80/87/88) onto the shield board using a 8-pin header (or 10-pin for the GY-80). Use the short end of the header downwards trough the shield board. Make sure you place the GY parallel with the shield to get the direction of the sensor x-, y- and z-axis parallel and/or orthogonal to the shield.

Headers

Step 7

Solder the data logger onto the shield board using a 6-pin header. Use the short end of the header downwards trough the shield board. Make sure you place the logger the correct way (see illustration). It is recommended to use some hot glue in between the board and the logger to support the logger. If not supported it may easily brake off or damage the soldering Points.

Headers

Step 8

Solder the NTC temperature sensor and the 10k Ohm resistor to the shield board.

Headers

Step 9

The header sockets allows us to easily connect and disconnect the radio for programming. Place the two sockets on top of the board and solder them at the soldering side. If you are unfamiliar with this kit, it is highly recommended to use the header sockets. This may if necessary be removed to make it more robust.

Headers

Step 10

Solder a 2-pin header to one of the radios. These pins will only be used as support to reduce the strain on the radio connector. Mount the radio to the shield board.

Headers

Step 11

Solder the battery connector to the shield board. Red wire to the Vin port and the black wire to GND port. The wire connection points will break off easily. To avoid this you can use hot glue to glue the wires to the board, reducing the strain on the connection point.

Headers

The CanSat shield board is now ready to be tested.

Headers

Arduino Uno pin-out

Pin-out

Arduino Uno R3 pin-out. Image: arduino.cc

CanSat Mechanics Design

Before dropping or launching the CanSat, the electronics and battery in the CanSat must be mounted on a bracket or in other ways secured in the can to be able to handle the stress of a launch and separation from a rocket or dropped to the ground from a drone.

An example is illustrated in the figure below, where the electronics is mounted on a robust bracket. The parachute must be connected to the bracket, not the can. The can is just a shield to protect the electronics against direct impact.

The CanSat with bracket

The CanSat with bracket. Image: Andøya Space

Another suggestion is a 3D-printed can, designed to keep the electronics and battery secure in place. Students at a Norwegian secondary school (Bodin VGS) designed a can for their cansat as the one below.

3D printed cansat can designes by students at Bodin Vgs

3D printed cansat can designes by students at Bodin Vgs. Image: Andøya Space

If you want to design your own can, you may want to start with this design file. See the Downloads section below. There you can find more examples of 3D printed mechanical structures.

The whole concept of CanSat is that neither weight nor volume shall be bigger than a standard soda can. You can find the (preliminary) requirements in the chapter on competition requirements.

The antenna should be a wire antenna because of its flexibility so when the CanSat lands, the antenna won’t be damaged during impact.

Programming the Arduino

Teensy is an Arduino compatible development board. This means that, other than the name, the board is to be viewed as an Arduino and programmed as such. The programming language that is used is C, but in a "variant" of it which is often reffered to as it’s own language, Arduino, but is really a set of libraries hidden to the user to make programming of the Arduino boards easier to learn and use. Often programs that are written in Arduino can be used across many boards as they are ment to be as cross-compatible as possible, but some of the features of one boards is not existing on others, so there are exceptions to this. This will be the same for you when using the Teensy.

Installing the Arduino IDE

Firstly, you need to download the Arduino IDE 2. An Integrated development environment (IDE) is a type of software running on a computer that is made to simplify programming of devices. The Arduino IDE is both used to write the code to be uploaded to the Arduino/Teensy boards and uploading the code itself to the bord. The IDE has built-in compilers and everything else needed to upload the code and will do that in the background when you tell it to do so.

There are different download options for Windows: The .exe-installer is preferred, as you can choose to install Arduino IDE as a single user or system-wide (for all users). Avoid using the Arduino Cloud Editor for the CanSat project.

Installing libraries

After installing the Arduino IDE, start the IDE. Andøya Space has written a library to simplify working with the Arduino CanSat. Download the libraries for the GY-91 sensor, and save it to your hard drive.

IMU GY-91

In the Arduino IDE, click the "Sketch" menu, further into "Include library" and press "Add .ZIP Library...".

How to include a zipped Library in Arduino

How to include a zipped Library in Arduino. Image: Andøya Space

The menu will then prompt you for the location of the zip files, but choose only one of them and press OK, and the Arduino IDE will import the library. Do this for both libraries, and you should be good to go.

Connecting the Arduino

Connect the CanSat board (or only the Teensy if you have not yet soldered it to the CanSat PCB) using a Micro-USB to USB cable to your computer. This should automatically download the proper driver to your computer and install it.

Teensy is supported using Arduino’s Boards Manager. A separate installer is no longer needed, but to enable support, an "additional boards manager URL" must be added in the preferences screen. Click File > Preferences and add this link: https://www.pjrc.com/teensy/package_teensy_index.json

Screenshot from Arduino IDE Photo: Andøya Space

Adding support for Teensy in Arduino IDE Photo: Andøya Space

Click the OK button and the board manager now see the Teensy board. Click Install to start the download.

Screenshot from Arduino IDE Photo: Andøya Space

Adding support for Teensy in Arduino IDE Photo: Andøya Space

When completed, you can select the board version and start proceed to the programming part.

Screenshot from Arduino IDE Photo: Andøya Space

Adding support for Teensy in Arduino IDE Photo: Andøya Space

When a new Teensy is connected to power it runs a standard program (called sketch in Arduino) which blinks a LED light on the board every second. If this does not happen and the Teensy is brand new (no new program has been uploaded), check the connections and that the Teensy has power and is not short circuited.

Here is the blink program example:

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}

Upload your first program

After you have properly configured the Arduino/Teensy board in the Arduino IDE, we can upload our first sketch. Start with a fresh, new program (File -> New…) and press the "Upload" button (which will store the program, compile it and then upload it to the board) as seen in the figure below.

Screenshot from Arduino IDE Photo: Andøya Space

Uploading code in Arduino IDE Photo: Andøya Space

If your Teensy was blinking, the blinking should stop after uploading this sketch. An upload progress var can also be seen in the tiny Teensyduino add-on window that should have appered (note that it might be hidden behind other windows you have on your screen). If the upload was not a success, a error should appear in the bottom of the Arduino IDE in orange text stating:

Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

If you have checked that the Teensy is properly connected and configured in Arduino IDE, try uploading the sketch again and press the button on the Teensy board (the physical board) at the same time (a single tap is enough). It is very rare that this is needed, so if you got an error message, it is more likely that there is something wrong on your end (either bad connections, wrong configuring or power issues).

Read data

Open the Serial Monitor to look at the data which is received from the Arduino Uno board. The Serial Monitor is opened by clicking the icon to the right in the toolbar (Figure to the right). The Serial Monitor will open a new window which will give you a serial text stream of the data printed from the Arduino Board.

Screenshot from Arduino IDE Photo: Andøya Space

Serial monitor in Arduino IDE Photo: Andøya Space

Testing the kit

After finishing the CanSat Shield board you need to test it to make sure that all of the components are working properly. The following steps will guide you through the test procedure:

  • Install the Shield board on top of Arduino Uno (Make sure the power is disconnected before mounting the Shield board).
  • Power up the CanSat by connecting the battery. There is a green light on the Arduino Uno labelled ON. This should always be illuminated when the Arduino Uno is powered on. If you fail to get the power light on, test your battery and also make sure there are no short circuits on the Shield board.
  • Disconnect the battery, then connect the USB cable and check the ON light again.
  • Open a new Arduino Sketch and delete the lines already there. You are going to insert new content in a few moments.
  • To be able to use digital sensors, you need to install a library, that includes all the information, the Arduino program needs to know about your specific digital sensor. For analogue sensors like the ntc this is not nescessary. The library written for the GY-91 sensor used in the Arduino Uno CanSat kit can be found in the Downloads section below. To include this zipped library in your Arduino program, see the Installing libraries section above. If you are using another GY-sensor, you need to install the library for that specific sensor, and not the GY-91 library.
  • Copy the code from GY-91 first_sketch text file found in the Downloads section below into an empty Arduino sketch. Name this new sketch FirstCanSatSketch.ino. Or if already done so: open the sketch file FirstCanSatSketch.ino in the Arduino IDE and upload the sketch to the Arduino Uno board. This is a test program designed to give you measurements from all the sensors on the Arduino Uno CanSat kit. (If you have problems uploading, check that the board and port settings in the Arduino (Tools tab) are correct.)
  • Start the Serial Monitor in the Arduino IDE.
  • You should get some data similar to what you see in the illustration below:

Output data

Output data. Image: Andøya Space

  • Test all the sensors by trying to manipulate the sensors. Do you get response from all the sensors?
  • If you have got data from all the sensors and they seem to work fine, the testing of the main functionality is done. The radio and data logger will be tested in the chapter about Telemetry system.

Description of the measured output data as seen in the above figure. From left to right:

Column Description
time (ms) This is the time in miliseconds since the CanSat was turned on or have been reset.
ntc Shows data from the NTC temperature sensor. The data is 10 bit digital data from the Arduino and will be an integer from 0 (equivalent to an analogue output voltage of 0V) to 1023 (equivalent to an analogue output voltage of Vcc (5V)).
ax, ay, az, |a| Show data from the accelerometer. This sensor will give you 3 readings, one for each axis (x, y and z) and in addition, the total acceleration is given as
gx, gy, gz, |g| Show data from the gyroscope. This sensor will give you 3 readings, one for each axis (x, y and z) and in addition, a number indicating the total number of degrees per second is given as
mx, my, mz, |m| Show data from the magnetometer. This sensor will give you 3 readings, one for each axis (x, y and z) and in addition, the total magnetic field strength is given as |m|. All measured in units of μT.
pressure Shows data from the pressure sensor (BMP280). The pressure is measured in hPa.

Note

The sensors may have some deviations from the actual conditions caused by offset in the sensors. There is a section on how in general to calibrate sensors here.

Downloads

IMU GY-91-library GY-91 first_sketch Transciever APC220 program 3D print by Bodin vgs More 3D CanSat designs