Getting started with Raspberry Pi Pico

Antara Prasad
4 min readNov 28, 2023

--

For those fascinated by electronics and eager to learn something new , this brief introduction serves as a glimpse into my journey with the Raspberry Pi Pico. This is a series documenting my start from scratch and troubleshooting every issue I encounter.
A few weeks ago, I ordered a Raspberry Pi Pico without any prior knowledge of microcontrollers. Curiosity led me to dive headfirst into this miniature device and its real-world applications.
In this series I’ll share my experiences and learnings. Help me in challenges and hopefully learn with me while uncovering the potential of the Raspberry Pi Pico.

Microcontroller vs Microprocessors

First things first, Raspberry Pi and Arduino represent prominent companies (not the actual boards) known for their development boards catering to the electronics domain. Raspberry Pi provides versatile single-board computers ideal for diverse computing tasks, while Arduino specializes in microcontroller-based boards for embedded systems and prototyping. Raspberry Pi’s focus lies in broader computing capabilities, whereas Arduino excels in simplified hardware interfacing and real-time applications. This is something I got confused with and I am assuming not much people realised the difference.

Onto the main thing, Microcontrollers integrate memory, input/output peripherals, and a processor on a single chip, suitable for dedicated tasks in embedded systems. In contrast, microprocessors primarily focus on processing computations, lacking integrated peripherals(input output devices), and often requiring external components. Microcontrollers are self-contained for specific tasks, while microprocessors need additional hardware for complete functionality. This is basic difference I have jotted down,

Getting started:

I surfed amazon a lot for a microcontroller to find it in affordable range as I live in hostel and I buy stuff from my pocket money. A website I stumbled upon was robu.in .

I ordered a mini kit which was called Orange Raspberry Pi Pico — Basic.

My suggestion would be if you are serious and have money to spend in the range 2.5k - 3.5k, buy a whole kit otherwise you will be stuck like me collecting the required accessories. Otherwise, if you don’t have the money you can use the online simulator to code and make circuits. One website i used was wokwi.com . Although simulator will be required either way.

Now to the main part, so the hyperlink attached to Raspberry Pi Pico is documentation for the same and includes everything you need to know about the device.
Basically, there are 8 Programmable I/O (PIO) state machines for custom peripheral support which are called general purpose input/output

This is the official pinout diagram.
And this is how it looks in real life:

If you have noticed, another mistake I did was to order unsoldered ones. Basically which means it has no head pins to place it on a breadboard.

The best way to get started with this is Thonny, a python IDE.
Since I will be workings in micropython, Thonny is perfect.

Once you have downloaded Thonny,

Under Run tab
manually add variant and version

Select Configure interpreter and select MicroPython (Raspberry Pi Pico) find a USB cable and connect with your laptop. Make sure if this is your first time plugging in Pico, hold the button on the microcontroller which says ‘BOOTSEL’ while inserting the cable. Its a good practice to install/update micropython first.
And there now you have your microcontroller connected.

Here are some line of codes to test it out :

from machine import Pin 
import time # Importing the time module for time-related functions

# Configuring the LED pin (pin 25) as an output
led = Pin(25, Pin.OUT) # Configuring pin 25 as an output pin for the LED

n = 1
while n <= 100: # Loop that runs 90 times
print(n)
if n % 2== 0:
led.value(1) # Turning ON the LED if 'n' is divisible by 3
else:
led.value(0) # Turning OFF the LED if 'n' is not divisible by 3

n = n + 1
time.sleep(0.25) # Adding a delay of 0.25 seconds between each iteration

I have added necessary comments. Just to clarify, pin 25 has a led on the microcontroller board itself.

Here is how the simulation looks:

Changing iteration delay

--

--