A Beginner

Ever since the launch of the first Raspberry Pi in 2012, the Raspberry Pi Foundation has created numerous single-board computers. However, three years ago, the company decided to venture beyond … Read more

Taylor Bell

Taylor Bell

Published on Jul 03, 2024

A Beginner

Ever since the launch of the first Raspberry Pi in 2012, the Raspberry Pi Foundation has created numerous single-board computers. However, three years ago, the company decided to venture beyond the SBC market with the Raspberry Pi Pico.

While it’s only slightly cheaper than the Raspberry Pi Zero, there’s a world of difference between the Pico and the other boards in the ultra-popular SBC family. So, here’s everything you need to know about the Pico if you’re planning to use this adorable little device in your next DIY project.

What’s Raspberry Pi Pico?

And how does it differ from the other boards in its family?

One of the biggest differences between the Pico and every other board released by the Raspberry Pi Foundation is that it’s a microcontroller, not an SBC. Unlike a fully standalone SBC, a microcontroller is an extremely low-power board that can’t be used independently.

Besides its weak CPU and limited memory, the Pico can’t run a proper desktop operating system. Rather, you’ll have to connect it to a PC and execute code written in C++, C, MicroPython, Circuit Python, or other languages. Connectivity-wise, the Pico has the same 40-pin GPIO setup as the other RPi boards, though it comes with a single micro-USB port.

A Raspberry Pi 5 held in front of a PC

Related

A beginner’s guide to programming the Raspberry Pi

Unsure about what you should do after buying your first Raspberry Pi? Check out our in-depth tutorial to familiarize yourself with the SBC.

Therefore, although SBCs and microcontrollers have plenty of overlap in the DIY project landscape, you should remove the microcontroller from your wishlist if you’re more interested in the software and programming side of things.

But enough about the Pico’s disadvantages. As a microcontroller, there are plenty of scenarios where it makes more sense to purchase a Pico board than any RPi SBC. For starters, projects involving multiple sensors, motors, or extensive circuitry pair well with the Pico. Likewise, microcontrollers like the Pico are better for robotics and automation tasks.

How to program your Raspberry Pi Pico?

Now that you know the basics of the Pico, it’s time to pair it with your PC. The best part about this neat device is that you can use any device to program it, including another Raspberry Pi SBC!

  1. Connect the Raspberry Pi Pico to your PC/SBC with the help of a micro-USB-to-USB cable.
  2. Press and hold the BOATSEL button on the Pico until it shows up on your system as a storage device.
    A Raspberry Pi Pico with the BOOTSEL button highlighted

  3. Head to the official Raspberry Pi website and download the version of the MicroPython UF2 bootloader that’s compatible with your Pico model.
    The Raspberry Pi website with the download links for the MicroPython UEFI highlighted

  4. Paste this UF2 file into the Raspberry Pi Pico folder.
  5. Doing so will cause the Pico to disconnect, and the microcontroller will show up as a Board in FS mode.
    The Raspberry Pi Pico board in FS Mode

After configuring the MicroPython bootloader, you can start writing code for the Pico. We’ll use the Thonny IDE for this tutorial, but you can also go with other code editors.

  1. Download the Thonny IDE setup.exe file from the official link and run it with admin privileges.
  2. Launch the IDE once it has finished installing, and switch the interpreter to MicroPython (Raspberry Pi Pico).
    The procedure to switch the interpreter to MicroPython in Thonny IDE

  3. You can use the following code to confirm whether the connection was successful:
    from machine import Pinled=Pin(25, Pin.OUT)led.toggle()
    The code to test the LEDs on a Raspberry Pi Pico

  4. Click on the Save button and pick Raspberry Pi Pico as the location.
    The procedure to export code to a Raspberry Pi Pico

  5. Give a Name to the script and press Save.
    The procedure to save code to a Raspberry Pi Pico

    Be sure to end the file name with the .py extension.

  6. Press the Run button to execute the code on the Pico.
    The procedure to run code to a Raspberry Pi Pico

Building complex projects with a tiny little Raspberry Pi Pico

A set of micrcontrollers placed on the ground

If you’ve performed all the steps correctly, the green LED on the Pico will start glowing. With that, you’re free to program the microcontroller to your heart’s content. It may seem rather daunting at first, but MicroPython is a relatively easy programming language for beginners, and with a little practice, you should be up to speed in no time!

A person holding an Arduino Uno

Related

A beginner’s guide to programming an Arduino board

Want to build your next DIY project using an Arduino board? Here’s an easy guide to help you get started with the popular microcontroller family.

But if you’re not a fan of projects that involve a lot of circuitry, then you might want to put microcontrollers like the Pico and Arduino boards on the back burner and switch to SBCs instead. That’s because SBCs are far easier to figure out and can be used for a wider range of projects. Once you’ve gained more experience building complex projects such as a full-fledged weather station or a makeshift FM radio, you can use your newly acquired DIY skills to replicate these projects on the Pico.

Partager cet article

Inscrivez-vous à notre newsletter