Raspberry Pi Pico W
Program, build, and master 60+ projects with the Wireless RP2040
Cover Visual: Features a Raspberry Pi Pico W board, a Python code snippet for temperature sensing, a Wi-Fi symbol [📶], a Raspberry Pi logo [Raspberry Pi], and an Elektor logo [Elektor]. The code snippet demonstrates a loop for reading UART data and sending temperature readings.
TRIED. TESTED.
file True: buf = uart.readline() dat = buf.decode('UTF-8') n = dat.find("T?") if n > 0: T = GetTemperature() Tstr = "T="+str(T) Tlen = str(len(Tstr)) PSEND="+Tlen + "\r\n" # AT uart.write(Tstr) # Send to ESP # Wait 2 sec # Send da
Publisher Information
This is an Elektor Publication. Elektor is the media brand of Elektor International Media B.V.
PO Box 11, NL-6114-ZG Susteren, The Netherlands
Phone: +31 46 4389444
Copyright © 2022: Elektor International Media B.V.
ISBN (Print): 978-3-89576-529-2
ISBN (eBook): 978-3-89576-530-8
Editor: Alina Neacsu
Prepress Production: D-Vision, Julian van den Berg
Elektor is part of EIM, the world's leading source of essential technical information and electronics products for professional engineers, electronics designers, and the companies seeking to engage them. Each day, their international team develops and delivers high-quality content via a variety of media channels (including magazines, video, digital media, and social media) in several languages – relating to electronics design and DIY electronics. Visit www.elektormagazine.com.
Contents Overview
Chapter 1: Raspberry Pi Pico W Hardware
- 1.1 Overview
- 1.2 The Pico hardware module
- 1.3 Comparison with the Arduino UNO
- 1.4 Operating conditions and powering the Pico
- 1.5 Pinout of the RP2040 microcontroller and Pico module
- 1.6 Other RP2040 microcontroller-based boards
Chapter 2: Raspberry Pi Pico W Programming
- 2.1 Overview
- 2.2 Installing MicroPython on Pico W
- 2.3 Using the Thonny text editor from the PC
- 2.4 Writing a program using Thonny
- 2.5 Software only MicroPython programs using the Raspberry Pi Pico W
Chapter 3: Raspberry Pi Pico W LED Projects
- 3.1 Overview
- 3.2 Project 1: External flashing LED
- 3.3 Project 2: Flashing SOS signal
- 3.4 Project 3: Flashing LED using a timer
- 3.5 Project 4: Changing the LED flashing rate using pushbutton interrupts
- 3.6 Project 5: Randomly flashing red, green, and blue LEDs – RGB
- 3.7 Project 6: Binary counting LEDs
- 3.8 Project 7: Lucky day of the week
- 3.9 Project 8: Electronic dice
- 3.10 Project 9: Binary counter – Using the 74HC595 shift register
- 3.11 Project 10: Chasing LEDs - Using the 74HC595 shift register
- 3.12 Project 11: Turning a selected LED ON - Using the 74HC595 shift register
- 3.13 Project 12: Randomly flashing LEDs – Using the 74HC595 shift register
- 3.14 Project 13: Traffic lights
- 3.15 Project 14: Simple logic probe
- 3.16 Project 15: Advanced logic probe
Chapter 4: Raspberry Pi Pico W Multi-Digit 7-Segment Display Projects
- 4.1 Overview
- 4.2 7-Segment LED Displays
- 4.3 Project 1: 4-digit 7-segment display seconds counter
- 4.4 Project 2: 4-digit 7-segment display conveyor belt goods counter
Chapter 5: Raspberry Pi Pico W LCD Projects
- 5.1 Overview
- 5.2 HD44780 parallel LCD module
- 5.3 The I2C Bus
- 5.4 pins of the Raspberry Pi Pico W
- 5.5 Project 1: Parallel LCD – displaying text
- 5.6 Project 2: Reaction-timer with parallel LCD
- 5.7 Project 3: Voltmeter with parallel LCD
- 5.8 Project 4: Temperature measurement – using the internal temperature sensor with parallel LCD
- 5.9 Project 5: Temperature measurement using an external temperature sensor and with parallel LCD
- 5.10 Project 6: ON/OFF temperature controller with parallel LCD
- 5.11 Project 7: Measuring the ambient light intensity – using parallel LCD
- 5.12 Project 8: Ohmmeter – using parallel LCD
- 5.13 The I2C LCD
- 5.14 Project 9: I2C LCD seconds counter
- 5.15 Project 10: Internal and external temperature – using LCD
- 5.16 Project 11: Using a thermistor to measure temperature – using an I2C LCD
- 5.17 Project 12: Ultrasonic distance measurement using an I2C LCD
- 5.18 Project 13: Measuring the depth of a river
- 5.19 Project 14: Ultrasonic reverse parking aid with buzzer
- 5.20 Project 15: Displaying custom characters on the LCD
- 5.21 Project 16: LCD dice
- 5.22 Project 17: Using a real-time clock (RTC) module – setting/displaying date and time
- 5.23 Project 18: Saving the temperature with time stamping
- 5.24 Project 19: GPS – Displaying the geographical coordinates on LCD
Chapter 6: Pulse Width Modulation (PWM)
- 6.1 Overview
- 6.2 Basic theory of the pulse width modulation
- 6.3 PWM channels of the Raspberry Pi Pico W
- 6.4 Project 1: Generate 1000 Hz PWM waveform with 50% duty cycle
- 6.5 Project 2: Changing the brightness of an LED
- 6.6 Project 3: Electronic candle
- 6.7 Project 4: Varying the speed of a brushed DC motor
- 6.8 Project 5: Frequency generator with LCD and potentiometer
- 6.9 Project 6: Measuring the frequency and duty cycle of a PWM waveform
- 6.10 Project 7: Melody maker
Chapter 7: TFT Displays
- 7.1 Overview
- 7.2 TFT display used
- 7.3 Connecting the TFT display to Raspberry Pi Pico W
- 7.4 ST7735 TFT display driver library
- 7.4.1 Drawing shapes
- 7.4.2 Displaying text
- 7.4.3 Other TFT functions
- 7.5 Project 1: Seconds counter
- 7.6 Project 2: Reaction timer
- 7.7 Project 3: Temperature and humidity – Display on TFT
- 7.8 Project 4: Minimum/maximum temperature and humidity – Display on TFT
- 7.9 Project 5: ON/OFF temperature control – Setting the desired temperature using buttons and the TFT display
- 7.10 Project 6: ON/OFF temperature control – Setting the desired temperature using rotary encoder and the TFT display
- 7.11 Project 7: TFT bitmap display
- 7.12 Project 8: Using a 4×4 keypad
- 7.13 Project 9: Elementary multiplication – using 4×4 keypad and TFT
- 7.14 Project 10: Calculator - using 4×4 keypad and TFT
- 7.15 Project 11: HiLo game - using 4×4 keypad and TFT
Chapter 8: I2C Bus Projects
- 8.1 Overview
- 8.2 The I2C Bus
- 8.3 I2C pins of the Raspberry Pi Pico W
- 8.4 Project 1: I2C port expander
- 8.5 Project 2: TMP102 temperature sensor with LCD
Chapter 9: OLED Displays
- 9.1 Overview
- 9.2 Installing the SSD1306 driver software
- 9.3 Hardware interface
- 9.4 Displaying text on OLED
- 9.5 Displaying common shapes
- 9.6 Other useful functions
- 9.7 Project 1: Seconds counter
- 9.8 Project 2: Drawing bitmaps
- 9.9 Project 3: DS18B20 OLED-based digital thermometer
- 9.10 Project 4: Heart rate (pulse) measurement
Chapter 10: Using Bluetooth with the Raspberry Pi Pico W
- 10.1 Overview
- 10.2 Raspberry Pi Pico W Bluetooth interface
- 10.3 Project 1: Controlling three LEDs from a smartphone using Bluetooth
- 10.4 Project 2: Sending the Raspberry Pi Pico W internal temperature to a smartphone
Chapter 11: Using Wi-Fi with the Raspberry Pi Pico W
- 11.1 Overview
- 11.2 Connecting to a wireless network
- 11.3 Project 1: Scan the local network
- 11.4 Using the Socket library
- 11.4.1 UDP programs
- 11.5 Project 2: Controlling an LED from a smartphone using Wi-Fi - UDP communication
- 11.6 Project 3: Displaying the internal temperature on a smartphone using Wi-Fi
- 11.7 Project 4: Remote control from an Internet browser (using a smartphone or PC) - Web Server
- 11.8 Project 5: Storing ambient temperature and atmospheric pressure data on the Cloud
Chapter 12: RFID Projects
- 12.1 Overview
- 12.2 RC522 RFID reader pins
- 12.3 Interfacing RC522 RFID reader module to Raspberry Pi Pico W
- 12.4 Project 1: Finding the Tag ID
- 12.5 Project 2: RFID door lock access with relay
- 12.6 Project 3: Multi-tag RFID access system with LCD
Index