- Learn Linux
- Learn Electronics
- Raspberry Pi
- LPI certification
- News & Reviews
The Raspberry Pi Pico is a small inexpensive microcontroller based around a custom designed integrated circuit. It has support for C/C++ as well as MicroPython.
There is now a wireless version of the Raspberry Pi Pico. For the wireless version please see Pico W (Wi-Fi) project page.
In my first video on the Raspberry Pi Pico I explain what it is, how it differs from the Raspberry Pi computers and where you'd choose each. I also explained how you can get the advantages of both by using them together.
This video includes a very basic program in MicroPython showing how you can install MicroPython on the Pico and then create your own program using the Thonny editor.
This is a mini project showing how you can communicate between a Raspberry Pi computer and a Raspberry Pi Pico. This is using the UART serial protocol. It uses the Analog-to-Digital convertor to measure a voltage input, which is then displayed on a graphical user interface (GUI) on the Raspberry Pi.
Code is provided for both Python and C running on the Pico and then Python with Pygame Zero on the Raspberry Pi computer.
The use of the Pygame Zero for a graphical interface for an electronics project is along similar lines to my project Pygame Zero for makers - controlling electronics with Python PygameZero.
The project is a bit different than I originally planned. I was hoping to use I squared C or possibly SPI to communicate between the Raspberry Pi and the Raspberry Pi Pico, but I ended up using UART serial instead. That’s not a problem with this example, but I’ll explain the reason for that in the video. I hope to look at the other protocols in a future video.
The following connections are needed. Both the Raspberry Pi and the Raspberry Pi Pico have 3.3V for the GPIO so these can be connected direct without needing a level-converter.
A full workthrough on setting up MicroPython is included in the first video. This goes through the instructions on the Raspberry Pi Pico getting started page. A quick summary of steps is included below.
A run through is shown in the voltmeter video. This goes through the instructions on the Raspberry Pi Pico getting started page.
chmod +x pico_setup.sh
The code that creates the GUI on the Raspberry Pi is written in Pygame Zero. It is created in the Mu editor which has a Pygame Zero mode, making it easier to create Pygame Zero videos.
For more details on creating GUIs see my project on creating maker gui interfaces using Pygame Zero. See this post for details of the serial uart code in Python.
The files required are listed below:
Please view the copyright information regarding use of the circuits.