Multitasking and multiprocessing have become a very important topic in microcontroller-based systems, namely in complex commercial, domestic, and industrial automation applications. As the complexity of projects grows, more functionalities are demanded from the projects. Such projects require the use of multiple inter-related tasks running on the same system and sharing the available resources, such as the CPU, memory, and input-output ports. As a result of this, the importance of multitasking operations in microcontroller-based applications has grown steadily over the last few years. Many complex automation projects now make use of some form of a multitasking kernel.
This book is project-based and its main aim is to teach the basic features of multitasking using the Python 3 programming language on Raspberry Pi. Many fully tested projects are provided in the book using the multitasking modules of Python. Each project is described fully and in detail. Complete program listings are given for each project. Readers should be able to use the projects as they are, or modify them to suit their own needs.
The following Python multitasking modules have been described and used in the projects:
Fork
Thread
Threading
Subprocess
Multiprocessing
The book includes simple multitasking projects such as independently controlling multiple LEDs, to more complex multitasking projects such as on/off temperature control, traffic lights control, 2-digit, and 4-digit 7-segment LED event counter, reaction timer, stepper motor control, keypad based projects, car park controller, and many more. The fundamental multitasking concepts such as process synchronization, process communication, and memory sharing techniques have been described in projects concerning event flags, queues, semaphores, values, and so on.
Learn to program displays and GUIs with Python
This book is about Raspberry Pi 4 display projects. The book starts by explaining how to install the latest Raspbian operating system on an SD card, and how to configure and use the GPIO ports.
The core of the book explains the following topics in simple terms with fully tested and working example projects:
Simple LED projects
Bar graph LED projects
Matrix LED projects
Bitmap LED projects
LED strips
LCDs
OLED displays
E-paper displays
TFT displays
7-inch touch screen
GUI Programming with Tkinder
One unique feature of this book is that it covers almost all types of display that readers will need to use in their Raspberry Pi based projects. The operation of each project is fully given, including block diagrams, circuit diagrams, and commented full program listings. It is therefore an easy task to convert the given projects to run on other popular platforms, such as Arduino or PIC microcontrollers.
Python program listings of all Raspberry Pi projects developed in this book are available for download at Elektor.com. Readers can use these programs in their projects. Alternatively, they can modify the programs to suit their applications.
Build robust, intelligent machines that combine Raspberry Pi computing power with LEGO components.
The Raspberry Pi Build HAT provides four connectors for LEGO Technic motors and sensors from the SPIKE Portfolio. The available sensors include a distance sensor, a color sensor, and a versatile force sensor. The angular motors come in a range of sizes and include integrated encoders that can be queried to find their position.
The Build HAT fits all Raspberry Pi computers with a 40-pin GPIO header, including – with the addition of a ribbon cable or other extension device — Raspberry Pi 400. Connected LEGO Technic devices can easily be controlled in Python, alongside standard Raspberry Pi accessories such as a camera module.
Features
Controls up to 4 motors and sensors
Powers the Raspberry Pi (when used with a suitable external PSU)
Easy to use from Python on the Raspberry Pi
The Raspberry Pi Debug Probe is an all-in-one USB-to-debug kit that provides all the necessary hardware and cables for easy, solderless, plug-and-play debugging.
It features both a processor serial debug interface (by default the ARM Serial Wire Debug interface, but other interfaces can be supported) and an industry-standard UART interface. Both interfaces use the Raspberry Pi 3-pin debug connector.
It is designed to make it easy to debug and program Raspberry Pi Pico and RP2040 with a range of host platforms including Windows, Mac, and typical Linux computers.
While designed for use with Raspberry Pi products, the Debug Probe provides standard UART and CMSIS-DAP interfaces over USB, so it can also be used with other processors, or even just as a USB-to-UART cable. It works with OpenOCD and other tools that support CMSIS-DAP.
The Debug Probe is based on Raspberry Pi Pico hardware and runs the open source Raspberry Pi Pico Probe software. The firmware is updated in the same way as Raspberry Pi Pico firmware, so it is easy to keep the unit up to date with the latest firmware, or to use custom firmware.
Features
USB to ARM Serial Wire Debug (SWD) port
USB to UART bridge
Compatible with the CMSIS-DAP standard
Works with OpenOCD and other tools supporting CMSIS-DAP
Open source, easily upgradeable firmware
Specifications
Dimensions: 22 x 32 mm
Nominal I/O voltage: 3.3 V
Operating temperature: -20°C to +70°C
Included
1x Raspberry Pi Debug Probe
1x Plastic case
1x USB cable
3x Debug cables
3-pin JST connector to 3-pin JST connector cable
3-pin JST connector to 0.1-inch header (female)
3-pin JST connector to 0.1-inch header (male)
Downloads
Datasheet
3-pin Debug Connector
Schematics
Diagram
Latest Firmware
The Raspberry Pi Pico 2 is a new microcontroller board from the Raspberry Pi Foundation, based on the RP2350. It features a higher core clock speed, double the on-chip SRAM, double the on-board flash memory, more powerful Arm cores, optional RISC-V cores, new security features, and upgraded interfacing capabilities. The Raspberry Pi Pico 2 offers a significant boost in performance and features while maintaining hardware and software compatibility with earlier members of the Raspberry Pi Pico series.
The RP2350 provides a comprehensive security architecture built around Arm TrustZone for Cortex-M. It incorporates signed boot, 8 KB of antifuse OTP for key storage, SHA-256 acceleration, a hardware TRNG, and fast glitch detectors.
The unique dual-core, dual-architecture capability of the RP2350 allows users to choose between a pair of industry-standard Arm Cortex-M33 cores and a pair of open-hardware Hazard3 RISC-V cores. Programmable in C/C++ and Python, and supported by detailed documentation, the Raspberry Pi Pico 2 is the ideal microcontroller board for both enthusiasts and professional developers.
Specifications
CPU
Dual Arm Cortex-M33 or dual RISC-V Hazard3 processors @ 150 MHz
Memory
520 KB on-chip SRAM; 4 MB on-board QSPI flash
Interfaces
26 multi-purpose GPIO pins, including 4 that can be used for AD
Peripherals
2x UART
2x SPI controllers
2x I²C controllers
24x PWM channels
1x USB 1.1 controller and PHY, with host and device support
12x PIO state machines
Input power
1.8-5.5 V DC
Dimensions
21 x 51 mm
Downloads
Datasheet (Pico 2)
Datasheet (RP2350)
The Raspberry Pi Zero W extends the Raspberry Pi Zero family. The Raspberry Pi Zero W has all the functionality of the original Raspberry Pi Zero, but comes with added connectivity consisting of:
802.11 b/g/n wireless LAN
Bluetooth 4.1
Bluetooth Low Energy (BLE)
Other Features
1 GHz, single-core CPU
512 MB RAM
Mini HDMI and USB On-The-Go ports
Micro-USB power
HAT-compatible 40-pin header
Composite video and reset headers
CSI camera connector
Downloads
Mechanical Drawing
Schematics
Raspberry Pi Pico W is a microcontroller board based on the Raspberry Pi RP2040 microcontroller chip.
The RP2040 microcontroller chip ('Raspberry Silicon') offers a dual-core ARM Cortex-M0+ processor (133 MHz), 256 KB RAM, 30 GPIO pins, and many other interface options. In addition, there is 2 MB of on-board QSPI flash memory for code and data storage.
Raspberry Pi Pico W has been designed to be a low cost yet flexible development platform for RP2040 with a 2.4 GHz wireless interface using an Infineon CYW43439. The wireless interface is connected via SPI to the RP2040.
Features of Pico W
RP2040 microcontroller with 2 MB of flash memory
On-board single-band 2.4 GHz wireless interfaces (802.11n)
Micro USB B port for power and data (and for reprogramming the flash)
40 pin 21 x 51 mm 'DIP' style 1 mm thick PCB with 0.1' through-hole pins also with edge castellations
Exposes 26 multi-function 3.3 V general purpose I/O (GPIO)
23 GPIO are digital-only, with three also being ADC capable
Can be surface mounted as a module
3-pin ARM serial wire debug (SWD) port
Simple yet highly flexible power supply architecture
Various options for easily powering the unit from micro USB, external supplies or batteries
High quality, low cost, high availability
Comprehensive SDK, software examples and documentation
Features of the RP2040 microcontroller
Dual-core cortex M0+ at up to 133 MHz
On-chip PLL allows variable core frequency
264 kByte multi-bank high performance SRAM
External Quad-SPI Flash with eXecute In Place (XIP) and 16 kByte on-chip cache
High performance full-crossbar bus fabric
On-board USB1.1 (device or host)
30 multi-function general purpose I/O (four can be used for ADC)
1.8-3.3 V I/O voltage
12-bit 500 ksps analogue to digital converter (ADC)
Various digital peripherals
2x UART, 2x I²C, 2x SPI, 16x PWM channels
1x timer with 4 alarms, 1x real time clock
2x programmable I/O (PIO) blocks, 8 state machines in total
Flexible, user-programmable high-speed I/O
Can emulate interfaces such as SD card and VGA
Note: Raspberry Pi Pico W I/O voltage is fixed at 3.3 V.
Downloads
Datasheet
Specifications of 3-pin Debug Connector
The Raspberry Pi Monitor is a 15.6-inch Full HD computer display. User-friendly, versatile, compact and affordable, it is the perfect desktop display companion for both Raspberry Pi computers and other devices.
With built-in audio via two front-facing speakers, and VESA and screw mounting options as well as an integrated angle-adjustable stand, the Raspberry Pi Monitor is ideal for desktop use or for integration into projects and systems. It can be powered directly from a Raspberry Pi, or by a separate power supply.
Features
15.6-inch full HD 1080p IPS display
Integrated angle-adjustable stand
Built-in audio via two front-facing speakers
Audio out via 3.5 mm jack
Full-size HDMI input
VESA and screw mounting options
Volume and brightness control buttons
USB-C power cable
Specifications
Display
Screen size: 15.6 inches, 16:9 ratio
Panel type: IPS LCD with anti-glare coating
Display resolution: 1920 x 1080
Color depth: 16.2M
Brightness (typical): 250 nits
Color gamut: 45%
Viewing angle: 80°
Power
1.5 A/5 V
Can be powered directly from a Raspberry Pi USB port (max 60% brightness, 50% volume) or by a separate power supply (max 100% brightness, 100% volume)
Connectivity
Standard HDMI port (1.4 compliant)
3.5 mm stereo headphone jack
USB-C (power in)
Audio
2x 1.2 W integrated speakers
Support for 44.1 kHz, 48 kHz, and 96 kHz sample rates
Downloads
Datasheet
Raspberry Pi Pico WH is a microcontroller board based on the Raspberry Pi RP2040 microcontroller chip.
The RP2040 microcontroller chip ('Raspberry Silicon') offers a dual-core ARM Cortex-M0+ processor (133 MHz), 256 KB RAM, 30 GPIO pins, and many other interface options. In addition, there is 2 MB of on-board QSPI flash memory for code and data storage.
Raspberry Pi Pico WH has been designed to be a low cost yet flexible development platform for RP2040 with a 2.4 GHz wireless interface using an Infineon CYW43439. The wireless interface is connected via SPI to the RP2040.
Features of Pico WH
RP2040 microcontroller with 2 MB of flash memory
On-board single-band 2.4 GHz wireless interfaces (802.11n)
Micro USB B port for power and data (and for reprogramming the flash)
40 pin 21 x 51 mm 'DIP' style 1 mm thick PCB with 0.1' through-hole pins also with edge castellations
Exposes 26 multi-function 3.3 V general purpose I/O (GPIO)
23 GPIO are digital-only, with three also being ADC capable
Can be surface mounted as a module
3-pin ARM serial wire debug (SWD) port
Simple yet highly flexible power supply architecture
Various options for easily powering the unit from micro USB, external supplies or batteries
High quality, low cost, high availability
Comprehensive SDK, software examples and documentation
Pre-populated headers and 3-pin debug connector
Features of the RP2040 microcontroller
Dual-core cortex M0+ at up to 133 MHz
On-chip PLL allows variable core frequency
264 kByte multi-bank high performance SRAM
External Quad-SPI Flash with eXecute In Place (XIP) and 16 kByte on-chip cache
High performance full-crossbar bus fabric
On-board USB1.1 (device or host)
30 multi-function general purpose I/O (four can be used for ADC)
1.8-3.3 V I/O voltage
12-bit 500 ksps analogue to digital converter (ADC)
Various digital peripherals
2x UART, 2x I²C, 2x SPI, 16x PWM channels
1x timer with 4 alarms, 1x real time clock
2x programmable I/O (PIO) blocks, 8 state machines in total
Flexible, user-programmable high-speed I/O
Can emulate interfaces such as SD card and VGA
Note: Raspberry Pi Pico W I/O voltage is fixed at 3.3 V.
Downloads
Datasheet
Specifications of 3-pin Debug Connector
The Raspberry Pi PoE+ Injector adds Power-over-Ethernet (PoE) functionality to a single port of a non-PoE Ethernet switch, delivering both power and data through one Ethernet cable. It provides a plug-and-play, cost-effective solution for incrementally introducing PoE capability into existing Ethernet networks.
The PoE+ Injector is a single-port, 30 W device suitable for powering equipment compliant with IEEE 802.3af and 802.3at standards, including all generations of Raspberry Pi PoE HATs. It supports network pass-through speeds of 10/100/1000 Mbps.
Note: A separate IEC mains cable is required for operation (not included).
Specifications
Data rate
10/100/1000 Mbps
Input voltage
100 to 240 V AC
Output power
30 W
Power output on pins
4/5 (+), 7/8 (–)
Nominal output voltage
55 V DC
Data connectors
Shielded RJ-45, EIA 568A and 568B
Power connector
IEC c13 mains power input (not included)
Storage humidity
Maximum 95%, non-condensing
Operating altitude
–300 m to 3000 m
Operating ambient temperature
10°C to +50°C
Dimensions
159 x 51.8 x 33.5 mm
Downloads
Datasheet
A Beginner's Guide to AI and Edge Computing
Artificial Intelligence (AI) is now part of our daily lives. With companies developing low-cost AI-powered hardware into their products, it is now becoming a reality to purchase AI accelerator hardware at comparatively very low costs. One such hardware accelerator is the Hailo module which is fully compatible with the Raspberry Pi 5. The Raspberry Pi AI Kit is a cleverly designed hardware as it bundles an M.2-based Hailo-8L accelerator with the Raspberry Pi M.2 HAT+ to offer high speed inferencing on the Raspberry Pi 5. Using the Raspberry Pi AI Kit, you can build complex AI-based vision applications, running in real-time, such as object detection, pose estimation, instance segmentation, home automation, security, robotics, and many more neural network-based applications.
This book is an introduction to the Raspberry Pi AI Kit, and it is aimed to provide some help to readers who are new to the kit and wanting to run some simple AI-based visual models on their Raspberry Pi 5 computers. The book is not meant to cover the detailed process of model creation and compilation, which is done on an Ubuntu computer with massive disk space and 32 GB memory. Examples of pre-trained and custom object detection are given in the book.
Two fully tested and working projects are given in the book. The first project explains how a person can be detected and how an LED can be activated after the detection, and how the detection can be acknowledged by pressing an external button. The second project illustrates how a person can be detected, and how this information can be passed to a smart phone over a Wi-Fi link, as well as how the detection can be acknowledged by sending a message from the smartphone to your Raspberry Pi 5.
The Raspberry Pi AI Camera is a compact camera module based on the Sony IMX500 Intelligent Vision Sensor. The IMX500 combines a 12 MP CMOS image sensor with on-board inferencing acceleration for various common neural network models, allowing users to develop sophisticated vision-based AI applications without requiring a separate accelerator.
The AI Camera enhances captured still images or video with tensor metadata, while keeping the Raspberry Pi's processor free for other tasks. Support for tensor metadata in the libcamera and Picamera2 libraries, as well as the rpicam-apps application suite, ensures ease of use for beginners while providing unparalleled power and flexibility for advanced users.
The Raspberry Pi AI Camera is compatible with all Raspberry Pi models.
Features
12 MP Sony IMX500 Intelligent Vision Sensor
Sensor modes: 4056x3040 (@ 10fps), 2028x1520 (@ 30fps)
1.55 x 1.55 µm cell size
78-degree field of view with manually adjustable focus
Integrated RP2040 for neural network and firmware management
Specifications
Sensor
Sony IMX500
Resolution
12.3 MP (4056 x 3040 pixels)
Sensor size
7.857 mm (type 1/2.3)
Pixel size
1.55 x 1.55 μm
IR cut filter
Integrated
Autofocus
Manual adjustable focus
Focus range
20 cm – ∞
Focal length
4.74 mm
Horizontal FOV
66 ±3°
Vertical FOV
52.3 ±3°
Focal ratio (F-stop)
F1.79
Output
Image (Bayer RAW10), ISP output (YUV/RGB), ROI, metadata
Input tensor maximum size
640 x 640 (H x V)
Framerate
• 2x2 binned: 2028x1520 10-bit 30fps• Full resolution: 4056x3040 10-bit 10fps
Ribbon cable length
20 cm
Cable connector
15 x 1 mm FPC or 22 x 0.5 mm FPC
Dimensions
25 x 24 x 11.9 mm
Downloads
Datasheet
Documentation