In anything and everything…
Microcontrollers or MCUs are self-contained single-chip computers containing CPU and memory for the software and data, as well as logic for many types of peripherals.
MCUs come in packages from 6 pins up to more than 100 depending on what kind of functionality is provided. Increasingly high-end MCUs get DSP functionality to accelerate math and signal processing. In many cases individual pins share different functionality controlled by software, including serial communication (UART), I2C, digital input with possible pull-up or pull-down resistors, digital outputs with possible high current drivers, pulse width modulation outputs, analog-to-digital inputs (8 to 12 bits) and digital-to-analog outputs. MCUs also have 1 or more timers for timed events, as well as interrupts for quick reaction to events.
There are many brands of MCUs. All mobile phones and other more advanced small devices use MCUs or SoCs (System-on-a-chip) based on the ARM architecture. For device automation it’s more differentiated. Consider that seemingly “dumb” things like coffee machines, washing machines, dish washers, electronic locks, remote controls, oscilloscopes, multi-meters, motor vehicles, stereos, robots, weather stations, etc all use MCUs. The cost can be quite low, down to sub-$, so it’s generally better to program an MCU than implementing custom logic. The trend is clearly moving from 8-bit architectures to 16-bit and 32-bit (that are generally ARM-based), but 8-bit MCUs are still very popular and arguably dominating due to very low cost and size.
Here’s a list of top-selling providers.
Arduino is an MCU-based open source platform that’s quickly become very popular among hobbyists, and is also used for semi-professional and small volume commercial solutions. There are clear benefits with Arduino for hobbyists, including:
- Open source design, so anyone can make derivative solutions based on the base schematics, and many have
- Piggy-back “shield” boards that add functionality to Arduino boards
- Using Atmel 8-bit MCU chips (so far ATmega168, ATmega328, ATmega1280) that have a scalable architecture suited for high-level languages
- Atmel 8-bit MCUs are generally low-priced and fast (~20 MIPS at 20 MHz; considerably faster than corresponding PIC MCUs)
- Boards available in many different form factors, including very small
- Can be programmed in almost any language, as code is compiled to machine code, but normally Processing (read: C/C++; languages you need to know anyway, if you want to get a job in embedded programming) is used
- Due to machine code, programs are fast
- Code can be edited in a dedicated Arduino IDE as well as e.g. Visual Studio Code
- There are Atmel chips with the Arduino bootloader pre-installed for a slightly higher price, making it very easy to upload software via USB/serial