Best Raspberry Pi Pico Projects for Creators

Table of Contents

As a maker always on the lookout for affordable yet powerful microcontroller boards, I’ve fallen in love with the Raspberry Pi Pico. Its compact size, impressive performance, and versatile programming options make it perfect for a wide range of projects. In this post, I’ll share some of my favorite Pico projects that showcase its capabilities, from simple beginners’ builds to more advanced applications.

Project 1: Blinking LED with Custom Patterns (Beginner-Friendly)

Hardware Setup

For this project, you’ll need a Raspberry Pi Pico, a breadboard, an LED, a 220-ohm resistor, and jumper wires. Connect the LED’s anode to GPIO pin 25 through the resistor and the cathode to the ground pin on the Pico. This setup ensures that the LED is protected from overcurrent by the resistor and is properly connected to the Pico’s GPIO pin for control.

Raspberry Pi Pico with LED and resistor on breadboard
Raspberry Pi Pico with LED and resistor on breadboard

Code Implementation

Using MicroPython, we’ll create a program to make the LED blink in different patterns. First, import the necessary modules:

				
					from machine import Pin, Timer
				
			

Then, initialize the LED pin:

				
					led = Pin(25, Pin.OUT)
				
			
Create a timer object to control the blinking intervals. The following code snippet sets up a timer that toggles the LED every 500 milliseconds:
				
					tim = Timer()

def tick(timer):
    led.toggle()

tim.init(freq=2, mode=Timer.PERIODIC, callback=tick)
				
			

Testing and Customization

Once the code is uploaded to the Pico (by saving it as main.py and plugging in the Pico), the LED should start blinking. You can customize the blinking patterns by changing the timer period or creating more complex functions to control the LED’s on and off times. For example, you could create a function that makes the LED blink in a morse code pattern or a pattern that changes based on an external input. This project is a great way to get familiar with GPIO pin control and MicroPython on the Pico.

Project 2: Temperature Monitoring System (Intermediate)

Hardware Requirements

Gather a Raspberry Pi Pico, a DS18B20 temperature sensor, a 4.7k-ohm resistor, a breadboard, and jumper wires. The DS18B20 uses a 1-Wire interface, so connect its VCC to 3.3V, GND to ground, and DATA pin to GPIO pin 18 on the Pico. The resistor goes between the DATA pin and VCC to pull up the signal. This setup ensures stable communication between the Pico and the temperature sensor, as the 1-Wire protocol requires a proper pull-up resistor for reliable data transmission.
DS18B20 sensor connected to Raspberry Pi Pico on breadboard
DS18B20 temperature sensor linked to Raspberry Pi Pico, displaying 1 - Wire interface components.

Code Development

In MicroPython, use the onewire and ds18x20 libraries to communicate with the sensor. First, import the libraries and initialize the 1-Wire bus:
				
					import machine
import onewire
import ds18x20
import time
				
			
Then, set up the bus on the chosen GPIO pin:
				
					ds_pin = machine.Pin(18)
ds_sensor = ds18x20.DS18X20(onewire.OneWire(ds_pin))
				
			
Scan for devices and create a DS18B20 object:
				
					roms = ds_sensor.scan()
print('Found DS devices: ', roms)
				
			
The following code reads the temperature and prints it to the console:
				
					while True:
    ds_sensor.convert_temp()
    time.sleep_ms(750)
    for rom in roms:
        print(ds_sensor.read_temp(rom))
    time.sleep(2)
				
			

Data Logging and Display

To make the system more useful, you can add a small OLED display (connected via I2C) to show the temperature in real-time or log the data to a file on a connected computer. For the OLED display, you can use the ssd1306 library. First, import the necessary modules and initialize the I2C interface:
				
					from machine import I2C, Pin
import ssd1306

i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=400000)
oled = ssd1306.SSD1306_I2C(128, 32, i2c)
				
			
Then, modify the temperature – reading loop to display the temperature on the OLED:
				
					while True:
    ds_sensor.convert_temp()
    time.sleep_ms(750)
    for rom in roms:
        temp = ds_sensor.read_temp(rom)
        print(temp)
        oled.fill(0)
        oled.text(f"Temp: {temp} C", 0, 0)
        oled.show()
    time.sleep(2)
				
			
