I guess for those uninitiated, the Raspberry Pi Pico is the Pi Foundations’ own microcontroller. It’s not a fully-fledged PC in a little stick like the Pi Zero, but a way to do little things (motors, lights, etc.,) via a specialised version of Python. Two versions exist, CircuitPython and MicroPython, with each able to do similar tasks, but often have different intentions. It’s not a brand new product, but it is still relatively fresh in the lineup of Pi hardware. The obvious comparison would be an Arduino, which the Pico clearly trying to eat some of the – ahem – pie from Arduino’s plate.
We’ll have more tutorials based around it in the future, but for now, let’s get it set up and running MicroPython. It’s relatively simple, but a Pico can come nude. At a whole four quid (seriously), you’re sort of expected to provide your own pins for creating headers, but some sellers will provide you with an already soldered version for a more expensive price. Think of it as the product and labour.
If you’re worried about soldering, don’t be! I’m 27, never soldered in my life and I didn’t set the house on fire. You’ll be fine.
What you'll need
- A Raspberry Pi Pico
- Header Pins (20 pins each)
- A soldering iron
- A breadboard
We’ll need the breadboard for future projects anyway, but for now, it’s the perfect little holder for us to solder on these pins!
While I can’t recommend you buy a Pico from Amazon directly, the Pico kits are more in line with the cost from regular resellers:
Place the Pi on the Breadboard
Simple enough, take your two pinouts and place them so that when you pop the Pico onto the breadboard, they sit neatly in each hole. Don’t worry about the three at the bottom, you won’t be needing those just yet.
This will also be a test for how well you’ve soldered the Pico to the pins, as when you come to pull it out to inspect everything afterwards or to just move the Pico off your breadboard for other things, you’ll have to give it a bit of a tug.
Start Soldering the Pico!
Make sure you bring your soldering iron up to the correct temperature for your solder, touch the side of the pin to begin heating it up and then place solder on it too until it binds right onto the pin. Let it cool and then you have your connection! Don’t worry if you’re not perfect, you’ll get into a rhythm as you go along. If you mess up or make a big blob, don’t worry! You can remelt the solder and if you have any desoldering wick, just go ahead and try to remove any excess.
Once you’re done, move the Pico off the breadboard to see how strong your connections are and we can begin setting up the Pico!
If you’re using a Raspberry Pi to code on, use Thonny. If you’re anywhere else… use Thonny. Thonny comes with the option to install MicroPython directly onto your Pico saving us a few steps. We’ll also cover how to do it yourself, but we need to ensure you have a good Micro USB cable, one with data transfer and not just charging capabilities. If you run into any issues, it’s possibly because your cable is wrong.
Set the Pico into Boot Mode
Plug your USB cable into the Pi or PC, then with the Pico unplugged, plug it in while holding down the BOOTSEL button. Once you’ve held it down for a few seconds after plugging it in, it’ll pop up as a removable device. The Index file inside will take you to a resource page for downloading firmware if you intend on doing things yourself.
You’re now in the Boot Mode and can now load up Thonny.
At the bottom of Thonny you’ll notice it tells you which version of Python you’re running. If you click this and then press configure interpreter, it’ll bring you to a screen that allows you to choose which Python you’d like to run. We want the MicroPython for Pico, which should then automatically detect your Pico. Install it and you’re now running MicroPython on the Pico. To test it, we can do a quick Print:
print ("wassup, world?")
When prompted to save, it’ll ask to save it to either your PC or Pico. Choose the Pico to store it directly on the device, which will then run when connected to the PC.
If it returns something, congratulations! If you’re having any issues installing the software, please try a different USB cable.