Technology & electronics
Microcontrollers
A whole computer on one chip: it reads inputs, decides by program and switches outputs, in a toaster as well as in a car.
How many computers do you have at home? Do not just count your laptop and phone. There is one in the washing machine, in the toaster, in the remote control, in the toothbrush with a timer. These hidden computers are called microcontrollers. They are tiny, often cost less than a bread roll and work for years without anyone noticing them.
A computer on a single chip
A microcontroller combines everything a computer needs on one single chip: a processor that runs the program, memory for program and data, and many connection points called pins. A big PC has separate parts for all of this and needs an operating system. The microcontroller, in contrast, starts within a fraction of a second and simply runs its one program, over and over, as long as it has power. A clock sets the rhythm: on a typical hobby board it ticks 16 million times per second, and in each tick the processor completes one tiny step of work. Despite that speed the program memory stays modest, often only a few dozen kilobytes, less than a single phone photo takes up.
Read, decide, switch
Almost every microcontroller works to the same pattern, thousands of times per second. First: read the inputs. Is the button pressed? How warm is it at the sensor? Second: the program decides. If the bread is dark enough, then the toast is done. Third: switch the outputs. The heating wires turn off, the toast pops up, a light blinks. This pattern is also called the input, processing, output loop.
Steps: 0
From the toaster to the car
A modern car often contains more than 80 microcontrollers. One controls the engine, one the brakes, one the window lifters, one watches the tyre pressure. They talk to each other over data lines, like a team of specialists. Traffic lights, lifts, pacemakers and toy drones work the same way. Every year, many billions of microcontrollers are built into devices worldwide, far more than PCs and phones combined.
Try it yourself with Arduino
The best part: you can build with microcontrollers yourself. Boards like the Arduino make it easy. Some of their pins know only on and off, those are the digital ones, others also read values in between, such as brightness or temperature, those are the analog ones. You connect an LED or a sensor to the pins, write a small program on your computer and load it onto the chip via a USB cable. After that, the program runs completely on its own, even without the computer. The first project of almost every beginner is a blinking LED, the hello world of hardware, so to speak.
Exercises
0 of 6 solvedTime to try it yourself. You can't break anything, every attempt counts.
What is a microcontroller?
In what order does a microcontroller work through its loop?
A microcontroller checks its temperature sensor 50 times per second. How often does it check it in 10 seconds?
Put the three steps a toaster microcontroller runs through in its loop into the right order.
- 1Read the inputs: how dark is the bread at the sensor?
- 2Switch the outputs: heating wires off, toast pops up
- 3The program decides: is it dark enough?
An Arduino Uno has 14 digital pins and 6 analog pins. How many pins is that in total?
A microcontroller combines processor, memory and connection points on a single ….