Learning Embedded Systems with STM32 Nucleo Boards
Embedded programming has become more accessible than ever before. Development boards are inexpensive, software tools are easy to install, and the Arduino IDE provides a familiar environment for creating embedded applications. Combined with the STM32 Nucleo family of development boards, it offers an excellent platform for learning how modern microcontrollers interact with the physical world.
This book introduces embedded programming using the Arduino environment on STM32 Nucleo boards. You will learn how a microcontroller continuously reads inputs, processes information, and controls outputs in a predictable real-time loop. Through practical examples, you will discover how to control LEDs, read switches and sensors, generate PWM signals, drive motors, and exchange data with other devices, all while becoming familiar with the capabilities of STM32 microcontrollers.
Although the STM32 family includes devices with different performance levels, memory sizes, and peripheral sets, they all share the same architectural concepts. Digital and analog I/O, timers, interrupts, PWM, communication interfaces, and low-power operation are fundamental features found throughout the STM32 ecosystem. Understanding these building blocks will enable you to work confidently with a wide range of STM32 devices, from entry-level microcontrollers to more advanced applications.
By focusing on practical programming techniques rather than hardware complexity, this book develops skills that remain useful well beyond the examples presented. Whether you are taking your first steps in embedded systems or expanding your experience with STM32 microcontrollers, you will gain a solid understanding of both the Arduino development environment and the principles that underpin embedded software design.
The Arduino Uno is an open-source microcontroller development system encompassing hardware, an Integrated Development Environment (IDE), and a vast number of libraries. It is supported by an enormous community of programmers, electronic engineers, enthusiasts, and academics. The libraries in particular really smooth Arduino programming and reduce programming time. What’s more, the libraries greatly facilitate testing your programs since most come fully tested and working.
The Raspberry Pi 4 can be used in many applications such as audio and video media devices. It also works in industrial controllers, robotics, games, and in many domestic and commercial applications. The Raspberry Pi 4 also offers Wi-Fi and Bluetooth capability which makes it great for remote and Internet-based control and monitoring applications.
This book is about using both the Raspberry Pi 4 and the Arduino Uno in PID-based automatic control applications. The book starts with basic theory of the control systems and feedback control. Working and tested projects are given for controlling real-life systems using PID controllers. The open-loop step time response, tuning the PID parameters, and the closed-loop time response of the developed systems are discussed together with the block diagrams, circuit diagrams, PID controller algorithms, and the full program listings for both the Raspberry Pi and the Arduino Uno.
The projects given in the book aim to teach the theory and applications of PID controllers and can be modified easily as desired for other applications. The projects given for the Raspberry Pi 4 should work with all other models of Raspberry Pi family.
The book covers the following topics:
Open-loop and closed-loop control systems
Analog and digital sensors
Transfer functions and continuous-time systems
First-order and second-order system time responses
Discrete-time digital systems
Continuous-time PID controllers
Discrete-time PID controllers
ON-OFF temperature control with Raspberry Pi and Arduino Uno
PID-based temperature control with Raspberry Pi and Arduino Uno
PID-based DC motor control with Raspberry Pi and Arduino Uno
PID-based water level control with Raspberry Pi and Arduino Uno
PID-based LED-LDR brightness control with Raspberry Pi and Arduino Uno
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.
Deze bundel bevat de Red Pitaya STEMlab 125-14 PRO Gen 2 Starter Kit en het nieuwe boek "Experimenteren met Red Pitaya STEMlab Gen 2".
De Red Pitaya STEMlab 125-14 PRO Gen 2 Starter Kit is een krachtig en flexibel platform voor signaalverwerking, data-acquisitie en elektronische meettoepassingen. Deze kit is ontworpen voor ingenieurs, ontwikkelaars, onderzoekers en docenten en biedt alles wat nodig is om te beginnen met het bouwen van geavanceerde meet- en besturingssystemen.
De kern van de kit wordt gevormd door het STEMlab 125-14 PRO Gen 2-bord, een geüpgradede en ultralichte ontwikkeling. Aangedreven door de Xilinx Zynq-7010 SoC met 512 MB RAM, combineert het de programmeerbaarheid van een FPGA met de verwerkingskracht van een ARM-processor om hoogwaardige instrumentatie en aangepaste signaalverwerkingsoplossingen mogelijk te maken.
Het bord biedt een 14-bits ADC- en DAC-resolutie, een bemonsteringsfrequentie van 125 MS/s, een ingangsbereik van ±20 V en een bandbreedte tot 60 MHz. Dankzij de verbeterde ruisarme analoge front-end, USB-C-connectiviteit en het compacte ontwerp is het geschikt voor veeleisende toepassingen zoals RF-ontwikkeling, radarsystemen, fotonica-onderzoek, softwaregedefinieerde radio (SDR) en industriële automatisering.
De Starter Kit bevat alle essentiële accessoires voor onmiddellijk gebruik: een microSD-kaart met vooraf geïnstalleerd besturingssysteem, voeding, ethernetkabel voor toegang op afstand, twee 100 MHz-oscilloscoopprobes en SMA-naar-BNC-adapters voor flexibele signaalaansluitingen.
De Red Pitaya STEMlab 125-14 PRO Gen 2 Starter Kit is een uitstekend platform voor rapid prototyping, FPGA-ontwikkeling, meetinstrumentatie en geavanceerde elektronica-experimenten.
Kenmerken
14-bits ADC- en DAC-resolutie
125 MS/s samplingfrequentie
±20 V ingangsbereik
Tot 60 MHz bandbreedte
Xilinx Zynq-7010 SoC (FPGA + ARM-processor)
512 MB RAM
Ruisarme analoge front- en back-ends
Toepassingen
RF-ontwikkeling en -testen
Radar- en draadloze systemen
Software Defined Radio (SDR)
Fotonica en optisch onderzoek
Industriële automatisering en besturingssystemen
Signaalanalyse en instrumentatie
Snel prototypen van elektronische meetsystemen
Specificaties
Processor
Dual-core ARM Cortex-A9
FPGA
AMD Xilinx Zynq-7010 SoC
RAM
512 MB (4 Gb)
Opslag
microSD-kaart (tot 32 GB)
Besturingssysteem
Linux-gebaseerd Red Pitaya OS
ADC-resolutie
14-bits
DAC Resolutie
14-bits
Bandbreedte
60 MHz (DC)
Sampling rate
125 MS/s
Analoge ingangskanalen
2
Analoge uitgangskanalen
2
Ingangsspanningsbereik
±1 V (LV) / ±20 V (HV)
Ingangsimpedantie
1 MΩ / 10 pF
Uitgangsspanningsbereik
±1 V
Ethernet
1x Gigabit Ethernet (RJ45)
USB
2x USB-C 2.0 (voor voeding en console)
Digitale I/O
16x GPIO (3,3 V)
Communicatie-interfaces
I²C, SPI, UART, CAN
Voeding
5 V/3 A via USB-C
Afmetingen
106,8 x 60,0 x 17,9 mm
Inbegrepen
1x Red Pitaya STEMlab 125-14 PRO Gen 2 Board
2x 100 MHz oscilloscoopprobes
2x SMA-naar-BNC-adapters
1x microSD-kaart met voorgeïnstalleerd besturingssysteem
1x USB-C-voeding
1x Ethernetkabel
Downloads
Documentation
Schematics
Book: Experimenting with Red Pitaya STEMlab Gen 2
Met dit nieuwe boek gaat Red Pitaya verder dan een veelzijdig board. Het wordt een krachtig laboratoriuminstrument voor nauwkeurige metingen, analyse en besturing.
Van de basisprincipes van elektronische projectontwikkeling, monitoring, besturing en ontwerp tot testen: dit boek begeleidt u stap voor stap door alles wat u moet weten om het volledige potentieel van de Red Pitaya-hardware en -software te benutten.
Het boek presenteert real-time, FPGA-gebaseerde projecten die op een PC worden ontwikkeld met de Vivado-omgeving en vervolgens naar de Red Pitaya worden overgebracht voor uitvoering en testen.
U leert over verbeterde prestaties, uitgebreide I/O-mogelijkheden, verbeterde FPGA-functionaliteiten en geavanceerde connectiviteitsopties die nieuwe mogelijkheden openen voor nauwkeurige metingen, monitoring en besturing in uw embedded toepassingen.
In dit boek ontdekt u:
Een diepgaande verkenning van de Red Pitaya-architectuur en het hardwareontwerp
Elektronische experimenten met Red Pitaya voor meting en monitoring
Praktische projecten met de programmeertaal Python
Praktische richtlijnen voor FPGA-programmering met Red Pitaya
Red Pitaya FPGA-projecten met Verilog HDL in de Vivado IDE
Praktisch ontwerp van elektronische projecten inclusief meting en testen
Stapsgewijze voorbeelden die theorie en praktijk met elkaar verbinden
Of u nu uw eigen elektronische schakelingen ontwerpt, tools voor signaalanalyse ontwikkelt of real-time besturings- of monitoringssystemen creëert, dit boek biedt u de kennis en het vertrouwen om het Red Pitaya-platform volledig te leren kennen en aan te passen.
Projecten met Arduino, ESPHome, Home Assistant en Raspberry Pi & Co.
Dit e-book bevat verschillende voorbeeldprojecten, te beginnen met een inleiding tot elektronica. Het legt ook uit hoe je Home Assistant installeert op een Raspberry Pi, hoe je binnenklimaatsensoren gebruikt voor temperatuur en vochtigheid, hoe je het MQTT-protocol en andere interfaces implementeert, en hoe je ESPHome gebruikt om sensoren en actuatoren te integreren in Home Assistant. Talrijke video tutorials vullen het boek aan.
The book begins with an introduction to electrical engineering. You will learn the basics of voltage, current, resistors, diodes and transistors.
Arduino and microcontrollers
A complete section is dedicated to the Arduino Uno. You will get to know the structure, write your first programs and work on practical examples.
Home Assistant and automation
You will learn how to set up Home Assistant on a Raspberry Pi and how to use automations, scenes and devices. In addition, Zigbee, MQTT and ESP-NOW – important technologies for home automation – will be discussed.
ESP8266, ESP32 and ESP32-CAM
The popular ESP microcontrollers are covered in detail. A theoretical introduction is followed by practical projects that show you how to get the most out of these devices.
Sensors and actuators
The book explains the functionality and application of numerous sensors such as temperature and humidity sensors, motion detectors and RFID readers. For actuators, stepper motors, e-ink displays, servo motors and much more are covered. There are practical application examples for all devices.
ESPHome
This chapter shows you how to integrate sensors and actuators into Home Assistant without any programming effort. You will be guided step by step through the setup with ESPHome.
LEDs and lighting technology
In this chapter, you will learn about different types of LEDs and how they can be used. The basics of lighting technology are also explained.
Node-RED
A whole chapter is dedicated to Node-RED. You will learn the basics of this powerful tool and be guided step by step through its setup and use.
Integrated Circuits (ICs)
In electronics, there are numerous ICs that make our lives easier. You will get to know the most important ones and apply your knowledge in practical projects.
Professional programming
Advanced topics such as the correct use of buttons, the use of interrupts and the use of an NTP server for time synchronisation are covered in detail in this chapter.
Downloads
GitHub
Vom Messwert zur stabilen Entscheidung
Wie wird aus einem einfachen Mikrocontroller ein intelligentes System, das Sensorwerte erfasst, verarbeitet und sinnvoll darauf reagiert? Dieses Buch zeigt es Ihnen Schritt für Schritt – verständlich, praxisnah und ohne unnötige Vorkenntnisse.
Sie beginnen mit den Grundlagen der digitalen und analogen Ein- und Ausgänge. Anschließend lernen Sie, wie Sensorwerte gelesen, geglättet und zuverlässig bewertet werden. Anschauliche Beispiele erklären, warum einzelne Messwerte oft täuschen können und wie Mittelwertbildung, Hysterese und einfache Entscheidungsregeln für stabile Ergebnisse sorgen. Nach und nach erweitern Sie Ihre Projekte um Displays, I²C-Kommunikation und mehrere vernetzte Mikrocontroller. So entstehen verteilte Systeme, in denen Raspberry Pi Pico und ATtiny-Controller Daten austauschen und gemeinsam Aufgaben übernehmen.
Im fortgeschrittenen Teil erhalten Sie einen leicht verständlichen Einstieg in Merkmalsbildung, Datenvorverarbeitung, hybride Entscheidungsmodelle und TinyML-nahe Anwendungen. Dabei verbinden Sie klassische Regelungstechnik mit modernen datenbasierten Methoden.
Alle Projekte werden von ausführlich kommentierten Programmen in C und MicroPython begleitet. Das Buch richtet sich an Einsteiger, Maker, Studierende und alle, die Embedded-Systeme von Grund auf verstehen möchten.
Am Ende können Sie eigene Systeme entwickeln, die nicht nur messen, sondern Informationen auswerten, zuverlässige Entscheidungen treffen und gezielt reagieren.
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.
USB-Logikanalysatoren am PC mit Arduino, Raspberry Pi und Co
Schritt-für-Schritt-Anleitungen führen Sie in die Analyse moderner Protokolle von I²C, SPI, UART, RS-232, NeoPixel, WS28xx, HD44780 und 1-Wire ein. Anhand von zahlreichen Experimentierschaltungen mit dem Raspberry Pi Pico, Arduino Uno und dem Bus Pirate üben Sie die praxisnahe Anwendung gängiger USB-Logikanalysatoren ein.
Alle in diesem Buch vorgestellten Experimentierschaltungen wurden vollständig getestet und sind funktionsfähig. Die notwendigen Programmlistings sind enthalten, es sind keine besonderen Programmier- oder Elektronikkenntnisse für diese Schaltungen notwendig. Es werden die Programmiersprachen MicroPython und C mit den Entwicklungsumgebungen Thonny und Arduino IDE eingesetzt.
Dieses Buch verwendet mehrere Modelle flexibler und weit verbreiteter USB-Logikanalysatoren und zeigt die Stärken und Schwächen jeder Preisklasse. Sie werden kennenlernen, welche Kriterien für Ihre Arbeit wichtig sind und in der Lage sein, das für Sie passende Gerät zu finden.
Egal ob Arduino, Raspberry Pi oder Raspberry Pi Pico: Die abgebildeten Beispielschaltungen ermöglichen einen schnellen Start in die Protokollanalyse und können auch als Grundlage für eigene weitere Experimente dienen.
Sie werden alle wichtigen Begriffe und Zusammenhänge kennenlernen, eigene Experimente durchführen, selbstständig Protokolle analysieren und nach der Lektüre dieses Buches – im Bereich der digitalen Signale und Protokolle – ein umfassendes Wissen aufgebaut haben.
Pfiffige Lösungen mit Arduino Pro Mini und ATmega328-Boards
Mit einem einfachen Arduino Pro Mini Board und ein paar weiteren Bauteilen lassen sich heute für wenig Geld Projekte realisieren, die vor 20 oder 30 Jahren noch undenkbar waren oder ein kleines Vermögen gekostet hätten. Von einfachen LED-Effekten bis zur Ladestation – die den Akku auf Herz und Nieren prüft – ist in diesem Buch vieles dabei.
Als Mikrocontroller dient bei allen beschriebenen Projekten der ATmega328, der mit seinen 20 Ein- und Ausgangsleitungen unzählige Möglichkeiten zum Messen, Schalten und Steuern bietet. Mit einem 7-Segment-Display und ein paar Widerständen lässt sich daraus z. B. ein Voltmeter bauen oder mittels NTC ein Thermometer. Die Arduino-Plattform bietet dabei die perfekte Entwicklungsumgebung zum Programmieren der Boards.
Neben den ganz konkreten Projekten soll das Buch aber auch das nötige Wissen vermitteln, um eigene Ideen zu realisieren. Wie misst man was? Welches ist der geeignete Transistor, um verschiedene Verbraucher zu schalten? Wann ist man mit einem IC besser bedient, oder wie schaltet man Netzspannung? Auch batteriebetriebene Projekte mit LilyPad sind ausführlich thematisiert. Ebenso vielerlei Motoren, vom einfachen Gleichstrommotor bis zum Schrittmotor.
Sensoren sind ein weiteres spannendes Thema. Nur zwei Beispiele: Mit einem winzigen Bauteil lässt sich tatsächlich messen, dass der Luftdruck am Fußboden höher ist als auf Tischhöhe. Mit einem simplen Infrarot-Empfänger kann man ausgedienten Fernbedienungen ein zweites Leben schenken und die Wohnung damit steuern.
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.
Design IoT Projects with Raspberry Pi, Arduino and ESP32 The Internet of Things (IoT) is becoming a major application area for embedded systems. As a result, more and more people are becoming interested in learning about embedded design and programming. Technical colleges and universities are moving away from legacy 8 and 16-bit microcontrollers and are introducing 32-bit embedded microcontrollers to their curriculums. Many IoT applications demand precision, high processing power, and low power consumption. Produced by IBM, Node-RED is an open-source visual editor for wiring the Internet of Things. Node-RED comes with a large number of nodes to handle a multitude of tasks. The required nodes are selected and joined together to perform a particular task. Node-RED is based on flow type programming where nodes are configured and joined together to form an application program. There are nodes for performing complex tasks, including web access, Twitter, E-mail, HTTP, Bluetooth, MQTT, controlling GPIO ports, etc. One particularly nice aspect of Node-RED is that the programmer does not need to learn how to write complex programs. For example, an email can be sent by simply joining nodes together and writing only a few lines of code. The aim of this book is to teach how Node-RED can be used in projects. The main hardware platform used with most of the projects in this book is Raspberry Pi 4. Chapters are included to show how Node-RED can be also be used with Arduino Uno, ESP32 DevKitC, and the ESP8266 NodeMCU microcontroller development boards.