Raspberry Pi Pico - The first board based on a microcontroller designed by Raspberry Pi

Raspberry Pi Pico - The first board based on a microcontroller designed by Raspberry Pi

Reading time: 3 minute

On January 21, 2021 Raspberry Pi Foundation has launched a new product, Raspberry Pi Pico, which is the first board based on a microcontroller in this range.

What does the article present?

In this article we will present the advantages and disadvantages of this new microcontroller, and the changes it brings compared to previous versions. There is also a temperature measurement project using the internal temperature sensor.

Specifications of the new Raspberry Pi Pico

  • Dimensions: 21 mm × 51 mm;
  • RP2040 microcontroller designed in the UK by the Raspberry Pi;
  • Arm Cortex-M0 + processor with 2 cores running up to 133MHz;
  • 264KB RAM;
  • 2MB QSPI Flash Memory (internal);
  • 26 GPIO pins (+3 analog pins);
  • 2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channel;
  • Temperature sensor;
  • Libraries for accelerating operations with integers and fractional numbers;
  • An accurate timer;

The advantages of the new Raspberry Pi Pico compared to other microcontrollers

Like any new product on the market, this new microcontroller has a number of advantages. The first advantage what this development board has is the community around the Raspberry PI foundation and the forum where you can post any problem you encounter.

A second advantage what the new board offers is the price, $ 5.5, quite low for a microcontroller with 2 ARM cores and which has many peripherals. A new appearance in the world of microcontrollers for enthusiasts is represented by those 8 programmable I / O peripherals (IOP).

Disadvantages of the new Raspberry Pi Pico

A first disadvantage of this new development board is that there is no Bluetooth / Wi-Fi connectivity in order to be able to realize more complex projects or IoT type projects. Another disadvantage is the only 2MB of flash memory.

How do I program the new Raspberry Pi Pico?

To program this new microcontroller there are 2 programming languages ​​available: MicroPython or C ++.

Tutorials for using and installing both options can be found on the website https://www.raspberrypi.org/

If you have not had contact with the world of microcontrollers and their programming and if you want to be able to program a Raspberry Pi Pico as soon as possible, we recommend you to use micropython. In the following project examples we will use MicroPython.

Riagberry Pi Pico development board connection diagram

How do I load code on the Raspberry Pi Pico?

The code loading part on the Raspberry Pi Pico is a little different from a development board like the Arduino.

To upload a program, you have to hold down the "BOOTSEL" button from your Raspberry Pi Pico while connecting it to your computer's USB port.

If all goes well, your operating system will display your development board as storage.

Here you will upload the file ".uf2" where you have the compiled code, or if you want to use MicroPython, you have to upload the following file: rp2-pico-20210202-v1.14.uf2, from https://www.raspberrypi.org/.

Temperature indicator with Raspberry Pi Pico

Because the new Raspberry Pi Pico has an internal temperature sensor, it is relatively easy to implement a program for measuring temperature.

For this project we used the following code:

import machine
great import

# Get the temperature from the internal RP2040 temperature sensor.
sensor_temp = machine.ADC (4)

# See Raspberry Pi Pico datasheet for the conversion factor.
CONVERSION_FACTOR = 3.3 / (65535)

# Set up LEDs.
led_onboard = machine.Pin (25, machine.Pin.OUT)
led_green = machine.Pin (15, machine.Pin.OUT)
led_red = machine.Pin (14, machine.Pin.OUT)
led_blue = machine.Pin (13, machine.Pin.OUT)

def leds_off ():
"" "Turn off all the LEDs." ""
led_onboard.value (0)
led_green.value (0)
led_red.value (0)
led_blue.value (0)

def leds_on ():
"" "Turn on all the LEDs." ""
led_onboard.value (1)
led_green.value (1)
led_red.value (1)
led_blue.value (1)

# Flash all the LEDs on startup.
leds_off ()
leds_on ()
utime.sleep (1)
leds_off ()

# Go into a loop.
while True:
# Get a temperature reading.
reading = sensor_temp.read_u16 () * CONVERSION_FACTOR

# Convert the temperature into degrees Celsius.
temperature = 27 - (reading - 0.706) /0.001721

# If a safe temperature, light the green LED.
if 20.00 <= temperature <= 22.20: leds_off () led_green.value (1) / # If too hot, light the red LED. ellipse temperature> 22.20:
leds_off ()
led_red.value (1)
# If too cold, light the blue LED.
ellipse temperature <20.00:
leds_off ()
led_blue.value (1)
# If no condition met, we're in an error state, light 'em up!
leds_on ()

print (temperature)

# Sleep for 5 seconds.
utime.sleep (5)

This code, once every 5 seconds it will read the temperature, and in case it is below 20C, it will light up the blue LED; if the temperature is above 22.2C, it will light up the red LED and if it is between the two values, the green LED.

Assembling the project on breadboard

More details about this project can be found here: https://github.com/

In conclusion, the new Raspberry Pi Pico it is a very versatile microcontroller and equipped with many functionalities for its low price.

 1,951 total hits, 2 hits today


  1. I appreciate the effort, but you said you were discussing "pros and cons" and… I left as I came…
    Disadvantage: It does not have FPU
    Advantage: Two Nucleus, with one you can read the sensors, and with the other you can make decisions and perform operations:

    ESP vs Pi Pico comparison:

  2. I took one and I intend to use it to control an equatorial mount for the telescope, how accurate is the clock compared to the Arduino? Can I rely on it or better put a real time clock? It will work permanently connected to a computer, not by itself, so I will be able to check the position of the mount and if the power is taken (robotic observer).

    1. Better GPS. I have strange experiences with RTC Modules. The current one took 5 minutes in two months of operation. GPS or periodic BT synchronization with something that can be synchronized with an NTP.

Add a comment

Your email address will not be published. Required fields are marked with *

The maximum upload file size: 2 MB. you can upload: image, audio, video, document, spreadsheet, Interactive, text, archive, queues, Other. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop files here