Practical Projects and Programs
With Experimenting with Red Pitaya STEMlab Gen 2, Red Pitaya goes beyond a versatile board. It becomes a powerful laboratory instrument for precision measurement, analysis, and control.
From the fundamentals of electronic project development, monitoring, control, and design to testing, this book walks you step-by-step through everything you need to know to harness the full potential of Red Pitaya hardware and software.
The book presents real-time, FPGA-based projects that are developed on a PC using the Vivado environment, then transferred to the Red Pitaya for execution and testing.
You will learn about enhanced performance, expanded I/O capabilities, improved FPGA features, and advanced connectivity options that open up new frontiers for precision measurement, monitoring, and control in your embedded applications.
Inside the book you will discover:
A deep dive into Red Pitaya architecture and hardware design
Electronic experiments using Red Pitaya for measurement and monitoring
Hands-on projects using the Python programming language
Practical guidance for FPGA programming using Red Pitaya
Red Pitaya FPGA projects using the Verilog HDL under Vivado IDE
Practical design of electronic projects including measurement and testing
Step-by-step examples that bridge theory and real-world implementation
Whether you are designing your own electronic circuits, developing signal analysis tools, or creating real-time control or monitoring systems, this book provides you the knowledge and confidence you need to fully learn and customize the Red Pitaya platform.
From Rubbing Amber to Swiping Glass
"The story of electricity, told one connection at a time."Why does rubbing amber attract dust? How did we go from that curious effect to a world where screens respond to a single touch? And how did we get from mysterious sparks to tiny chips packed with billions of transistors?
For centuries, electricity puzzled and fascinated those who encountered its curious effects—long before it even had a name. From the earliest observations of static charge to the complex electronics that shape our lives today, this book traces the gradual, and often surprising, story of how humanity came to understand and harness this powerful force.
This book offers an engaging and accessible account of the people, ideas, and inventions that transformed electricity from a scientific curiosity into the foundation of our digital age. Along the way, you’ll meet a host of inquisitive minds—some famous, others less so—whose persistence and creativity helped unravel the mysteries of the natural world and gave rise to the technologies we now take for granted.
Covering everything from Leyden jars and batteries to transistors, microcontrollers and the internet, this book presents a clear and enjoyable overview of electronics and its relatively short, yet rich, history.
Whether you have a technical background or simply a curiosity about how things work, From Rubbing Amber to Swiping Glass offers a thoughtful look at how far we’ve come—and a gentle nudge to wonder what might come next.
1-Wire ist die Bezeichnung für eine serielle Schnittstelle, die mit nur einer Datenader auskommt. Es ist ein Master-Multi-Slave-Kommunikationsprotokoll. Verfügbar sind integrierte Bausteine zur Temperaturmessung, Akkuüberwachung, Echtzeituhr und beispielsweise Hotelschließanlagen. Eine Besonderheit von 1-Wire-Geräten ist die Spannungsversorgung aus der Gegenstation, hierbei erfolgt die Versorgung der Slaves über die Datenleitung.
Der Leser erhält mit „Das 1-Wire-Praxisbuch“ eine umfassende Einführung in die 1-Wire-Technologie. Das Buch zeigt anhand praktischer Projekte zum Nachbauen, wie man verschiedene verfügbare 1-Wire-Chips in eigene Mikrocontroller-gesteuerte Anwendungen integrieren kann, und zwar mit Assembler-Software-Implementierungen für PIC-Mikrocontroller und mit Sketches für den Arduino.
Die 1-Wire-Technik kommt in dem Buch praxisnah bei einem elektronischen Schloss zum Einsatz, das von einem PIC-Mikrocontroller gesteuert wird. Ein weiteres Praxisprojekt erläutert Schritt für Schritt, wie beispielsweise eine ständige Temperaturmessung mit 1-Wire-Bausteinen möglich ist.
Program, build, and master 60+ projects with the Wireless RP2040
The Raspberry Pi Pico and Pico W are 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 spacious memory, the Pico and Pico W offer many GPIO pins, and popular peripheral interface modules like ADC, SPI, I²C, UART, PWM, timing modules, a hardware debug interface, and an internal temperature sensor.
The Raspberry Pi Pico W additionally includes an on-board Infineon CYW43439 Bluetooth and Wi-Fi chipset. At the time of writing this book, the Bluetooth firmware was not yet available. Wi-Fi is however fully supported at 2.4 GHz using the 802.11b/g/n protocols.
This book is an introduction to using the Raspberry Pi Pico W in conjunction with the MicroPython programming language. The Thonny development environment (IDE) is used in all of the 60+ working and tested projects 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 sensor chips
Using the internal temperature sensor and external temperature sensor chips
Datalogging projects
PWM, UART, I²C, and SPI projects
Using Bluetooth, WiFi, and apps to communicate with smartphones
Digital-to-analogue converter (DAC) projects
All projects are tried & tested. They can be implemented on both the Raspberry Pi Pico and Raspberry Pi Pico W, although the Wi-Fi-based subjects will run on the Pico W only. Basic programming and electronics experience are required to follow the projects. Brief descriptions, block diagrams, detailed circuit diagrams, and full MicroPython program listings are given for all projects.
Datenbankmodelle und -software für Elektronikanwendungen
Mit seiner Energieeffizienz und seinem reichen Spektrum an quelloffener Software eignet sich der Einplatinencomputer Raspberry Pi auch für die Speicherung von Daten und deren grafische Aufbereitung lokal oder im World Wide Web (WWW).
Dieses Buch stellt verschiedene Datenbankmodelle und diverse Datenbanksoftware vor:
SQL: MariaDB, SQLite
InfluxDB: Telegraf
Grafana
MQTT
Verschlüsselung mit RPi
Apache
PHP
Node RED
Docker
Es zeigt darüber hinaus ausgewählte Ansätze, gespeicherte Daten anzuzeigen und zu verwalten. Ein eigener Abschnitt ist sowohl der SSL-Verschlüsselung der Verbindung als auch dem Betrieb von Servern im WWW gewidmet.
Das Buch richtet sich an alle,
die neugierig sind und gerne die Möglichkeiten des Raspberry Pi ausloten möchten,
die einen Einstieg in das Datenmanagement mit Datenbanken suchen,
die mit einfachen Mitteln schnell loslegen möchten,
die Alternativen aufgezeigt bekommen möchten,
die in komprimierter Form Tipps für eigene Entwicklungen suchen,
die Freude am eigenen Entwickeln und Realisieren haben.
Programmierkenntnisse und -erfahrungen sind für die Installation der Software nicht erforderlich. Jeder einzelne Schritt wird detailliert beschrieben und mit Screenshots visuell unterlegt.
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.
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.
Create Models for 3D Printing, CNC Milling, Process Communication and Documentation
Engineers dread designing 3D models using traditional modeling software. OpenSCAD takes a refreshing and completely different approach. Create your models by arranging geometric solids in a JavaScript-like language, and use them with your 3D printer, CNC mill, or process communication.
OpenSCAD differs from other design systems in that it uses programmatical modeling. Your model is made up of primitives that are invoked using a C-, Java- or Python-like language. This approach to model design is close to the “mechanical work” done in the real world and appeals to engineers and others who are not a member of the traditional creative class.
OpenSCAD also provides a wide variety of comfort functions that break the 1:1 relationship between code and geometry. This book demonstrates the various features of the programming language using practical examples such as a replacement knob for a LeCroy oscilloscope, a wardrobe hanger, a container for soap dispensers, and various other real-life examples.
Written by an engineer with over 15 years of experience, this book is intended for Linux and Windows users alike. If you have programming experience in any language, this book will have you producing practical three-dimensional objects in short order!
Develop your own custom home automation devices
Espressif's ESP8266 and ESP32 microcontrollers have brought DIY home automation to the masses. However, not everyone is fluent in programming these microcontrollers with Espressif's C/C++ SDK, the Arduino core, or MicroPython. This is where ESPHome comes into its own: with this project, you don’t program your microcontroller but configure it.
This book demonstrates how to create your own home automation devices with ESPHome on an ESP32 microcontroller board. You’ll learn how to combine all kinds of electronic components and automate complex behaviours. Your devices can work completely autonomously, and connect over Wi-Fi to your home automation gateways such as Home Assistant or MQTT broker.
By the end of this book, you will be able to create your own custom home automation devices the way you want. Thanks to ESPHome and the ESP32, this is within everyone’s grasp.
Set up an ESPHome development environment and create maintainable configurations
Use buttons and LEDs
Sound a buzzer and play melodies
Read measurements from various types of sensors
Communicate over a short distance with NFC, infrared light, and Bluetooth Low Energy
Show information on various types of displays
Downloads
Software
Most people are increasingly confronted with the applications of Artificial Intelligence (AI). Music or video ratings, navigation systems, shopping advice, etc. are based on methods that can be attributed to this field.
The term Artificial Intelligence was coined in 1956 at an international conference known as the Dartmouth Summer Research Project. One basic approach was to model the functioning of the human brain and to construct advanced computer systems based on this. Soon it should be clear how the human mind works. Transferring it to a machine was considered only a small step. This notion proved to be a bit too optimistic. Nevertheless, the progress of modern AI, or rather its subspecialty called Machine Learning (ML), can no longer be denied.
In this book, several different systems will be used to get to know the methods of machine learning in more detail. In addition to the PC, both the Raspberry Pi and the Maixduino will demonstrate their capabilities in the individual projects. In addition to applications such as object and facial recognition, practical systems such as bottle detectors, person counters, or a “talking eye” will also be created.
The latter is capable of acoustically describing objects or faces that are detected automatically. For example, if a vehicle is in the field of view of the connected camera, the information 'I see a car!' is output via electronically generated speech. Such devices are highly interesting examples of how, for example, blind or severely visually impaired people can also benefit from AI systems.
Die Programmiersprache „Python“ hat in den letzten Jahren einen enormen Aufschwung erlebt. Nicht zuletzt haben verschiedene Einplatinensysteme wie der Raspberry Pi zu deren Bekanntheitsgrad beigetragen. Aber auch in anderen Gebieten, wie der Künstlichen Intelligenz oder dem Machine Learning, hat Python weite Verbreitung gefunden. Es ist daher naheliegend, Python bzw. die Variante „MicroPython“ auch für den Einsatz in SoCs (Systems on Chip) zu verwenden.
Leistungsfähige Controller wie der ESP32 der Firma Espressif Systems bieten eine hervorragende Performance sowie Wi-Fi- und Bluetooth-Funktionalität zu einem günstigen Preis. Mit diesen Eigenschaften wurde die Maker-Szene im Sturm erobert. Im Vergleich zu anderen Controllern weist der ESP32 einen deutlich größeren Flash und SRAM-Speicher, sowie eine wesentlich höhere CPU-Geschwindigkeit auf. Aufgrund dieser Leistungsmerkmale eignet sich der Chip nicht nur für klassische C-Anwendungen, sondern insbesondere auch für die Programmierung mit MicroPython.
Das vorliegende Buch führt in die Anwendung der modernen Ein-Chip-Systeme ein. Neben den technischen Hintergründen steht vor allem MicroPython selbst im Vordergrund. Nach der Einführung in die Sprache werden die erlernten Programmierkenntnisse umgehend in die Praxis umgesetzt. Die einzelnen Projekte sind sowohl für den Einsatz im Labor als auch für Alltagsanwendungen geeignet. Neben dem eigentlichen Lerneffekt steht also auch die Freude am Aufbau kompletter und nützlicher Geräte im Vordergrund. Durch die Verwendung von Laborsteckboards können Schaltungen aller Art mit geringem Aufwand realisiert werden, sodass das Austesten der selbstgebauten Geräte zum lehrreichen Vergnügen wird.
Durch die verschiedenen Anwendungen wie Wetterstationen, Digitalvoltmeter, Ultraschall-Entfernungsmesser, RFID-Kartenleser oder Funktionsgeneratoren sind die vorgestellten Projekte auch für Praktika oder Fach- und Studienarbeiten in den Naturwissenschaften bzw. im Natur- und Technikunterricht bestens geeignet.
Mehr als 50 Grundlagenprojekte mit MicroPython und dem RP2040-Mikrocontroller
Der Raspberry Pi Pico ist eine leistungsstarke Mikrocontroller-Platine, die speziell für das Physical Computing – also hardwarenahe Anwendungen – entwickelt wurde. Der Raspberry Pi Pico kann so programmiert werden, dass er eine einzelne Aufgabe sehr effizient ausführt und ermöglicht so schnelle Steuerungs- und Überwachungsanwendungen in Echtzeit. Der 'Pico', wie wir ihn nennen, basiert auf dem schnellen, effizienten und kostengünstigen Dual-Core ARM Cortex-M0+ RP2040 Mikrocontroller-Chip, der mit bis zu 133 MHz läuft und über 264 KB SRAM und 2 MB Flash-Speicher verfügt. Neben dem großen Speicher hat der Pico noch weitere attraktive Eigenschaften, darunter eine große Anzahl von GPIO-Pins sowie gängige Schnittstellen wie ADC, SPI, I²C, UART und PWM. Als Krönung bietet der Chip schnelle und genaue Timer, eine Hardware-Debug-Schnittstelle und einen internen Temperatursensor.
Zur Programmierung lassen sich leicht die gängigen Hochsprachen wie MicroPython oder C/C++ verwenden. Dieses Buch ist eine Einführung in die Verwendung des Pico mit der Programmiersprache MicroPython. In allen Projekten wird die Thonny-Entwicklungsumgebung (IDE) eingesetzt. Über 50 Projekte decken folgende Themen ab:
Installation von MicroPython auf dem Raspberry Pi Pico
Timer-Interrupts und externe Interrupts
Projekte mit Analog-Digital-Wandler (ADC)
Verwendung des internen sowie externer Temperatursensoren
Datenlogger
Projekte zur PWM, UART, I²C-Bus und SPI-Bus
Wi-Fi und Bluetooth für die Kommunikation mit Smartphones
Projekte mit dem Digital-Analog-Wandler (DAC)
Alle in diesem Buch vorgestellten Projekte wurden vollständig getestet und sind funktionsfähig. Es werden keine Programmier- oder Elektronikkenntnisse vorausgesetzt, um sie nachzuvollziehen. Für alle beschriebenen Projekte gibt es kurze Beschreibungen, Blockdiagramme, detaillierte Schaltpläne und vollständige MicroPython-Programmlistings. Die Listings sind auch auf der zum Buch gehörenden Elektor-Webseite zu finden.