Skip to content

Getting Started

About the Arduino Uno
Assembly guide
    Component list
    Component source suggestions
    Assembly steps
    CanSat Mechanics Design
Programming the Arduino
    Installing the Arduino IDE
    Installing libraries
    Connecting the Arduino
    Upload your first program
    Read data
Testing the kit
Downloads

Component list and pin-out

E32 radio transcievers (UART) BMP280 (pressure, temp, ...) Raspberry Pi Pico (built-in temp sensor)

Assemble the kit (controller, sensor, pcb, småkomponenter)

3D-printed bracket

Fit into a 0.33 ml can.

Installing libraries, drivers and software

Sensor library for BME280

Download BME280 library (bme280.py) and upload to your Pico.

Methods for GY-521

# Minimal setup
from machine import I2C, Pin

i2c = I2C(0, scl=Pin(17), sda=Pin(16))
MPU = 0x68

# Wake up MPU6050
i2c.writeto_mem(MPU, 0x6B, b'\x00')

# Helper function, all measurements are stored as signed 16-bit integers.
def read_int16(register):
    data = i2c.readfrom_mem(MPU, register, 2)

    value = (data[0] << 8) | data[1]

    if value > 32767:
        value -= 65536

    return value

### Accelerometer

'''
X = 0x3B
Y = 0x3D
Z = 0x3F
'''

# Simple raw-reading functions:
def read_acceleration_x():
    return read_int16(0x3B)

def read_acceleration_y():
    return read_int16(0x3D)

def read_acceleration_z():
    return read_int16(0x3F)

### Gyroscope

'''
X = 0x43
Y = 0x45
Z = 0x47
'''

# Simple raw-reading functions:
def read_rotation_x():
    return read_int16(0x43)

def read_rotation_y():
    return read_int16(0x45)

def read_rotation_z():
    return read_int16(0x47)

# Temperature

'''
TEMP = 0x41
'''

def read_temperature():
    return read_int16(0x41)

Thonny IDE

Software startup

Thonny IDE

The simplest program

Just to verify the radio setup, all you need is a few lines of code:

from machine import UART, Pin
import time

uart = UART(1, baudrate=9600, tx=Pin(8), rx=Pin(9))

while True:
    uart.write("Hello from Pico" + '\n')
    time.sleep(1)

Assembly guide

https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html#pin_functions

Assembly steps

Testing the kit

On Linux

The simplest way to see data coming from a CanSat

cat /dev/ttyUSB0 9600