Learn to interface and program hardware devices in a wide range of useful applications, using ARM7 microcontrollers and the C programming language. Examples covered in full detail include a simple LED to a multi-megabyte SD card running the FAT file system.
Features of this book
Build prototype circuits on breadboard or Veroboard and interface to ARM microcontrollers.
A 32-bit ARM7 microcontroller is used in interfacing and software examples.
Interfacing principles apply to other ARM microcontrollers and other non-ARM microcontrollers as well.
Example programs are written in the C programming language.
Use only free or open source software.
Download and install all programming tools from the Internet.
Template project files are provided for easy project creation.
Hardware
Interface to LEDs, transistors, optocouplers, relays, solenoids, switches, keypads, LCD displays, seven segment displays, DC motors, stepper motors, external analogue signals using the ADC, RS232, RS-485, TWI, USB, SPI and SD memory cards.
Software
Once hardware has been interfaced to a microcontroller, software must be written to control the hardware. You will learn how to write programs to operate externally interfaced hardware devices, use timers and interrupts. Also learn how to port FAT file system code for use with an SD memory card, program the PWM to produce an audio sine wave, program the PWM to speed control a DC motor and more.
A chapter on more advanced ARM microcontrollers is included with an overview of some of the newest ARM microcontrollers and their features.
Using the RFID Starter Kit
An Arduino board has now become ‘the’ basic component in the maker community. No longer is an introduction to the world of microcontrollers the preserve of the expert. When it comes to expanding the capabilities of the basic Arduino board however, the developer is still largely on his own. If you really want to build some innovative projects it’s often necessary to get down to component level. This can present many beginners with major problems. That is exactly where this book begins.
This book explains how a wide variety of practical projects can be built using items supplied in a single kit together with the Arduino board. This kit, called the 'RFID Starter Kit for Arduino' (SKU 17240) is not just limited to RFID applications but contains more than 30 components, devices and modules covering all areas of modern electronics.
In addition to more simple components such as LEDs and resistors there are also complex and sophisticated modules that employ the latest technology such as:
A humidity sensor
A multicolor LED
A large LED matrix with 64 points of light
A 4-character 7-segment LED display
An infra red remote-controller unit
A complete LC-display module
A servo
A stepper motor and controller module
A complete RFID reader module and security tag
On top of that you will get to build precise digital thermometers, hygrometers, exposure meters and various alarm systems. There are also practical devices and applications such as a fully automatic rain sensor, a sound-controlled remote control system, a multifunctional weather station and so much more.
All of the projects described can be built using the components supplied in the Elektor kit.
Dit is een ideaal boek voor hobbyisten, studenten en ingenieurs die op een leuke manier C en het gebruik van een mbed ARM microcontroller willen leren, rechtstreeks op internet zonder ingewikkelde software-installatie.
De projecten in dit boek zijn bedoeld voor gevorderden op het gebied van ARM microcontrollers of de programmeertaal C. Dat wil zeggen dat de kennis uit deel 1 van deze serie bekend verondersteld wordt.
Cloud technologie
De in dit boek gebruikte mbed NXP LPC1768 maakt gebruik van cloud-technologie, een revolutionair concept voor software-ontwikkeling. Dit houdt in dat u geen software hoeft te installeren om de mbed te kunnen programmeren!
Het enige dat u nodig heeft, is een internet-browser zoals Microsoft Internet Explorer, en een USB-poort op uw PC. U kunt vanaf elke willekeurige PC waar dan ook ter wereld toegang krijgen tot uw project en er aan verder werken. Wanneer u klaar bent, kunt u met een paar eenvoudige klikjes met uw muis het programma overzetten naar uw mbed-hardware. Uiteraard kunt u de projecten ook downloaden en op uw eigen PC opslaan wanneer u dat liever heeft.
In een deel van de projecten wordt Visual Basic gebruikt; dit gratis pakket is nog niet in de cloud beschikbaar en moet wel op uw PC geïnstalleerd worden.
Onderwerpen die aan de orde komen
Leer het programmeren van een ARM microcontroller via cloud-technologie. Geen ARM ontwikkelsoftware-installatie op uw eigen PC.
Leer hoe u een ARM microcontroller met internet kunt verbinden, hoe u via internet uw ARM kunt bedienen en hoe u vanaf de ARM microcontroller tweets kunt versturen.
Leer hoe u een CMUcam camera kunt aansturen en toepassen in uw applicaties, bijvoorbeeld als alarm.
Leer hoe u met behulp van de gratis PC programmeertaal Visual Basic met uw ARM microcontroller kunt communiceren met gebruik van multi-threading.
Voorbeelden van projecten in dit boek: internet-server, automatisch twitteren, digitaal naar analoog conversie, USB HID, automatisch metingen in een spreadsheet plaatsen, met een camera bewegingen waarnemen, seriële communicatie met een zelfgeschreven PC-programma, gebruik van een LCD en SPI en I²C communicatie.
It is becoming important for microcontroller users to quickly learn and adapt to new technologies and architecture used in high performance 32-bit microcontrollers. Many manufacturers now offer 32-bit microcontrollers as general purpose processors in embedded applications.
ARM provide 32 and 64-bit processors mainly for embedded applications. These days, the majority of mobile devices including mobile phones, tablets, and GPS receivers are based on ARM technology. The low cost, low power consumption, and high performance of ARM processors makes them ideal for use in complex communication and mixed signal applications.
This book makes use of the ARM Cortex-M family of processors in easy-to-follow, practical projects. It gives a detailed introduction to the architecture of the Cortex-M family. Examples of popular hardware and software development kits are described.
The architecture of the highly popular ARM Cortex-M processor STM32F107VCT6 is described at a high level, taking into consideration its clock mechanisms, general input/output ports, interrupt sources, ADC and DAC converters, timer facilities, and more. The information provided here should act as a basis for most readers to start using and programming the STM32F107VCT6 microcontroller together with a development kit.
Furthermore, the use of the mikroC Pro for ARM integrated development environment (IDE) has been described in detail. This IDE includes everything required to create a project; namely an editor, compiler, simulator, debugger, and device programmer.
Although the book is based on the STM32F107VCT6 microcontroller, readers should not find it difficult to follow the projects using other ARM processor family members.
Programmierung in Assembler und C am Beispiel der ATtiny-Familie
Dieses Buch bietet einen eingehenden Blick auf die 8-Bit-AVR-Architektur in ATtiny- und ATmega-Mikrocontrollern, hauptsächlich aus der Sicht der Software und der Programmierung. Erforschen Sie die AVR-Architektur unter Verwendung von C und Assembler in Microchip Studio (früher Atmel Studio) mit ATtiny-Mikrocontrollern.
Lernen Sie die Details der internen Funktionsweise von AVR-Mikrocontrollern kennen, einschließlich der internen Register und des Speicherplans von ATtiny-Bausteinen.
Programmieren Sie Ihren ATtiny-Mikrocontroller mit einem Atmel-ICE-Programmiergerät/Debugger oder verwenden Sie ein preiswertes Hobby-Programmiergerät oder sogar einen Arduino Uno als Programmiergerät.
Die meisten Code-Beispiele können mit dem Microchip Studio AVR-Simulator ausgeführt werden.
Lernen Sie, Programme für ATtiny-Mikrocontroller in Assembler zu schreiben.
Erfahren Sie, wie Assemblersprache in Maschinencodebefehle umgewandelt wird.
Finden Sie heraus, wie Programme, die in der Programmiersprache C geschrieben wurden, in Assemblersprache und schließlich in Maschinencode umgewandelt werden.
Verwenden Sie den Microchip Studio Debugger in Kombination mit einem Hardware-USB-Programmierer/Debugger, um Assembler- und C-Programme zu testen oder verwenden Sie den Microchip Studio AVR-Simulator.
ATtiny-Mikrocontroller im DIP-Gehäuse werden verwendet, um eine einfache Nutzung auf Breadboards zu ermöglichen.
Erfahren Sie mehr über Timing und Taktimpuls in AVR-Mikrocontrollern mit ATtiny-Bausteinen.
Werden Sie zu einem AVR-Experten mit fortgeschrittenen Debugging- und Programmierfähigkeiten.
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.
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.
This book is about DC electric motors and their use in Arduino and Raspberry Pi Zero W based projects. The book includes many tested and working projects where each project has the following sub-headings:
Title of the project
Description of the project
Block diagram
Circuit diagram
Project assembly
Complete program listing of the project
Full description of the program
The projects in the book cover the standard DC motors, stepper motors, servo motors, and mobile robots. The book is aimed at students, hobbyists, and anyone else interested in developing microcontroller based projects using the Arduino Uno or the Raspberry Pi Zero W.
One of the nice features of this book is that it gives complete projects for remote control of a mobile robot from a mobile phone, using the Arduino Uno as well as the Raspberry Pi Zero W development boards. These projects are developed using Wi-Fi as well as the Bluetooth connectivity with the mobile phone. Readers should be able to move a robot forward, reverse, turn left, or turn right by sending simple commands from a mobile phone. Full program listings of all the projects as well as the detailed program descriptions are given in the book. Users should be able to use the projects as they are presented, or modify them to suit to their own needs.
This book contains 50 fun and exciting projects for PIC microcontrollers such as a laser alarm, USB teasing mouse, eggtimer, youth repellent, soundswitch, capacitive liquid level gauge, 'finger in the water' sensor, guarding a room using a camera, mains light dimmer (110-240 volts), talking microcontroller and much more. Several different techniques are discussed such as relay, alternating current control including mains, I²C, SPI, RS232, USB, pulse width modulation, rotary encoder, interrupts, infrared, analog-digital conversion (and the other way around), 7-segment display and even CAN bus.
You can use this book to build the projects for your own use. The clear explanations, schematics and even pictures of each project make this a fun activity. For each project the theory is discussed and why the project has been executed in that particular way. That means you can also use this book as a studybook, or as basis for larger and more complicated projects. All projects use a breadboard so modification and expansion is easy.
Three PIC microcontrollers are used, the 16f877A, 18f4455 and 18f4685. It is also discussed how you can migrate your project from one microcontroller to another – 15 types are supported - including two example projects.
All software that is used in this book can be downloaded for free. That also applies to the open source programming language JAL. This powerful and yet easy to learn language is used by hobbyists as well as professionals.
This book can also be used as a reference guide. It explains all JAL commands, as well as the expansion libraries. Using the index you can easily find example projects that illustrate the use of these commands. Even when you have built all projects in this book you will still want to keep it within arm's reach.
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.
Analogue Electronics and Microcontrollers Projects
Hobbyist electronics can be a fun way to learn new skills that can be helpful to your career. Those who understand the basics of electronics can design their own circuits and projects. However, before you run, you need to learn to walk.
It all starts with analogue electronics. You should be familiar with the simple components and circuits and understand their basic behaviors and the issues you may encounter. The best way to do this is through real experiments. Theory alone is not enough. This book offers a large number of practical entry-level circuits, with which everyone can gain the basic experience.
Through the widespread introduction of microcontrollers, a new chapter in electronics has begun. Microcontrollers are now performing more and more tasks that were originally solved using discrete components and conventional ICs. Starting out has become easier and easier thanks to platforms including Bascom, Arduino, micro:bit. The book introduces numerous manageable microcontroller applications. It?s now a case of less soldering and more programming.
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.