CanSat Tutorials

Arduino for CanSat teams · Nine tutorials

From a blank sketch to telemetry over the air

Start at number one with nothing but a laptop and an Arduino Uno. Finish with a board reading real air temperature and pressure and sending them out in a format a spreadsheet can graph. Every sketch is here to be copied, run, and then broken on purpose.

9tutorials, in order, each building on the last
20 minroughly, per tutorial, plus as long as you like on the challenges
£30of parts covers the first eight. The radio tutorial needs its own kit.

The series

The nine tutorials

Work through them in order. Each one assumes you have done the one before, and each one ends with changes for you to make.

Tutorial 1

Set up the Arduino IDE and connect your Uno

Install the software, plug the board in, and prove the whole chain works before you write a single line of your own code.

Start this one →

Tutorial 2

Your first sketch: Blink, line by line

Every Arduino program has the same two part shape. Here is what each line of Blink actually tells the board to do.

Start this one →

Tutorial 3

Talking to your laptop with the Serial Monitor

An LED can only tell you one thing at a time. The serial link is how you see what the board is thinking, and it is the same idea a CanSat uses to send data home.

Start this one →

Tutorial 4

Variables, maths and keeping time

Where a sketch stores numbers, how it does sums with them, and how to do something once a second without stopping the board.

Start this one →

Tutorial 5

Decisions, loops and your own functions

Making the board choose, making it repeat, and splitting a sketch into named pieces you can test one at a time.

Start this one →

Tutorial 6

Reading inputs: a button and an analogue sensor

Digital in, analogue in, and the difference between a pin that is either on or off and a pin that can read a voltage.

Start this one →

Tutorial 7

Connecting and programming the BMP280

Two wires, one library and a handful of lines gets you air temperature and air pressure, which is what the primary mission asks for.

Start this one →

Tutorial 8

Turning readings into one line of telemetry a second

Putting it together: a timed loop, a packet format, a packet counter, and data you can open in a spreadsheet.

Start this one →

Tutorial 9

Sending your telemetry over a LoRa radio link

The last gap between a breadboard and a mission: a Raspberry Pi Pico, two LoRa radios, and the one number that decides whether your design is legal.

Start this one →

Before you start

What you need on the desk

For tutorialsYou need
1 to 2An Arduino Uno and a USB cable. An LED and a 220 Ω resistor from tutorial 2 onwards.
3 to 5The same, plus a breadboard and a few jumper wires.
6A push button, and a potentiometer or a light dependent resistor with a 10k resistor.
7 to 8A BMP280 breakout board. Around three pounds, and it does the whole primary mission.
9Its own kit: two Raspberry Pi Picos and two 433 MHz LoRa modules, around £50 for the pair of each. Read the catches on that page before you order.

There is a fuller list, with sizes and what each part is for, on the components page.

No Uno to hand?

Everything up to tutorial 6 works on a Raspberry Pi Pico or an Arduino Nano with very little changed: mostly pin numbers. Tutorial 8 explains what moves across, and tutorial 9 is written for a Pico throughout. It explains what moves across and what does not. The Uno is used here because it is cheap, nearly indestructible and every example you will find online assumes one.

Using these tutorials

Guidance

Each tutorial hands you a working sketch, explains it line by line, then ends with a list of changes to try. Change one line, upload it, and watch what happens. That is how coding is learned, and it is also how you find the weak spots in your CanSat design.

  • Copy the sketch, upload it unchanged, and check it does what the page says it does.
  • Then change exactly one thing. Predict what will happen before you press upload.
  • When it breaks, read the first error message rather than the last one.
  • Keep the version that worked. Name the next one _v2.
  • Write down what you tried and what happened. That is a test result, and your report needs them.
If you use this code in your report

The competition rules ask you to reference borrowed code, AI generated code, STL files and copied text, with the source and the date. Code from these pages counts as borrowed code. Say where it came from, and show that you tested it yourselves. Unreferenced work may not be marked.