With Examples for Raspberry Pi Pico and ESP32
Creating and programming small electronic systems is now easier than ever before. With inexpensive development boards and modern software tools, anyone curious about embedded design can quickly move from an idea to a working piece of hardware. At the heart of this change is MicroPython—a clear, interactive, and beginner-friendly way to program microcontrollers while still remaining closely connected to the underlying electronics.
This book introduces embedded programming through MicroPython on popular platforms such as the Raspberry Pi Pico and the ESP32. You will discover how to use microcontrollers for reading inputs, processing data, and controlling outputs in a predictable, real-time loop. With just a few lines of code, you can blink LEDs, read sensors, drive motors, and communicate with the outside world. The interactive REPL programming interface encourages experimentation and fast learning, making concepts tangible from the very first chapter.
While different boards offer different capabilities, they all share the same core principles. Timers, GPIO, analog I/O, PWM, interrupts, and communication interfaces form the foundation of every embedded system.
By focusing on these universal building blocks, this book helps you build skills that transfer across platforms and scale naturally toward more advanced development. Whether you are a beginner or an experienced programmer entering embedded systems, you will find that working with MicroPython is both practical and genuinely enjoyable.
Program, build, and master over 50 projects with MicroPython and the RP2040 microprocessor The Raspberry Pi Pico is a high-performance microcontroller module designed especially for physical computing. Microcontrollers differ from single-board computers, like the Raspberry Pi 4, in not having an operating system. The Raspberry Pi Pico can be programmed to run a single task very efficiently within real-time control and monitoring applications requiring speed. The ‘Pico’ as we call it, is based on the fast, efficient, and low-cost dual-core ARM Cortex-M0+ RP2040 microcontroller chip running at up to 133 MHz and sporting 264 KB of SRAM, and 2 MB of Flash memory. Besides its large memory, the Pico has even more attractive features including a vast number of GPIO pins, and popular interface modules like ADC, SPI, I²C, UART, and PWM. To cap it all, the chip offers fast and accurate timing modules, a hardware debug interface, and an internal temperature sensor. The Raspberry Pi Pico is easily programmed using popular high-level languages such as MicroPython and or C/C++. This book is an introduction to using the Raspberry Pi Pico microcontroller in conjunction with the MicroPython programming language. The Thonny development environment (IDE) is used in all the projects described. There are over 50 working and tested projects in the book, covering the following topics: Installing the MicroPython on Raspberry Pi Pico using a Raspberry Pi or a PC Timer interrupts and external interrupts Analogue-to-digital converter (ADC) projects Using the internal temperature sensor and external temperature sensor chips Datalogging projects PWM, UART, I²C, and SPI projects Using Wi-Fi and apps to communicate with smartphones Using Bluetooth and apps to communicate with smartphones Digital-to-analogue converter (DAC) projects All projects given in the book have been fully tested and are working. Only basic programming and electronics experience is required to follow the projects. Brief descriptions, block diagrams, detailed circuit diagrams, and full MicroPython program listings are given for all projects described. Readers can find the program listings on the Elektor web page created to support the book.
This book is about teaching the Python programming language using the Raspberry Pi 4 computer. The book makes an introduction to Raspberry Pi 4 and then teaches Python with the topics: variables, strings, arrays, matrices, tuples, lists, dictionaries, user functions, flow of control, printing, keyboard input, graphics, GUI, object oriented programming and many more topics.
The book is aimed for beginners, students, practising engineers, hobbyists, and for anyone else who may want to learn to program in Python.
The book includes many example programs and case studies. All the example programs and case studies have been tested fully by the author and are all working. The example programs aim to teach the various programming concepts of Python. The case studies cover the use of Python in the analysis and design of electronic circuits. Some of the case study topics are:
Resistor colour code identification
Resistive potential divider circuits
Resistive attenuator design
Zener diode voltage regulator design
RC and RLC transient circuits
Circuit frequency response
Saving data on external memory stick
Mesh and node circuit analysis using matrices
Resonance in RLC circuits
Transistor Biasing analysis
Transistor amplifier design
Design of active filters
Interfacing hardware with GPIO, I²C and SPI
Using Wi-Fi with Python and TCP/IP and UDP programs
Using Bluetooth from Python
Full program listings of all the programs used in the book are available at the Elektor website of the book. Readers should be able just to copy and use these programs in their Raspberry Pi projects without any modifications.
Praxisnahe Projekte, Profi-Tricks und eigene Anwendungen
Dieses Buch führt Sie Schritt für Schritt in die faszinierende Welt der State Machines ein und zeigt, wie Sie Hardware direkt und effizient ansteuern können – jenseits klassischer CPU-gesteuerter Ansätze.
In diesem Buch lernen Sie:
LEDs und NeoPixel kreativ steuern: Blinken, Dimmen, Farbwechsel und komplexe Animationen
Taster und Encoder zuverlässig auslesen und in Echtzeit in Ihre Projekte integrieren
Analoge Eingänge (ADC) nutzen und Signale digital steuern
Servos präzise ansteuern und Bewegungsabläufe automatisieren
SPI mit PIO umsetzen, um Displays, Sensoren und Module anzusteuern
Menüsysteme und Submenüs auf SPI-Displays realisieren, inklusive Navigation über mehrere Taster
PWM, Signalgenerierung und Frequenzsteuerung für akustische oder visuelle Effekte
Debugging-Strategien und Tipps, um Ihre PIO-Programme effizient zu entwickeln
Alle Beispiele sind praxisnah, sofort umsetzbar und zuverlässig. Mit klaren Anleitungen, Hintergrundwissen und fertigen Codebeispielen lernen Sie, die PIO-Fähigkeiten des Pico maximal zu nutzen – egal ob für Maker-Projekte, Prototypen oder professionelle Anwendungen.
Erleben Sie, wie Sie komplexe Hardwaresteuerung elegant mit dem Pico realisieren können – schneller, flexibler und leistungsfähiger als je zuvor.
Practical Multitasking Fundamentals
Programming embedded systems is difficult because of resource constraints and limited debugging facilities. Why develop your own Real-Time Operating System (RTOS) as well as your application when the proven FreeRTOS software is freely available? Why not start with a validated foundation?
Every software developer knows that you must divide a difficult problem into smaller ones to conquer it. Using separate preemptive tasks and FreeRTOS communication mechanisms, a clean separation of functions is achieved within the entire application. This results in safe and maintainable designs.
Practicing engineers and students alike can use this book and the ESP32 Arduino environment to wade into FreeRTOS concepts at a comfortable pace. The well-organized text enables you to master each concept before starting the next chapter. Practical breadboard experiments and schematics are included to bring the lessons home. Experience is the best teacher.
Each chapter includes exercises to test your knowledge. The coverage of the FreeRTOS Application Programming Interface (API) is complete for the ESP32 Arduino environment. You can apply what you learn to other FreeRTOS environments, including Espressif’s ESP-IDF. The source code is available from GitHub. All of these resources put you in the driver’s seat when it is time to develop your next uber-cool ESP32 project.
What you will learn:
How preemptive scheduling works within FreeRTOS
The Arduino startup “loopTask”
Message queues
FreeRTOS timers and the IDLE task
The semaphore, mutex, and their differences
The mailbox and its application
Real-time task priorities and its effect
Interrupt interaction and use with FreeRTOS
Queue sets
Notifying tasks with events
Event groups
Critical sections
Task local storage
The gatekeeper task
Projects Using Arduino IDE and the LVGL Graphics Library
The ESP32 is probably one of the most popular microcontrollers used by many people, including students, hobbyists, and professional engineers. Its low cost, coupled with rich features makes it a popular device to use in many projects. Recently, a board called the ESP32 Cheap Yellow Display (CYD for short) is available from its manufacturers. The board includes a standard ESP32 microcontroller together with a 320x240 pixel TFT display. Additionally, the board provides several connectors for interfaces such as GPIO, serial port (TX/RX), power and Ground. The inclusion of a TFT display is a real advantage as it enables users to design complex graphics-based projects without resorting to an external LCD or graphics displays.
The book describes the basic hardware of the ESP32 CYD board and provides details of its on-board connectors. Many basic, simple, and intermediate-level projects are given in the book based on the ESP32 CYD, using the highly popular Arduino IDE 2.0 integrated development environment. The use of both the basic graphics functions and the use of the popular LVGL graphics library are discussed in the book and projects are given that use both types of approaches.
All the projects given in the book have been tested and are working. The block diagram, circuit diagram, and the complete program listings and program descriptions of all the projects are given with explanations. Readers can use the LVGL graphics library to design highly popular eye-catching full-color graphics projects using widgets such as buttons, labels, calendars, keypads, keyboards, message boxes, spinboxes, sliders, charts, tables, menus, bars, switches, drop-down lists, animations, and many more widgets.
With Examples for Arduino UNO, Raspberry Pi Pico and ESP32
Programming small electronic systems has never been more accessible. Tasks that once demanded expensive tools, specialized hardware, and deep electrical engineering expertise can now be tackled with low-cost development boards and approachable software. At the centre of this shift is the Arduino environment, which provides a unified and familiar way to program a wide range of microcontroller platforms—from classic AVR boards like the Arduino UNO to modern ARM-based boards such as the Raspberry Pi Pico, and powerful Wi-Fi-enabled devices like the ESP32.
This book introduces embedded programming through the core idea that defines all microcontrollers: reading inputs, processing information, and controlling outputs in a predictable loop. The Arduino environment abstracts much of the hardware complexity, allowing you to focus on behaviour rather than implementation details. With just a few lines of code, you can blink LEDs, read sensors, control motors, and communicate with other devices.
While the Arduino UNO, Raspberry Pi Pico, and ESP32 boards differ greatly in performance and features, they share the same fundamental building blocks: digital and analog I/O, timers, serial communication, PWM, interrupts, and power management. Learning these concepts within the Arduino framework builds skills that transfer easily across platforms and scale toward more advanced applications.
By exploring multiple boards while maintaining a consistent programming approach, this book helps you progress from simple experiments to confidently produce well-structured designs—showing that embedded development can be both practical and enjoyable.
AI Projects for the Raspberry Pi with the AI HAT+
Edge AI is transforming everyday devices by putting intelligence where it matters most: directly inside the hardware. With on-device inference, a camera can recognize a visitor instantly, a phone can translate speech without streaming audio to the cloud, and a wearable can detect anomalies in real time—fast, private, and reliable even when the network disappears.
This book is your practical guide to building exactly those kinds of systems with the Raspberry Pi AI HAT+ and the Hailo-8L accelerator. You’ll start with clear foundations: core AI and machine-learning concepts, how neural networks work, and what truly distinguishes Edge AI from cloud AI—plus an honest look at ethical considerations and future impacts.
Then it’s straight to hands-on physical computing. Step by step, you’ll set up Raspberry Pi OS, power and cooling, and develop in Python using the Thonny IDE. You’ll learn GPIO basics with lights and servos, mount the AI HAT+ hardware, install and verify the Hailo software stack, and connect the right camera—official modules or USB webcams, even multiple cameras.
From your first pipeline to real projects, you’ll run person detection, pose estimation, segmentation, and depth estimation, then level up with YOLO object detection: smart alerts, guest counters, and custom extensions. You’ll even connect vision to motion by combining gesture recognition with servo-driven mechanisms, including a robotic arm.
With troubleshooting tips, hardware essentials, and a practical Python refresher, this book turns Edge AI from buzzword into buildable reality.
Open-Source-Code mit Arduino IDE und PlatformIO
Autonomes Fahren: GPS, Accelerometer, Gyroskop
PS3-Controller
Mikrocontroller wie der Arduino und Einplatinenrechner wie der Raspberry Pi haben sich zu beliebten Komponenten entwickelt. Dritter im Bunde ist der ESP32 der Firma Espressif. Mikrocontroller dieser Baureihe zeichnen sich durch eine Vielzahl implementierter Funktionen aus, die bei einem Arduino konventioneller Prägung mit einem Atmel-AVR-Mikrocontroller erst mit weiterer Hardware möglich sind. Prominentes Beispiel sind hier die WiFi- und Bluetooth-Funktionalitäten. Gegenüber einem Raspberry Pi zeichnen sie sich durch einen deutlich geringeren Preis aus.
Allgemeine Informationen für die Realisierung eines Roboterauto-Projekts mit dem ESP32 sind leicht zu finden. Dabei handelt es sich aber oft nur um Ausführungen zu einem Teilaspekt, ohne inhaltliche oder funktionale Abstimmung. So ist nicht nur die Beschaffung der benötigten Informationen mühselig und zeitaufwändig, sie kann auch außerordentlich fehlerträchtig sein.
Ansatzpunkt dieses Buches ist, diese Lücke zu schließen. Es geht auf verschiedene Möglichkeiten eines Chassis ein, vermittelt nötige Kenntnisse und führt schrittweise von einer einfachen Motorsteuerung zu einem komplexen sensor- und sprachgesteuerten Roboterauto. Hacks rund um GPS und eine PlayStation 3 runden die Sache ab.
Inhalt
Bei der Reihenfolge der Kapitel wurde versucht – beginnend bei der Darstellung von grundlegenden Informationen – über die Lösung einfacher Aufgaben zu etwas anspruchsvolleren Techniken zu führen.
Der Mikrocontroller ESP32
Die Software erstellen
Die Stromversorgung
Rund um die Hardware
Das Chassis
Der Gleichstrommotor
Kabellose Steuerung über WiFi
Mit Sensoren Hindernisse erkennen
Eine eigene Roboterauto-App
Servo und Lichtsensor
GPS
Accelerometer / Gyroskop
PS3-Controller
Roboterauto-App
Hinweis zur Software
Die Dateien haben das Suffix (.cpp). Grund ist die Entwicklung mit PlatformIO. Mit Copy & Paste sollten sie auch in der Arduino-IDE verwendet werden können.
En moins de 100 lignes de code par projet avec les cartes Feather Sense et Clue Express d'Adafruit
Le langage de programmation Python est apprécié par les pédagogues parce que sa syntaxe le rend facile à comprendre. Il s'est également imposé chez les informaticiens expérimentés. La société Adafruit a développé une version spéciale de Python pour l'embarquer sur les microcontrôleurs à 32 bits : CircuitPython.
Ce livre permettra au lecteur de s'initier à la programmation en CircuitPython sur deux cartes : Feather BlueFruit Sense (également appelée Feather nRF52840 Sense) et CLUE nRF52840 Express. Chacune est animée par le SoC nRF52840 de NORDIC avec une architecture à 32 bits.
Pour ce voyage dans le monde de la programmation embarquée, l'auteur sort du chemin classique, à savoir un cours complet sur la programmation orientée objet appliquée à ce langage. Il préfère emmener le lecteur directement sur le terrain avec des projets qui mettent en oeuvre les cartes et différents périphériques. Plus d'une quarantaine d'exemples et de montages permettent de découvrir la richesse de CircuitPython. Toutefois l'auteur s'est imposé une limite pour ne pas décourager les novices : le code de chaque projet ne dépasse jamais la centaine de lignes. Pour ce qui est du matériel, là aussi la simplicité domine : aucun programmateur, un simple PC suffit ; aucun soudage grâce au câblage sur platine d'essai. Les cartes d'extension FeatherWing à enficher sur la Feather nRF52840 Sense permettent de démultiplier ses fonctions : matrice de LED, enregistreur de données, écran à encre électronique, écran OLED, écran TFT, commande de moteurs, audio, relais…
Toutes les étapes (assemblage des différents composants, installation des bibliothèques requises, programmation, tests…) sont expliquées en détail. Le code des différents exemples et projets est disponible sur Github. Le résultat de chaque projet est même présenté sur de courtes vidéos disponibles sur YouTube.
À la fin de sa lecture, le nouveau Pythonien pourra facilement approfondir les notions abordées et donner vie à ses propres projets grâce aux outils qu'il aura essayés.
Ce livre s'adresse aux lycéens et étudiants ainsi qu'à toute la communauté des makers.
Chaîne YouTube de l'auteur :
YouTube (Michaël Bottin)
This book details the use of the Arduino Uno and the Raspberry Pi 4 in practical CAN bus based projects. Using either the Arduino Uno or the Raspberry Pi with off-the-shelf CAN bus interface modules considerably ease developing, debugging, and testing CAN bus based projects.
This book is written for students, practicing engineers, enthusiasts, and for everyone else wanting to learn more about the CAN bus and its applications. The book assumes that the reader has some knowledge of basic electronics. Knowledge of the C and Python programming languages and programming the Arduino Uno using its IDE and Raspberry Pi will be useful, especially if the reader intends to develop microcontroller-based projects using the CAN bus.
The book should be a useful source of reference material for anyone interested in finding answers to questions such as:
What bus systems are available for the automotive industry?
What are the principles of the CAN bus?
How can I create a physical CAN bus?
What types of frames (or data packets) are available in a CAN bus system?
How can errors be detected in a CAN bus system and how dependable is a CAN bus system?
What types of CAN bus controllers exist?
How do I use the MCP2515 CAN bus controller?
How do I create 2-node Arduino Uno-based CAN bus projects?
How do I create 3-node Arduino Uno-based CAN bus projects?
How do I set the acceptance masks and acceptance filters?
How do I analyze data on the CAN bus?
How do I create 2-node Raspberry Pi-based CAN bus projects?
How do I create 3-node Raspberry Pi-based CAN bus projects?
En moins de 100 lignes de code par projet avec les cartes Feather Sense et Clue Express d'Adafruit
Le langage de programmation Python est apprécié par les pédagogues parce que sa syntaxe le rend facile à comprendre. Il s'est également imposé chez les informaticiens expérimentés. La société Adafruit a développé une version spéciale de Python pour l'embarquer sur les microcontrôleurs à 32 bits : CircuitPython.
Ce livre permettra au lecteur de s'initier à la programmation en CircuitPython sur deux cartes : Feather BlueFruit Sense (également appelée Feather nRF52840 Sense) et CLUE nRF52840 Express. Chacune est animée par le SoC nRF52840 de NORDIC avec une architecture à 32 bits.
Pour ce voyage dans le monde de la programmation embarquée, l'auteur sort du chemin classique, à savoir un cours complet sur la programmation orientée objet appliquée à ce langage. Il préfère emmener le lecteur directement sur le terrain avec des projets qui mettent en oeuvre les cartes et différents périphériques. Plus d'une quarantaine d'exemples et de montages permettent de découvrir la richesse de CircuitPython. Toutefois l'auteur s'est imposé une limite pour ne pas décourager les novices : le code de chaque projet ne dépasse jamais la centaine de lignes. Pour ce qui est du matériel, là aussi la simplicité domine : aucun programmateur, un simple PC suffit ; aucun soudage grâce au câblage sur platine d'essai. Les cartes d'extension FeatherWing à enficher sur la Feather nRF52840 Sense permettent de démultiplier ses fonctions : matrice de LED, enregistreur de données, écran à encre électronique, écran OLED, écran TFT, commande de moteurs, audio, relais…
Toutes les étapes (assemblage des différents composants, installation des bibliothèques requises, programmation, tests…) sont expliquées en détail. Le code des différents exemples et projets est disponible sur Github. Le résultat de chaque projet est même présenté sur de courtes vidéos disponibles sur YouTube.
À la fin de sa lecture, le nouveau Pythonien pourra facilement approfondir les notions abordées et donner vie à ses propres projets grâce aux outils qu'il aura essayés.
Ce livre s'adresse aux lycéens et étudiants ainsi qu'à toute la communauté des makers.
Chaîne YouTube de l'auteur :
YouTube (Michaël Bottin)