The complete getting started guide to get the most out of the the Raspberry Pi Pico/Pico W (RP2040) microcontroller board using MicroPython programming language.
Learn Raspberry Pi Pico/Pico W with MicroPython eBook is our complete guide to mastering the Raspberry Pi Pico microcontroller board using MicroPython programming language.
With straight-to-the-point explanations, step-by-step instructions, multiple examples for different case scenarios, and more, you’ll start making projects with the Raspberry Pi Pico independently in no time—check the detailed table of contents.
What is a Raspberry Pi Pico/Pico W?
The Raspberry Pi Pico/Pico W is a relatively recent low-cost microcontroller board developed around the RP2040 chip. This chip was developed by the Raspberry Pi Foundation, the same that developed other popular Raspberry Pi boards.
Unlike previous versions of the Raspberry Pi, the Raspberry Pi Pico is not meant to run an operating system. It is a microcontroller board whose main purpose is to control electronic components through its GPIOs, create automations, and IoT applications—it is completely different from a “regular” Raspberry Pi.
The Raspberry Pi Pico boards are easy to use, and incredibly affordable, available from approximately $6, which makes them widely available to the general public and an excellent tool for teaching electronics and programming concepts.
Other boards with the RP2040 chip should also be compatible with the subjects covered throughout the eBook.
Recommended Board
We recommend getting a Raspberry Pi Pico W. The Raspberry Pi Pico W is a wireless-enabled version of the Raspberry Pi Pico. It comes with an Infineon CYW43439 wireless chip that adds Wi-Fi and Bluetooth support. If you already have a Raspberry Pi Pico (without wireless support), you can still follow along, but you won’t be able to follow the units that require Wi-Fi or Bluetooth.
What is MicroPython?
Currently, MicroPython is the most popular way to program the Raspberry Pi Pico and that’s what we’ll focus on in this eBook. MicroPython is a re-implementation of Python 3 programming language targeted to microcontrollers and embedded systems like the Raspberry Pi Pico, ESP32, ESP8266, and other boards.
MicroPython is very similar to regular Python but is specially crafted for small devices like microcontrollers. It’s like a lightweight version of Python that’s just right for smaller gadgets.
What’s inside the eBook?
The Learn Raspberry Pi Pico with Micropython eBook is a colorful 600-page long PDF with 13 Modules covering almost everything you need to know to start mastering the Raspberry Pi Pico board with MicroPython programming language. It includes multiple examples with all the source code, schematics, and screenshots that are easy to follow.
Each module breaks down a specific subject and allows for quick referencing in the future. It covers each subject with a practical approach (click here for the detailed table of contents):
- Module 1: Introducing the Raspberry Pi Pico
- Module 2: Setting Up the Development Environment
- Module 3: Getting Started with Python/MicroPython Programming Language
- Module 4: Basic GPIO Control
- Module 5: Interfacing with the Most Popular Environmental Sensors
- Module 6: Displays: OLED and LCD
- Module 7: Actuators: Motors and Relay
- Module 8: Filesystem, File Handling, and Datalogging
- Module 9: Wi-Fi Networking
- Module 10: Getting and Handling Time
- Module 11: Local Web Servers
- Module 12: MQTT Protocol for IoT
- Module 13: Bluetooth Low Energy (BLE)
Here’s what you’ll have access to when you get the eBook:
- eBook in PDF format (13 Modules, ~600 pages)
- Source code (python files)
- Unlimited free updates (includes future eBook updates and new projects)
- Access to our private Forum to ask questions
- Exclusive access to our Facebook group community
Table of Contents
The eBook comes with 13 Modules. Each module is dedicated to a specific subject. Here’s the detailed table of contents:
MODULE 0: Introduction
This Module is a quick introduction to the eBook, providing an overview of the modules covered, the learning objectives, instructions on how to follow the eBook, recommended prerequisites, and the parts required to complete the projects.
MODULE 1: Introducing the Raspberry Pi Pico
This Module is an introduction to the Raspberry Pi Pico microcontroller board. We’ll look at its main specifications, familiarize you with its hardware, and explore its GPIOs and different functions. You’ll learn how to power it and the various ways to program it. In summary, we’ll cover all the basic subjects you need to know to get started.
- 1.1 – Introducing the Raspberry Pi Pico
- 1.2 – How to Program the Raspberry Pi Pico?
- 1.3 – Understanding the Raspberry Pi Pico Hardware
- 1.4 – Raspberry Pi Pico Pinout
- 1.5 – Powering the Raspberry Pi Pico
MODULE 2: Setting Up the Development Environment
In this Module, you’ll install the software required to program the Raspberry Pi Pico with MicroPython (Thonny IDE), you’ll learn how to establish a connection with the board, upload code, and run your first program.
- 2.1 – Setting up the Development Environment
- 2.2 – Installing MicroPython Firmware
- 2.3 – Writing and Running your First Program
- 2.4 – Programming the Raspberry Pi Pico using VS Code (for advanced users)
MODULE 3: Getting Started with Python/MicroPython Programming Language
Learn the basics of MicroPython programming language, a re-implementation of Python programming language targeted to microcontrollers. We’ll cover basic, but fundamental concepts, like syntax, variables, functions, classes, modules, and more.
- 3.1 – Introducing MicroPython
- 3.2 – Basic MicroPython Syntax
- 3.3 – Functions in MicroPython
- 3.4 – Classes, Objects, and Modules
- 3.5 – String Formatting
MODULE 4: Basic GPIO Control
You’ll learn how to use the GPIO functionalities and how to interface basic electronics components. We include controlling digital outputs, outputting PWM signals, read digital inputs and analog inputs. You’ll also learn about interrupts and timer events.
- 4.1 – Digital Inputs and Digital Outputs
- 4.2 – Analog Inputs
- 4.3 – PWM – Pulse Width Modulation
- 4.4 – The Internal Temperature Sensor
- 4.5 – Interrupts
- 4.6 – Timers and Event Handling
MODULE 5: Interfacing with the Most Popular Environmental Sensors
In this Module, you’ll learn how to connect and get environmental data from some of the most popular sensors in DIY hobbyists’ projects. We’ll cover temperature, humidity, pressure, and light sensors.
- 5.1 – DHT11/DHT22: Getting Temperature and Humidity
- 5.2 – DS18B20 Addressable Temperature Sensor
- 5.3 – BME280/BME680 Environmental Sensors
- 5.4 – LDR and BH1750 Light Sensor
MODULE 6: Basic Displays: OLED and LCD
Interface and display data on the most basic, cheap, and easy-to-use display modules. We’ll cover the OLED and the LCD display.
- 6.1 – OLED Display
- 6.2 – LCD Display
MODULE 7: Actuators: Motors and Relay Module
Learn how to use the Raspberry Pi Pico output pins to control actuators like motors and a relay module. We cover three different types of motors: DC motor, stepper motor, and servo motor.
- 7.1 – Servo Motor
- 7.2 – DC Motor
- 7.3 – Stepper Motor
- 7.4 – Relay Module
MODULE 8: Filesystem, File Handling and Datalogging
Interact with the Raspberry Pi Pico filesystem and learn how to handle files and folders. We also cover how to use the Pico’s filesystem to log data permanently into a file (datalogging projects). Finally, you’ll also learn how to read and write data to a microSD card to save data using the Raspberry Pi Pico.
- 8.1 – Handling Files and Directories
- 8.2 – Datalogging Temperature to a File (Filesystem)
- 8.3 – Using a microSD Card for Datalogging
- 8.4 – Saving Variables Values Permanently (JSON Objects and Files)
MODULE 9: Wi-Fi Networking
Get started with Wi-Fi on the Raspberry Pi Pico. Learn how to activate the Wi-Fi and connect to a network. You’ll also learn how to make HTTP requests to get useful data from the internet using APIs.
- 9.1 – Introducing Wi-Fi on the Pico
- 9.2 – Getting Started with HTTP Requests
- 9.3 – Getting Data from the Web using HTTP GET Requests
- 9.4 – Control the Pico Remotely using Adafruit IO
- 9.5 – Sending Messages to WhatsApp using CallmeBot API
MODULE 10: Getting and Handling Time
This Module covers different ways to get date and time using the Raspberry Pi Pico and how to synchronize the Pico internal clock. You’ll also learn how to use an external RTC to accurately track time, even when the board resets or loses power. Finally, you’ll learn the basics of asynchronous programming.
- 10.1 – Getting Date and Time using the time Module
- 10.2 – Getting Date and Time using ntptime
- 10.3 – Synchronize Time using the World Time API
- 10.4 – Keep Track of Time using a Real Time Clock (RTC) Module
- 10.5 – Asynchronous Programming using the asyncio Module
MODULE 11: Local Web Servers
Turn your Raspberry Pi Pico into a web server that serves files to build web pages. Learn how to use those web pages to display data from sensors and interact with the Pico GPIOs to control outputs.
- 11.1 – Local Basic Web Server
- 11.2 – Saving Network Credentials on a Separate File
- 11.3 – Web Server: Display Sensor Readings and Control Outputs
- 11.4 – Serving External Files (Filesystem)
- 11.5 – Asynchronous Web Server with asyncIO
MODULE 12: MQTT Protocol for IoT
MQTT is a communication protocol widely used in IoT and home automation projects. It’s easy to use and is great for building a system to communicate with multiple devices. You’ll learn how to program the Pico to send and receive MQTT messages and we’ll also take a brief overview of the Node-RED platform to control your board(s) via MQTT.
- 12.1 – Introducing MQTT
- 12.2 – Set Up An MQTT Broker
- 12.3 – Publish MQTT Messages
- 12.4 – Subscribe to MQTT Topics
- 12.5 – Control and Monitor your Devices with Node-RED (MQTT)
MODULE 13: Bluetooth Low Energy (BLE)
The Raspberry Pi Pico supports both Bluetooth and Bluetooth Low Energy (BLE). Support for Bluetooth in MicroPython is relatively new. So, resources and information are scarce at the moment. This Module is just a short introduction to BLE and simple examples to set the Pico as a BLE peripheral and central device. We intend to expand this module in the future if the community continues working on Bluetooth with MicroPython.
- 13.1 – Introducing Bluetooth with the Raspberry Pi Pico W
- 13.2 – BLE Peripheral and Central
Prerequisites
There’s no previous knowledge required to complete the eBook, but some basic knowledge of simple electronics components like breadboards, LEDs, pushbuttons, etc. is beneficial.
We use a step-by-step teaching approach, so all the modules and corresponding units are straightforward to follow even with no previous experience.
Invitation to Join our Private Forum!
This eBook comes with an opportunity to join our private Forum of like-minded people where you can ask questions about the eBook or other related subjects. You’ll get direct help from us (Rui and Sara) or from other active members of the community.
Download the eBook
- New eBook – updated April 2024
- 13 Modules
- PDF eBook with ~600 pages
- Source code (Python files)
- Schematic diagrams
- Parts list
- Step-by-step instructions
- Unlimited updates
- Exclusive access to our private forum
- English language
- Created by Rui Santos and Sara Santos
Click here to get the eBook | $33 USD
Note: after your purchase, you receive an email with a username and password that you use to access the members’ area and download the PDF eBook.
Have questions? Email me at https://randomnerdtutorials.com/support anytime for any reason.
You won’t regret it. My 60-day money-back guarantee backs up every word in this message. Proceed with confidence. See you inside,
-Rui Santos and Sara Santos
Frequently Asked Questions
Meet the Authors
See what others are saying about our work
(…) I have 11 of your courses and love all of them. I recommend your courses and web site in all my correspondence for anyone in learning Arduino, ESP32, MicroPython, RaspPi subjects. Even though this is just a hobby for me, your stuff has given me more enjoyable learning than any other authors on this – for over 30 years. Thanks for all you do.
William Taylor
Thank you Rui. Anyone wondering whether you bring value can rely on my word. I’ve purchased hundreds of books over a 45 year career as engineer and entrepreneur. NONE of these books have approached your excellent method of teaching a subject. You have a rare gift as a teacher. Glad to have made the purchases.
Paul
I purchased all of your Random Nerd Tutorials Courses. I have completed the ESP32-CAM Projects and SMART HOME courses and have never seen such great e-books for Raspberry, Arduino and ESP microcontrollers before. Your chosen modules show great possibilities and the step by step instructions are very useful. This saved me a lot of frustration and I could quickly achieve great results. Thank you very much.
Chris Steffes
I want to congratulate you on the manuals you have created, they are the best of the best that I have seen in many years. (… ) Your explanations are very clear and very detailed, as if you were a teacher…
Tino Fernández
I placed the order of these ebooks/courses and have downloaded the eBooks. The ebooks are very informative and very well presented, as is your website(…).
Robert Kyle
I appreciate your eBooks, and especially your support that comes with them! Thank you
Joe Margevicius
I want to thank you for the high quality of your projects. Too many others just list a series of tasks but not what to do when they do not go as planned. The detail that you have put into the writeups is amazing. I am working with my 10 year old grandson to help this interest in electronics and software. It would be much harder without your guides.
Doug Hogg
Thank you. I’ve bought two of your course books and they really accelerate the learning curve with the result I wanted.
Paul Kroshko
This is just a thank you! I’ve used bits of your code in almost all my projects. Because of your tutorilas I managed to get a job yesterday.
Jan Gremmler
AS SEEN ON…