# Microcontroller

> A tiny, cheap computer on one chip, built to control one specific thing.

- Level: Intermediate
- Topics: Hardware
- URL: https://tidbit.legios.com.ar/microcontroller/
- In Spanish: [Microcontrolador](https://tidbit.legios.com.ar/es/microcontroller/)

A **microcontroller** (MCU) is a complete small computer on a single chip: a modest processor, a little memory for the program and data, and pins that connect directly to the outside world. It does not run Windows or apps. It runs one program, stored in its firmware, over and over: read a button, check a sensor, turn on a motor, repeat.

They are everywhere, usually invisible. A microwave, a washing machine, a TV remote, a car (which can have dozens of them), a thermostat, a smart lightbulb, a computer keyboard: each has at least one. They cost from a few cents to a few dollars, use very little power (some run for years on a coin battery) and start instantly.

Compared with the processor in a laptop, or even a Raspberry Pi, a microcontroller is far less powerful: memory is measured in kilobytes, not gigabytes. That is the point. It is designed for simple, reliable, real-time control at the lowest cost and power. Hobbyists and students meet them through **Arduino**, an open-source board and programming environment that made microcontrollers easy to use, and through the **ESP32**, a cheap chip with Wi-Fi built in that powers many Internet of things gadgets.

## An analogy

A programmable thermostat compared with a full office. The office (a PC) can do any job you give it; the thermostat does one job, all day, every day, for years, without needing anyone to start it up.

## Keep in mind

- Processor, memory and input/output pins on a single chip.
- Runs one program in a loop to control a device.
- Costs cents to a few dollars and uses very little power.
- Arduino and ESP32 boards are the usual way to start tinkering with them.

## Go deeper

- [Microcontroller on Wikipedia](https://en.wikipedia.org/wiki/Microcontroller)
- [What is Arduino? (official docs)](https://docs.arduino.cc/learn/starting-guide/whats-arduino/)

## Related terms

- [Chip](https://tidbit.legios.com.ar/semiconductor-chip/): A sliver of silicon carrying billions of tiny switches that compute and remember.
- [CPU](https://tidbit.legios.com.ar/cpu/): The chip that runs your programs, one instruction after another, very fast.
- [Firmware](https://tidbit.legios.com.ar/firmware/): Software built into a device to run its hardware, from routers to washing machines.
- [Sensor](https://tidbit.legios.com.ar/sensor/): A component that measures something in the physical world and turns it into a signal.
- [Lithium-ion battery](https://tidbit.legios.com.ar/lithium-ion-battery/): The rechargeable battery inside phones, laptops and electric cars.
- [Laptop](https://tidbit.legios.com.ar/laptop/): A whole computer folded into one portable case that runs on a battery.
- [Raspberry Pi](https://tidbit.legios.com.ar/raspberry-pi/): A cheap, credit-card-sized computer made for learning and tinkering.
- [Bit and byte](https://tidbit.legios.com.ar/bit-and-byte/): The smallest unit of digital information, and the group of eight that computers count in.
