Raspberry Pi Pico

Raspberry Pi Pico RP2040 Development Board, Raspberry Pi Pico Examples

Last Updated on September 8, 2025 by Engr. Shahzada Fahad

Raspberry Pi Pico Development Board:

Today I am going to talk about the elecfreaks Raspberry Pi Pico Development board, and honestly, it’s one of the best things I have used with the Raspberry Pi Pico.

The first thing I love is the battery slot. You can put a Lithium Ion 18650 battery in it, and it powers the whole board; no need for wires or a power bank.

The green Raspberry Pi Pico Development board showing its components and pin layout for projects.

I tested it, and it worked for more than 2 hours on battery alone. That’s great for projects like robots or anything you want to run without USB.

Next, it has some cool features built in. You get a buzzer, two buttons (A and B), and even two rainbow LEDs. These are already connected to the GPIO pins, so no need for extra wiring. Just write your code and run it; simple!

It also has motor ports; M1, M2, M3, and M4; so you can easily control motors without needing a motor driver board. That’s really useful if you are building a car or a robot.

There is also a charging indicator, a power switch, and a power indicator LED.

The Wukong 2040, an advanced robotics board based on the same chip as the Raspberry Pi Pico Development board.

And what I really like is that all the GPIO pins are clearly labeled. There’s no guessing; you can see which pin does what. It also supports I2C, SPI, UART, and ADC, so you can connect sensors, displays, or anything else.




And one more thing I would like to highlight is the base of this board; take a look at this! It’s LEGO compatible.

Integrating a Raspberry Pi Pico Development board with Lego bricks to build a custom robot.

That means you can easily mount it on your custom LEGO creations

Everything is clean, organized, and ready to use. If you are a beginner or even if you have done some projects before; this board will save you time and help you build faster.

Amazon Links:

Raspberry Pi Pico WuKong Development board

Other Tools and Components:

ESP32 WiFi + Bluetooth Module (Recommended)

Arduino Nano USB C type (Recommended)

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!



I have already uploaded a detailed article on my Raspberry Pi Pico course. In that article, I showed how to install Thonny IDE and do all the basic settings. So today, I won’t repeat those steps again. But this time, I will show you another way to quickly set up your Raspberry Pi Pico for Thonny IDE.

In the Raspberry Pi course, I used the UF2 file method, which can take some time and might be a bit confusing; especially for beginners; because you have to download and flash the file manually. But the method I will show you now is much easier and more beginner-friendly.

Anyway, once you have installed Thonny IDE.

The Thonny IDE software interface during the initial setup for a Raspberry Pi Pico Development board.

Push and hold the Boot Selection button and plug your Raspberry Pi Pico into the USB port of your Laptop or computer.

It will mount as a Mass Storage Device called RPI-RP2.

A computer file explorer showing the Raspberry Pi Pico Development board as an "RPI-RP2" USB drive.

Release the BOOT Selection button after your Pico is connected.



While Thonny IDE is open, look at the bottom right corner. You might see something like “Local Python 3 Thonny’s Python”. It doesn’t matter what’s written there; just click on it.

Screenshot of Thonny IDE's settings to configure the interpreter for a Raspberry Pi Pico Development board.

Now click on “Configure Interpreter”.

Make sure the “Interpreter” tab is selected.

It will ask: “Which kind of interpreter should Thonny use for running your code?”

Selecting "MicroPython (Raspberry Pi Pico)" in Thonny for a Raspberry Pi Pico Development board.

From the list, select “MicroPython (Raspberry Pi Pico)”.

Clicking the "Install" button in Thonny IDE to flash MicroPython to a Raspberry Pi Pico Development board.

The install or update MicroPython link will appear instantly. Just click on it.

Thonny IDE window to select the MicroPython firmware for a Raspberry Pi Pico Development board.

Thonny will automatically select the Target volume for you. If it doesn’t, no problem; you can select it yourself.

Next, you have to select the variant; the one I am using is the simple Raspberry Pi Pico.

Finally, click on the install button.

That’s it; this was the only hard part!

You will see Done! when the installation is completed.

Now go ahead and select the MicroPython (Raspberry Pi Pico).

The Thonny IDE status bar showing a successfully connected Raspberry Pi Pico Development board.

To test this Raspberry Pi Pico Development board, I have already prepared some example codes; so let’s go ahead and try them out one by one.



Raspberry Pi Pico and Rainbow LEDs:

The two Rainbow LEDs are connected to GP22.

Rainbow LEDs Code:

This code brings your RGB LEDs to life with a smooth rainbow effect.

if you want the complete folder with all the resources, head over to my Patreon page; you can download the full project files. It will save you a lot of time. Just download the folder and start running the examples!

To run this code, just click on the Play button.




Practical Demonstration:

A Raspberry Pi Pico Development board creating a vibrant rainbow effect on a strip of RGB LEDs.

Boom! The rainbow LEDs are working perfectly; just look at those colors smoothly changing. It’s such a satisfying effect, and it instantly makes your project look cool and professional. And the best part? It only took a few lines of MicroPython!

Now let’s take it one step further; we are going to control the two rainbow LEDs individually.

