Mikrocontroller haben sich in den letzten Jahren in praktisch allen Bereichen der modernen Technik etabliert. In zunehmendem Maße dringen sie auch in die Gebiete der Künstlichen Intelligenz und der Robotertechnik vor. Das vorliegende Buch gibt eine umfassende Einführung in die Welt der Controller-Technik mit all ihren Facetten, von der einfachen Steuerung über die Sensor-Technik bis hin zur Datenübertragung in das Internet.
Als Basis dafür dient das von Elektor entwickelte AVR-Playground-Board. Das Board kann mit Controllern der ATmega-Familie bestückt werden und ist mit dem bekannten Arduino-System kompatibel, so dass auch die verschiedenen Arduino-Hardware-Erweiterungen verwendet werden können.
Für die Programmierung kommt die Sprache „C“ zum Einsatz. Auch hier wird im Buch auf das Arduino-System zurückgegriffen. Die frei verfügbare Arduino-Entwicklungsumgebung erlaubt den leichten Einstieg, ohne dass später Einschränkungen in Kauf genommen werden müssen. Die Hardware-nahe Programmierung steht dabei besonders im Fokus. Nach der Erläuterung von grundlegenden Anwendungen wird auf die anspruchsvolleren Themen wie Interrupts, Timer und Counter, Pulsweitenmodulation und Analog-Digital-Wandlung eingegangen.
Praktische Anwendungen können sowohl mit einem Arduino als auch mit dem AVR-Playground-Board durchgeführt werden. Da das AVR-Playground-Board bereits über eine Vielzahl von Peripherie-Einheiten verfügt, sind nur noch wenige externe Bauteile erforderlich. Das Board kann im Elektor-Shop hier bezogen werden.
Technology is constantly changing. New microcontrollers become available every year. The one thing that has stayed the same is the C programming language used to program these microcontrollers. If you would like to learn this standard language to program microcontrollers, then this book is for you!
Arduino is the hardware platform used to teach the C programming language as Arduino boards are available worldwide and contain the popular AVR microcontrollers from Atmel.
Atmel Studio is used as the development environment for writing C programs for AVR microcontrollers. It is a full-featured integrated development environment (IDE) that uses the GCC C software tools for AVR microcontrollers and is free to download.
At a glance:
Start learning to program from the very first chapter
No programming experience is necessary
Learn by doing – type and run the example programs
A fun way to learn the C programming language
Ideal for electronic hobbyists, students and engineers wanting to learn the C programming language in an embedded environment on AVR microcontrollers
Use the free full-featured Atmel Studio IDE software for Windows
Write C programs for 8-bit AVR microcontrollers as found on the Arduino Uno and MEGA boards
Example code runs on Arduino Uno and Arduino MEGA 2560 boards and can be adapted to run on other AVR microcontrollers or boards
Use the AVR Dragon programmer/debugger in conjunction with Atmel Studio to debug C programs
Mikrocontroller haben sich in den letzten Jahren in praktisch allen Bereichen der modernen Technik etabliert. In zunehmendem Maße dringen sie auch in die Gebiete der Künstlichen Intelligenz und der Robotertechnik vor. Das vorliegende Buch gibt eine umfassende Einführung in die Welt der Controller-Technik mit all ihren Facetten, von der einfachen Steuerung über die Sensor-Technik bis hin zur Datenübertragung in das Internet.
Als Basis dafür dient das von Elektor entwickelte AVR-Playground-Board. Das Board kann mit Controllern der ATmega-Familie bestückt werden und ist mit dem bekannten Arduino-System kompatibel, so dass auch die verschiedenen Arduino-Hardware-Erweiterungen verwendet werden können.
Für die Programmierung kommt die Sprache „C“ zum Einsatz. Auch hier wird im Buch auf das Arduino-System zurückgegriffen. Die frei verfügbare Arduino-Entwicklungsumgebung erlaubt den leichten Einstieg, ohne dass später Einschränkungen in Kauf genommen werden müssen. Die Hardware-nahe Programmierung steht dabei besonders im Fokus. Nach der Erläuterung von grundlegenden Anwendungen wird auf die anspruchsvolleren Themen wie Interrupts, Timer und Counter, Pulsweitenmodulation und Analog-Digital-Wandlung eingegangen.
Praktische Anwendungen können sowohl mit einem Arduino als auch mit dem AVR-Playground-Board durchgeführt werden. Da das AVR-Playground-Board bereits über eine Vielzahl von Peripherie-Einheiten verfügt, sind nur noch wenige externe Bauteile erforderlich. Das Board kann im Elektor-Shop hier bezogen werden.
PIC und AVR verstehen
In diesem Buch werden wir uns ausschließlich mit 8-Bit-Mikrocontrollern beschäftigen, und zwar mit Mikrocontrollern der 8-Bit-PIC- und der 8-Bit-AVR-Mikrocontroller-Linien. Bei der PIC-Familie handelt es sich dabei um PIC10, PIC12, PIC16 und PIC18; bei der AVR-Familie um ATtiny, ATmega und ATxmega. Die vorgestellten 8-Bit-Chips sind für sehr viele Anwendungen vollkommen ausreichend und preislich auch attraktiv.
Durch die Lektüre des Buches erhalten Sie ein fundiertes Wissen über die genannten 8-Bit-Mikrocontroller, über ihre Architektur, ihre Pinbelegungen und über ihre Programmierung.
Weil wir uns in diesem Buch mit den Grundlagen der Architektur der PICs und AVRs vertraut machen möchten, werden wir auch für alle PIC- und AVR-Anwendungen Assembler einsetzen, denn die Assembler-Sprache erlaubt es, die Technik im Detail kennenzulernen. Wenn man wirklich wissen möchte, was sich im Mikrocontroller abspielt, greift man zu Assembler. Damit hat man die beste Gelegenheit, sehr nah an den Kern zu kommen. Und wenn man schon einen Mikrocontroller-Typ kennengelernt und verstanden hat, ist es bei dem nächsten deutlich einfacher, auch wenn er von einem anderen Hersteller kommt. Bei anderen Programmiersprachen bleibt die Technik immer ziemlich tief versteckt.
Die Assembler-Beispiele sind so einfach gestaltet, dass sie jeder mit den im Buch aufgezeigten Programmiertechniken erstellen kann. Weil es sich um einfache Beispiele handelt, werden wir sie alle auf einer universellen Lochrasterplatine realisieren. Manche sind auch auf einem Experimentier-Breadboard umsetzbar.
PIC und AVR verstehen
In diesem Buch werden wir uns ausschließlich mit 8-Bit-Mikrocontrollern beschäftigen, und zwar mit Mikrocontrollern der 8-Bit-PIC- und der 8-Bit-AVR-Mikrocontroller-Linien. Bei der PIC-Familie handelt es sich dabei um PIC10, PIC12, PIC16 und PIC18; bei der AVR-Familie um ATtiny, ATmega und ATxmega. Die vorgestellten 8-Bit-Chips sind für sehr viele Anwendungen vollkommen ausreichend und preislich auch attraktiv.
Durch die Lektüre des Buches erhalten Sie ein fundiertes Wissen über die genannten 8-Bit-Mikrocontroller, über ihre Architektur, ihre Pinbelegungen und über ihre Programmierung.
Weil wir uns in diesem Buch mit den Grundlagen der Architektur der PICs und AVRs vertraut machen möchten, werden wir auch für alle PIC- und AVR-Anwendungen Assembler einsetzen, denn die Assembler-Sprache erlaubt es, die Technik im Detail kennenzulernen. Wenn man wirklich wissen möchte, was sich im Mikrocontroller abspielt, greift man zu Assembler. Damit hat man die beste Gelegenheit, sehr nah an den Kern zu kommen. Und wenn man schon einen Mikrocontroller-Typ kennengelernt und verstanden hat, ist es bei dem nächsten deutlich einfacher, auch wenn er von einem anderen Hersteller kommt. Bei anderen Programmiersprachen bleibt die Technik immer ziemlich tief versteckt.
Die Assembler-Beispiele sind so einfach gestaltet, dass sie jeder mit den im Buch aufgezeigten Programmiertechniken erstellen kann. Weil es sich um einfache Beispiele handelt, werden wir sie alle auf einer universellen Lochrasterplatine realisieren. Manche sind auch auf einem Experimentier-Breadboard umsetzbar.
Realize your own projects with the Elektor Arduino Nano MCCAB Training Board
The microcontroller is probably the most fascinating subfield of electronics. Due to the multitude of functions, it combines on its chip, it is a universal multi-tool for developers to realize their projects. Practically every device of daily use today is controlled by a microcontroller. However, for an electronic layman, realizing his own ideas with a microcontroller has so far remained a pipe dream due to its complexity. The Arduino concept has largely simplified the use of microcontrollers, so that now even laymen can realize their own electronics ideas with a microcontroller.
Book & Hardware in the Bundle: 'Learning by Doing'
This book, which is included in the bundle, shows how you can realize your own projects with a microcontroller even without much experience in electronics and programming languages. It is a microcontrollers hands-on course for starters, because after an overview of the internals of the microcontroller and an introduction to the programming language C, the focus of the course is on the practical exercises. The reader acquires the necessary knowledge by 'learning by doing': in the extensive practical section with 12 projects and 46 exercises, what is learned in the front part of the book is underpinned with many examples. The exercises are structured in such a way that the user is given a task to solve using the knowledge built up in the theoretical part of the book. Each exercise is followed by a sample solution that is explained and commented on in detail, which helps the user to solve problems and compare it with his own solution.
Arduino IDE
The Arduino IDE is a software development environment that can be downloaded for free to your own PC and that contains the entire software package needed for your own microcontroller projects. You write your programs ('apps') with the IDE’s editor in the C programming language. You translate them into the bits and bytes that the microcontroller understands using the Arduino IDE's built-in compiler, and then load them into the microcontroller's memory on the Elektor Arduino MCCAB Nano Training Board via a USB cable.
Query or control external sensors, motors or assemblies
In addition to an Arduino Nano microcontroller module, the Elektor Arduino Nano MCCAB Training Board contains all the components required for the exercises, such as light-emitting diodes, switches, pushbuttons, acoustic signal transmitters, etc. External sensors, motors or assemblies can also be queried or controlled with this microcontroller training system.
Specifications (Arduino Nano MCCAB Training Board)
Power Supply
Via the USB connection of the connected PC or an external power supply unit (not included)
Operating Voltage
+5 Vcc
Input Voltage
All inputs
0 V to +5 V
VX1 and VX2
+8 V to +12 V (only when using an external power supply)
Hardware periphery
LCD
2x16 characters
Potentiometer P1 & P2
JP3: selection of operating voltage of P1 & P2
Distributor
SV4: Distributor for the operating voltagesSV5, SV6: Distributor for the inputs/outputs of the microcontroller
Switches and buttons
RESET button on the Arduino Nano module 6x pushbutton switches K1 ... K6 6x slide switches S1 ... S6 JP2: Connection of the switches with the inputs of the microcontroller
Buzzer
Piezo buzzer Buzzer1 with jumper on JP6
Indicator lights
11 x LED: Status indicator for the inputs/outputs LED L on the Arduino Nano module, connected to GPIO D13 JP6: Connection of LEDs LD10 ... LD20 with GPIOs D2 ... D12
Serial interfacesSPI & I²C
JP4: Selection of the signal at pin X of the SPI connector SV12 SV9 to SV12: SPI interface (3.3 V/5 V) or I²C interface
Switching output for external devices
SV1, SV7: Switching output (maximum +24 V/160 mA, externally supplied) SV2: 2x13 pins for connection of external modules
3x3 LED matrix(9 red LEDs)
SV3: Columns of the 3x3 LED matrix (outputs D6 ... D8) JP1: Connection of the rows with the GPIOs D3 ... D5
Software
Library MCCABLib
Control of hardware components (switches, buttons, LEDs, 3x3 LED matrix, buzzer) on the MCCAB Training Board
Operating Temperature
Up to +40 °C
Dimensions
100 x 100 x 20 mm
Specifications (Arduino Nano)
Microcontroller
ATmega328P
Architecture
AVR
Operating Voltage
5 V
Flash Memory
32 KB, of which 2 KB used by bootloader
SRAM
2 KB
Clock Speed
16 MHz
Analog IN Pins
8
EEPROM
1 KB
DC Current per I/O Pins
40 mA on one I/O pin, total maximum 200 mA on all pins together
Input Voltage
7-12 V
Digital I/O Pins
22 (6 of which are PWM)
PWM Output
6
Power Consumption
19 mA
Dimensions
18 x 45 mm
Weight
7 g
Included
Elektor Arduino Nano MCCAB Training Board
Arduino Nano
Book: Microcontrollers Hands-on Course for Arduino Starters
Le téléchargement intégral de ce numéro est disponible pour nos membres GOLD et GREEN sur le site Elektor Magazine !
Pas encore membre ? Cliquez ici.
Cloc 2.0le réveil-matin de vos rêves
PIO du RP2040 en pratiqueexpérimentation des E/S programmables du RP2040
Poor Man's ChipTweakerNous avons des moyens (abordables) de vous faire parler
générateur de nombres réellement aléatoires avec interface USBdeux PICs pour le prix d?un AVR
vitamines audio pour micro ramolloComment gonfler soi-même le niveau de sortie d'un microphone
FFT avec MaixduinoAcquisition de spectres de fréquences
sur le vifsans raison apparente
pilote de moteurs pas à pas UCN5804drôle de composant, la série
simulation de circuit avec Micro-Cappremiers pas dans un monde compliqué
PAUL Award 2022les jeunes talents de la technologie et leurs solutions créatives
ma première radio définie par logicielréalisée en moins de 15 minutes
la documentation des microcontrôleurs sans peine (1)la structure d?une fiche technique
quel avenir pour l'IA et les systèmes embarqués ?outils, plateformes et remplacement des rédacteurs
numériser une ferme verticale
Infographie : l?embarqué et l?IA d?aujourd?hui et demain
Présentation du TinyML
Casestudy KwickPOS
Hautes performances pour tousNormes Computer-on-Module
démarrer en électroniquecomposants actifs
communication I²C avec Node.js et Raspberry Piaffichez les données de vos capteurs dans un navigateur
sortie vidéo sur les microcontrôleurs (2)sortie VGA et DVI
le système d'exploitation temps réel Metronomun RTOS pour processeurs AVR
DVI sur le RP2040Entretien avec Luke Wren, développeur de composants chez Raspberry Pi
L?afficheur HAT Miniaffichez les prévisions météo sur Raspberry Pi !
WEEF 2022 Awards : célébrez les bonnes choses
Hexadoku
Elektor GREEN en GOLD leden kunnen deze uitgave hier downloaden.Nog geen lid? Klik hier om een lidmaatschap af te sluiten.
Cloc 2.0de wekker die je altijd al wilde hebben
PIO in de praktijkexperimenten met de programmeerbare I/O van de RP2040
Armeluis chiptweakerwe krijgen je wel (goedkoop) aan de praat...
Echte USB-toevalsgeneratortwee PIC’s voor de prijs van één AVR
Pimp my mike...opvoeren doe je zelf
FFT met Maixduinofrequentiespectra vastleggen
Uit het leven gegrepenontwerp(on)logica
UCN5804 stappenmotordrivervreemde onderdelen
Simuleren met Micro-Capeerste stappen in een complexe wereld
PAUL Award 2022jonge technische talenten en hun creatieve ontwerpen
Mijn eerste Software Defined Radioin minder dan 15 minuten klaar
Microcontroller-documentatie verklaarddeel 1: de opzet van een datasheet
Hoe verder met AI en embedded systems?tools, platforms – en worden schrijvers obsoleet?
Digitalisering van verticale landbouw
Elektor Infographicsembedded en AI vandaag – en morgen
Een introductie tot TinyML
Casestudy KwickPOS
High-performance in elke klassecomputer-on-module standaarden
Alle begin......wordt eindelijk actief!
I²C-communicatie met Node.js en een Raspberry Pibekijk sensordata in een browser
Video-output met microcontrollers (2)VGA en DVI
Het Metronom real-time besturingssysteemeen RTOS voor AVR-processoren
DVI op de RP2040vraaggesprek met Luke Wren, chipontwikkelaar bij Raspberry Pi
Display-HAT Minitoont het weer op de Raspberry Pi
De WEEF 2022 Awardshet goede vieren
Hexadoku
The Elektor Arduino Nano MCCAB Training Board contains all the components (incl. Arduino Nano) required for the exercises in the "Microcontrollers Hands-on Course for Arduino Starters", such as light-emitting diodes, switches, pushbuttons, acoustic signal transmitters, etc. External sensors, motors or assemblies can also be queried or controlled with this microcontroller training system.
Specifications (Arduino Nano MCCAB Training Board)
Power Supply
Via the USB connection of the connected PC or an external power supply unit (not included)
Operating Voltage
+5 Vcc
Input Voltage
All inputs
0 V to +5 V
VX1 and VX2
+8 V to +12 V (only when using an external power supply)
Hardware periphery
LCD
2x16 characters
Potentiometer P1 & P2
JP3: selection of operating voltage of P1 & P2
Distributor
SV4: Distributor for the operating voltagesSV5, SV6: Distributor for the inputs/outputs of the microcontroller
Switches and buttons
RESET button on the Arduino Nano module 6x pushbutton switches K1 ... K6 6x slide switches S1 ... S6 JP2: Connection of the switches with the inputs of the microcontroller
Buzzer
Piezo buzzer Buzzer1 with jumper on JP6
Indicator lights
11 x LED: Status indicator for the inputs/outputs LED L on the Arduino Nano module, connected to GPIO D13 JP6: Connection of LEDs LD10 ... LD20 with GPIOs D2 ... D12
Serial interfacesSPI & I²C
JP4: Selection of the signal at pin X of the SPI connector SV12 SV9 to SV12: SPI interface (3.3 V/5 V) or I²C interface
Switching output for external devices
SV1, SV7: Switching output (maximum +24 V/160 mA, externally supplied) SV2: 2x13 pins for connection of external modules
3x3 LED matrix(9 red LEDs)
SV3: Columns of the 3x3 LED matrix (outputs D6 ... D8) JP1: Connection of the rows with the GPIOs D3 ... D5
Software
Library MCCABLib
Control of hardware components (switches, buttons, LEDs, 3x3 LED matrix, buzzer) on the MCCAB Training Board
Operating Temperature
Up to +40 °C
Dimensions
100 x 100 x 20 mm
Specifications (Arduino Nano)
Microcontroller
ATmega328P
Architecture
AVR
Operating Voltage
5 V
Flash Memory
32 KB, of which 2 KB used by bootloader
SRAM
2 KB
Clock Speed
16 MHz
Analog IN Pins
8
EEPROM
1 KB
DC Current per I/O Pins
40 mA on one I/O pin, total maximum 200 mA on all pins together
Input Voltage
7-12 V
Digital I/O Pins
22 (6 of which are PWM)
PWM Output
6
Power Consumption
19 mA
Dimensions
18 x 45 mm
Weight
7 g
Included
1x Elektor Arduino Nano Training Board MCCAB
1x Arduino Nano
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.
Le téléchargement intégral de ce numéro est disponible pour nos membres GOLD et GREEN sur le site Elektor Magazine !
Pas encore membre ? Cliquez ici.
programmation PIO sur le Raspberry Pi PicoNeuf instructions, de multiples possibilités
l'IA en ligne de commandeDéveloppement, compilation et validation de projets embarqués depuis le terminal
le Scrutiny DebuggerDéboguer, visualiser et tester du code C/C++ embarqué
carte breakout Sigfox (1)Développement d’une BoB radio
alimentation à faible bruit (2)Construction, assemblage et mise en œuvre pratique
générateur de signaux simple basé sur le RP2040Signaux analogiques et numériques
à la découverte du futur de la domotique avec Matter et l’IA EdgeLes dernières versions de Matter et l’essor de l’IA en périphérie de réseau (edge) donnent-ils enfin aux ingénieurs les outils nécessaires pour construire les maisons intelligentes et parfaitement intégrées promises aux utilisateurs ?
capteurs de pression différentielleLa maintenance prédictive appliquée aux systèmes CVC
la sécurité dès la conceptionPrincipes d’ingénierie pour limiter les défaillances
la sécurité des systèmes embarqués n’est plus une option
la CRA et la PQC redéfinissent les priorités de la sécurité embarquéePourquoi même les petites entreprises IoT et industrielles doivent prévoir une mise à niveau
embedded world 2026Entretien avec Benedikt Weyerer, directeur d’embedded world
prise en main du bus I3CUtilisation de matériel de ST et Microchip
le projet BLEnkyPrototypage rapide d’applications Bluetooth Low Energy
modulation de largeur d’impulsionDu thermostat tout ou rien à un signal analogique continu filtré
audiotroniqueDes circuits audio agréables à l’écoute, à réaliser soi-même
sur le vifLisez donc le manuel !
carte émetteur-récepteur audio ESP32 (4)Réglage des horloges et une option filaire
2026 : une odyssée de l’IAConséquences du vibe coding
charge CC symétriqueCharge CC symétrique, statique ou dynamique
comptage de visages avec MaixCAMUne méthode simple pour estimer la taille d’un public
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.