For data logging, you can use the following code to write the temperature data to a file on the Pico’s internal file system:
				
					file = open('temperatures.txt', 'w')
while True:
    ds_sensor.convert_temp()
    time.sleep_ms(750)
    for rom in roms:
        temp = ds_sensor.read_temp(rom)
        print(temp)
        file.write(f"{time.time()},{temp}\n")
        file.flush()
    time.sleep(2)
				
			
This project demonstrates how to interface with external sensors using the Pico’s GPIO pins and showcases its ability to handle sensor data acquisition.

Project 3: IoT Data Uploader (Advanced)

Hardware Setup

You’ll need a Raspberry Pi Pico W (with built-in Wi-Fi), a BME280 environmental sensor (measures temperature, humidity, and pressure), a breadboard, and jumper wires. Connect the BME280 to the Pico using I2C: SDA to GPIO 8, SCL to GPIO 9, VCC to 3.3V, and GND to ground. This connection setup allows the Pico to communicate with the BME280 sensor over the I2C bus, enabling the retrieval of environmental data.
Raspberry Pi Pico W with BME280 sensor and Wi Fi
Raspberry Pi Pico W with BME280 sensor and Wi - Fi

Code and IoT Integration

Using MicroPython on the Pico W, first connect to a Wi-Fi network. Set up the Wi-Fi credentials:
				
					import network

ssid = 'your_SSID'
password = 'your_PASSWORD'
				
			
Connect using the network interface:
				
					wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)

while not wlan.isconnected():
    pass

print('Connected to WiFi')
				
			
Then, initialize the BME280 sensor using the bme280 class. You may need to install the bme280 library if it’s not already installed. Here’s how you can initialize it:
				
					import bme280_i2c

i2c = machine.I2C(0, sda=machine.Pin(8), scl=machine.Pin(9))
bme = bme280_i2c.BME280_I2C(i2c)
				
			
The code reads the sensor data and uploads it to an IoT platform like Ubidots or Thingspeak using the HTTP POST method. Here’s a simplified version of the data upload function:
				
					import urequests

def upload_data(temperature, humidity, pressure):
    url = 'https://industrial.api.ubidots.com/api/v1.6/devices/your_device_label'
    headers = {'X-Auth-Token': 'your_token', 'Content-Type': 'application/json'}
    data = '{"temperature": %s, "humidity": %s, "pressure": %s}' % (temperature, humidity, pressure)

    response = urequests.post(url, headers=headers, data=data)
    if response.status_code == 200:
        print('Data uploaded successfully')
    else:
        print('Error uploading data')

    response.close()


while True:
    temperature, pressure, humidity = bme.values
    temperature = float(temperature.strip(' C'))
    humidity = float(humidity.strip(' %'))
    pressure = float(pressure.strip(' hPa'))

    upload_data(temperature, humidity, pressure)
    time.sleep(60)
				
			

Testing and Scalability

Once the code is running, the Pico W will connect to the internet, read data from the BME280, and upload it to the chosen IoT platform. You can view the data in real-time on the platform’s dashboard. This project highlights the Pico W’s wireless capabilities and shows how to build scalable IoT solutions with the Pico, opening the door to smart home applications, environmental monitoring, and more. If you plan to scale this project, you can add more sensors, adjust the data collection intervals, or even use a more robust IoT platform with advanced analytics features.

Conclusion

The Raspberry Pi Pico is a fantastic tool for makers of all skill levels, offering endless possibilities for creative projects. Whether you’re just starting with a simple LED blink or building an advanced IoT system, the Pico’s affordability, performance, and ease of use make it a top choice. I hope these projects inspire you to start experimenting with your own Pico builds. Share your projects in the comments below – I’d love to see what you create!

Subscribe

Join our subscribers list to get monthly blog updates, technology news, case studies. We will never send spam, and you can unsubscribe at any time.

[convertkit form=7447186]
Scroll to Top

Instant Quote