One will go red, the other green, and we will even make them switch colors back and forth. Let’s run the code!

Practical Demonstration:

A Raspberry Pi Pico Development board controlling individual RGB LEDs on a breadboard.

As you can see, the two rainbow LEDs are now blinking in alternating colors. One goes red while the other goes green, and then they swap.

This proves that we can control each LED individually even though both are connected to the same GPIO pin.

It’s a great way to test your wiring and confirm everything is working before moving on to more advanced effects.”

And if you want the LEDs to switch faster or slower, just change the delay time in the code; it’s super simple!



Raspberry Pi Pico and PushButtons:

Alright, now let’s test those pushbuttons; one will change the LEDs color, and the other will control the brightness.

The two buttons are connected to GP18 and GP19. Let’s go ahead and run this code.

Push Buttons Example:

Practical Demonstration:

For the practical demonstration; watch video tutorial given at the end of this article. Anyway;

When I press the first button, the LED color changes. Every press cycles through a new color from the predefined list.

And when I press the second button, the brightness increases.



Raspberry Pi Pico and Buzzer:

Now let’s move on to the next example; controlling a buzzer connected to pin GP9.

I have written three different codes to test the buzzer, just go ahead and try them out one by one.

Buzzer PWM:

Repeated Beeps:

Happy Birthday Tone:



Raspberry Pi Pico and Servo:

Now let’s move on to the next example; this one is all about controlling a servo motor connected to the GP0.

I have written a simple script that smoothly sweeps the servo back and forth between 0 and 90 degrees.

You can change the sweep angle, the speed, and even the step size using the user-friendly settings at the top of the code. So, whether you want fast movement or smooth, slow motion; it’s all right there!

Let’s run the code and watch the servo in action!

A Raspberry Pi Pico Development board connected with wires to control a small blue servo motor.

So, that’s all for now.




Frequently Asked Questions (FAQ)

  1. What is the Elecfreaks Wukong 2040 board?
    The Elecfreaks Wukong 2040 is an all-in-one Raspberry Pi Pico development board designed for beginners and robotics projects. It includes a battery slot, built-in motor drivers, buttons, LEDs, a buzzer, and a LEGO-compatible base.

  2. Can you power a Raspberry Pi Pico with a battery?
    Yes, development boards like the Wukong 2040 have a built-in slot for a rechargeable 18650 battery, allowing you to power your Raspberry Pi Pico projects without a USB cable.

  3. What is the best Raspberry Pi Pico board for beginners?
    The Wukong 2040 is an excellent choice for beginners because it integrates common components like motor drivers, buttons, and LEDs directly onto the board, eliminating the need for complex wiring and extra components.

  4. How do you connect motors to a Raspberry Pi Pico?
    While a standard Pico requires a separate motor driver board, the Wukong 2040 development board has built-in motor ports (M1-M4), allowing you to connect and control motors directly.

  5. What is the easiest way to install MicroPython on a Raspberry Pi Pico?
    The easiest way is to use the Thonny IDE. After connecting the Pico in BOOTSEL mode, you can use Thonny’s “Configure Interpreter” tool to automatically find and install the latest MicroPython firmware directly onto the board.

  6. How do I set up Thonny for Raspberry Pi Pico?
    In Thonny, go to “Run” > “Configure interpreter,” select “MicroPython (Raspberry Pi Pico)” from the dropdown menu, and choose the correct port for your device. If MicroPython isn’t installed, Thonny will prompt you to install it.

  7. What IDE is best for Raspberry Pi Pico?
    Thonny is the most recommended IDE for Raspberry Pi Pico, especially for beginners. It has built-in support for MicroPython and includes tools to easily manage files and install firmware on the device.

  8. How do you control RGB LEDs with Raspberry Pi Pico?
    You can control RGB LEDs using the neopixel library in MicroPython. By connecting the LED data pin to a GPIO pin on the Pico, you can write code to set the color and brightness of each LED individually or create effects like a rainbow cycle.

  9. How do I control a servo motor with Raspberry Pi Pico?
    You can control a servo by using Pulse Width Modulation (PWM) on a GPIO pin. In MicroPython, you import the PWM class from the machine library, set the frequency to 50Hz, and then adjust the duty cycle to move the servo to a specific angle.

  10. How do you make a Raspberry Pi Pico make sound?
    You can make a Raspberry Pi Pico produce sound by connecting a buzzer to a GPIO pin and using PWM. By changing the PWM frequency, you can create different tones, and by turning it on and off in a sequence, you can play simple melodies.



Watch Video Tutorial:

 


Discover more from Electronic Clinic

Subscribe to get the latest posts sent to your email.

Engr. Shahzada Fahad

Engr. Shahzada Fahad is an Electrical Engineer with over 15 years of hands-on experience in electronics design, programming, and PCB development. He specializes in microcontrollers (Arduino, ESP32, STM32, Raspberry Pi), robotics, and IoT systems. He is the founder and lead author at Electronic Clinic, dedicated to sharing practical knowledge.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Discover more from Electronic Clinic

Subscribe now to keep reading and get access to the full archive.

Continue reading

Electronic Clinic
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.