CircuitPython is a Python programming language designed specifically for microcontrollers and can now be installed on Raspberry Pi. Here’s how to get started!

This article will guide you through the process of installing CircuitPython on your Raspberry Pi, including downloading the image, preparing the SD card, and getting started with programming in no tim …


Updated August 18, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


This article will guide you through the process of installing CircuitPython on your Raspberry Pi, including downloading the image, preparing the SD card, and getting started with programming in no time.

CircuitPython is a variant of Python that has been developed specifically for microcontrollers like the Raspberry Pi Pico. It offers an easy-to-use environment for programming microcontrollers and has many built-in libraries to interact with sensors, actuators, and other electronic components. CircuitPython can be installed on Raspberry Pi OS as well, giving you access to a range of hardware capabilities right out of the box!

Installation Process

  1. Download CircuitPython Image: The first step in installing CircuitPython is downloading the image file from the Adafruit website. Visit this link and select your specific Raspberry Pi model (e.g., Raspberry Pi 3 B+ or Raspberry Pi 4). Download the latest version of the “UF2 Bootloader” image for your device.

  2. Prepare SD Card: Insert an SD card into your computer and use a tool like Etcher to flash the CircuitPython image onto the card. Once Etcher is done, eject the SD card from your computer.

  3. Insert SD Card in Raspberry Pi: Insert the prepared SD card into your Raspberry Pi and connect it to power, a display (if using one), and a keyboard.

  4. Boot Up Raspberry Pi: After connecting the necessary peripherals, power on your Raspberry Pi. The CircuitPython UF2 bootloader will automatically launch, prompting you to select a drive to write the code to. Choose the SD card and wait for the process to finish.

  5. Start Programming: Once the installation is complete, your Raspberry Pi will reboot and you can start programming in CircuitPython using the REPL (Read-Eval-Print Loop) over a serial connection or by writing scripts on the SD card. You can find examples and documentation on the Adafruit website: https://learn.adafruit.com/circuitpython.

Using CircuitPython

Now that you have installed CircuitPython on your Raspberry Pi, you can start programming! Here are a few examples to get you started:

Blink an LED

import digitalio
import board
import time

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    time.sleep(0.5)
    led.value = False
    time.sleep(0.5)

Read from a temperature sensor

import board
import busio
import adafruit_ads1x15.ads1015 as ADS
from adafruit_ads1x15.analog_in import AnalogIn

i2c = busio.I2C(board.SCL, board.SDA)
ads = ADS.ADS1015(i2c)
chan = AnalogIn(ads, ADS.P0)

while True:
    print((chan.value * 3.3 / 65536) - 0.5)
    time.sleep(0.1)

These examples demonstrate the power of CircuitPython by showing how easy it is to control an LED and read from a temperature sensor. There are many more libraries and capabilities available, so be sure to explore the Adafruit website for more information and examples!