What Is a Microcontroller? Tiny Computers in Everyday Things

13 min read · Updated: October 23, 2026

A microcontroller (MCU) is a small computer built on a single chip. It holds a circuit that runs instructions, memory that stores the program, and circuits that talk to other devices. It handles the "control" in rice cookers, remote controls and car brakes. It keeps repeating three steps: read a sensor, decide, and drive something such as a motor.

What you'll learn

  • What is inside a microcontroller (CPU, memory and peripherals)
  • How it differs from the processor in a PC or smartphone
  • The "read, decide, act" loop, and how interrupts work
  • How it meets fixed deadlines, and how it runs for years on a battery
  • Why cars contain so many microcontrollers, and why they are made in older factories

Prerequisites: none. Reading "What Is a CPU?" first makes the first half easier.

In everyday life

Press the button on a rice cooker. It adjusts the heat to the amount of rice, then switches to keep-warm when the rice is done. The part making these decisions inside the machine is a microcontroller.

Japan offers an early example. A Japanese government magazine (2020) says rice cookers that use a microcontroller to adjust heating to the amount of rice appeared in 1979. Today, microcontrollers are in many electric products, from water heaters to toys. Some cars carry more than 100 of them.

"Microcontroller" is often shortened to MCU, which stands for microcontroller unit.

A complete small computer on one chip

A computer needs a circuit that runs instructions, memory for programs and data, and ports to talk to the outside. In a PC, many of these are separate parts. A microcontroller puts all of them on one chip.

At the center is a circuit that fetches instructions one at a time and runs them. It does the same job as a PC's CPU. This part is called the "CPU core."

In most microcontrollers, the program is stored on the chip in memory that keeps its contents when the power is off. This type of memory is called flash memory. It belongs to the same family as a USB stick, though the details differ. When the power comes on, the CPU core starts reading instructions from it right away.

Measured temperatures and numbers in the middle of a calculation go into working memory. Microcontrollers usually use a type called SRAM. It is fast to read and write, and it loses its contents when the power is off. Depending on the model, it ranges from under 1 KB to a few MB. 1 KB holds about 1,000 letters or digits of plain text.

Inside a microcontroller: a CPU core, flash, SRAM and peripherals on one chip Microcontroller (one chip) CPU core: runs instructions Flash Program SRAM Working data Peripherals (talk to the outside) GPIO ADC Timer PWM Communication Read Act Sensor Motor Other chip Also buttons, LEDs, heaters
A schematic of what is inside a microcontroller. Left out: the wiring between the blocks, the circuits that make the clock and power, and other peripherals that vary by model.

Peripherals: the link to the outside world

What makes a microcontroller special is its set of circuits for dealing with the outside world. Together they are called "peripherals." The main ones are:

  • Input/output pins: They read or set the voltage on the chip's legs (pins) as a 0 or a 1. Uses include reading a button or turning on an LED. These are called GPIO.
  • A circuit that turns analog into numbers: A temperature sensor puts out a voltage that changes smoothly with temperature. This circuit turns that continuous value into a number. It is called an ADC (analog-to-digital converter).
  • Timers: They measure time by counting a steady stream of ticks (the clock).
  • A circuit that sets strength by switching on and off: It switches an output on and off very fast. The share of time it stays on sets the average strength. It is used to dim LEDs and set motor speed. It is called PWM.
  • Communication circuits: They exchange data with other chips by fixed rules. Common methods are UART, I²C and SPI. A table of the differences is in "I2C vs SPI vs UART."

Some models also have radio circuits. Because peripherals come in so many combinations, there are a huge number of models.

How it differs from a PC or smartphone processor

The main chip in a PC or smartphone also has a CPU. But it is built to run many apps fast. Its working memory (DRAM) is a separate chip that can hold several GB. It also runs a large operating system (OS), such as Windows or Android, that manages the whole machine.

To tell them apart from microcontrollers, these chips are called microprocessors (MPUs). "What Chips Are Inside a Smartphone?" shows what is inside a phone's main chip (SoC). A microcontroller instead puts its priority on doing a fixed job cheaply, on little power, and reliably.

PointMicrocontrollerPC or smartphone processor
Main jobControl a machine exactly as plannedRun many apps
Working memoryMostly on the chip; under 1 KB to a few MBDRAM outside the chip; hundreds of MB to several GB
OSNone, or a small OSA large OS such as Windows or Android
After power-onRuns right awayTakes seconds or more to boot the OS

The table shows rough trends, and the line between the two is blurry. Many products use both. The processor handles the screen and network, and the microcontroller handles time-critical control. "MCU vs MPU" compares them in detail.

How it works: read, decide, act, repeat

Most microcontroller programs repeat the same loop of steps. Let's look at a rice cooker, kept very simple.

  1. Read: read the temperature sensor's voltage as a number, using the ADC
  2. Decide: compare that number with the target temperature
  3. Act: if it is too low, power the heater; if too high, switch it off

The chip repeats these three steps at short intervals, over and over. The measurement sets the next action, and the result is measured again. This keeps the temperature close to the target. Adjusting while watching the result like this is called feedback control. A real rice cooker changes its target by stage, such as soaking, boiling and steaming. Here we show just one stage.

How a microcontroller runs: it repeats read, decide and act, sleeps when idle, and wakes on an interrupt ① Read Temperature sensor ② Decide Below the target? ③ Act Heater on or off Sleep when idle Sleep mode saves power Wake on a signal Interrupt (button, timer)
The microcontroller repeats the loop of steps 1 to 3 (left arrow). When idle, it sleeps. A signal from a button or timer (an interrupt) wakes it, and it starts again from step 1 (right arrow). Left out: targets that change by stage, safety monitoring, and designs that keep looping without sleeping.

Interrupts: answering urgent signals right away

One option is to check the button on every pass of the loop. But if the checks are far apart, the response is slow, or a short press is missed.

So a microcontroller has a way to pause its current work when a signal arrives. It first runs a task prepared in advance. When that is done, it goes back to where it stopped. This mechanism is called an interrupt. Signals can come from a button pin, a timer or a communication circuit.

An interrupt can also wake a sleeping microcontroller. Checking every time instead is called polling. A table of the differences is in "Interrupt vs Polling."

Always meeting the deadline

In some microcontroller jobs, "always finishing by a set time" matters more than speed. A car's airbag is an example. It is useless unless it opens within a very short time after the sensor detects a crash.

A strict timing rule like this, where missing the deadline even once is a failure, is called hard real-time. A microcontroller suits it well. Its work is small and simple, so what happens inside is easy to predict. A PC's priority is running many apps fairly, so it is poor at guaranteeing exact timing.

Microcontrollers with and without an OS

On a PC, the OS switches between apps and manages memory ("What Is an Operating System?"). On a microcontroller, programs are often built with no OS, using only the loop and interrupts shown above. This is called "bare metal," meaning the program runs directly on the hardware.

When the work grows too large for one loop, a small OS is used. It is built mainly to meet deadlines. It is called an RTOS (real-time operating system). It gives each task a priority and switches quickly when an urgent one arrives.

Years on a battery: asleep most of the time

An air conditioner remote can go a long time without new batteries. The microcontroller inside only has work when a button is pressed. The rest of the time, it sleeps and waits.

With no work to do, the microcontroller stops the clock signal and power to the CPU core and many other circuits. It then waits on a tiny amount of power. This state is called sleep mode. A button press triggers an interrupt that wakes it. It sends the signal, then goes back to sleep.

The "By the numbers" section works out how long a battery lasts.

8-bit, 16-bit and 32-bit

Microcontroller descriptions often say "8-bit" or "32-bit." Roughly, this is how many binary digits (0s and 1s) the CPU core handles in one calculation. An 8-bit core handles numbers from 0 to 255 at once, and a 32-bit core up to about 4.3 billion. This is a simplified picture; the amount of memory it can address also plays a part. ("How Do Computers Use Binary?" explains how 0s and 1s stand for numbers.)

More bits make it easier to work with large numbers and lots of memory. On the other hand, 8-bit microcontrollers have small circuits and are still used for simple jobs. The Arduino Uno (R3), a popular hobby board, uses the 8-bit ATmega328P.

By sales, though, 32-bit leads. In 2021, the research firm IC Insights forecast that 32-bit chips would take about 77% of that year's automotive microcontroller sales. 16-bit would take about 18%, and 8-bit about 6%.

A common CPU core design in 32-bit microcontrollers is the "Cortex-M" series from Arm, a UK company. Arm licenses the design, and chipmakers build it into their own microcontrollers. Arm reported that 4.4 billion Cortex-M chips shipped in the three months from October to December 2020.

Microcontrollers in cars

In a car, small control units handle jobs such as the engine, brakes, power windows and airbags. Each one is called an ECU (electronic control unit). An ECU is a circuit board carrying a microcontroller and the circuits that connect it to sensors and motors.

A 2021 article in the tech magazine IEEE Spectrum says even low-end cars have close to 100 ECUs. Some luxury cars have 150 or more.

A car's microcontrollers face engine heat, winter cold and vibration for many years. So cars use parts proven to survive a set of standard tests. A leading test standard is AEC-Q100, set by the US Automotive Electronics Council (AEC).

Why aren't they made in the newest factories?

A smartphone SoC is made on a leading-edge process generation such as "3 nm." Most microcontrollers, in contrast, are made on proven generations several steps older. A 2022 analysis by McKinsey found that most automotive chips are made at 90 nm or older. "What Does 2nm or 3nm Mean?" explains these generation names.

One reason is the flash memory that holds the program. Flash uses high voltages to write and erase. The transistors that handle those voltages do not shrink at the same rate as each generation advances. Extra process steps also drive up the cost. According to the research firm Yole (2024), the industry broadly agrees that the limit is around 28 to 22 nm.

In 2018, Renesas began shipping samples of an automotive microcontroller with built-in flash at 28 nm, which it called an industry first. To go further, some companies are replacing flash with newer memory. In 2023, NXP and TSMC announced they would make MRAM, a memory that uses magnetism, for cars at the 16 nm generation.

The other reason is cost. Microcontroller jobs rarely need leading-edge speed. What matters is making chips cheaply, at the same quality, for many years. Still, a shortage of factories for these generations was one reason car production stopped in 2020 to 2022 (see "What Caused the Global Chip Shortage?").

How do you write a program for one?

Microcontroller programs are usually written in a language people can read and write easily, such as C. A PC then converts it into the 0s and 1s the CPU core can run (machine code). The machine code is written into the microcontroller's flash, for example over a USB cable.

A program built into a device like this, and not normally changed, is called firmware.

Anyone can try microcontrollers at home. In January 2021, Raspberry Pi released the $4 "Raspberry Pi Pico" board. It carries the company's own RP2040 microcontroller, which has two Cortex-M CPU cores.

But the RP2040 has no built-in flash. The program sits in a separate flash chip on the board. "Built-in flash" is true of most models, but there are exceptions. Note that a plain "Raspberry Pi," without "Pico," is a small computer that runs Linux, not a microcontroller.

Common misconceptions

Myth: A microcontroller is just a slow, low-end CPU

In fact, it aims at different goals. A microcontroller's priorities are meeting deadlines, using little power, and talking directly to outside devices. A PC CPU in a rice cooker would cost far too much and use far too much power. The myth arises because, judged by clock speed alone, a microcontroller looks slow, like a "cheap CPU."

Myth: Only expensive products like PCs and phones contain computers

In fact, rice cookers, remote controls and toys have them too. One of the first microcontrollers, the TMS1000 (announced in 1974), cost about $2 each in large volumes (Computer History Museum, US). These devices have no screen or keyboard, so it is just hard to notice the computer inside.

Myth: Microcontrollers always run an OS too

In fact, as shown above, many microcontrollers run with no OS. Large operating systems like Windows or Linux need far too much memory to fit on a typical microcontroller. Because PCs and phones always have an OS, people assume microcontrollers do too.

By the numbers

ItemFigure
Cortex-M chips shipped (Arm)4.4 billion in the three months from October to December 2020
Automotive microcontroller sales by type (IC Insights, 2021 forecast)32-bit about 77%, 16-bit about 18%, 8-bit about 6%
ECUs per car (IEEE Spectrum, 2021)Close to 100 even in low-end cars; 150 or more in some luxury cars
RP2040 working memory (SRAM)264 KB, about 1/30,000 of the iPhone 16 Pro's memory (8 GB)

Let's work out what sleep mode does for a coin cell battery. Panasonic's datasheet gives the CR2032 a capacity of 225 mAh. That is enough to supply 225 milliamps for one hour. Suppose the average current, taking sleep and awake time together, is 0.01 milliamps. Then the battery lasts 22,500 hours, or about 2.6 years. If the average is 10 times higher, at 0.1 milliamps, it lasts about 3 months. This is a simplified calculation. It ignores the battery's self-discharge, temperature, and short bursts of high current.

Learn more

Read next

Articles in the series “Chips in everyday life”

  1. Memory vs Storage: What's the Difference? (RAM vs SSD)
  2. What Chips Are Inside a Smartphone? The Main Chips Explained
  3. What Is a Power Semiconductor? SiC, GaN and IGBTs Explained
  4. How Do Image Sensors Work? Inside a Phone Camera Sensor
  5. What Is a Microcontroller? Tiny Computers in Everyday Things
  6. How Do Solar Cells Work? Light to Electricity and Its Limits
  7. How Do LEDs Work? Turning Electricity Into Light in a Chip
  8. How Do Touchscreens Work? Capacitive Touch Explained
  9. How Do SSDs Work? Inside NAND Flash Memory, Explained
  10. What Is an Analog Chip? Analog vs Digital ICs Explained
  11. How Does GPS Work? Satellites, Timing and Your Phone
  12. LCD vs OLED: How Phone and TV Screens Make Color
  13. How DRAM Works: Cells, Refresh and Sense Amplifiers
  14. What Is MEMS? How Accelerometers and Gyroscopes Work
  15. How Lithium-Ion Batteries Work: Charging, Aging and Safety
  16. What Is a Laser Diode? How It Differs From an LED
  17. What Is GaN (Gallium Nitride)? Why GaN Chargers Are Small
  18. What Is Silicon Carbide (SiC)? Why EV Inverters Use It
  19. How Wireless Charging Works: Induction, Qi and Qi2
  20. What Is an Inverter? DC to AC for Air Conditioners and EVs
  21. What Is USB? USB-C vs USB 3, USB4 and Power Delivery
  22. How Noise Cancelling Works: Using Sound to Erase Sound
  23. How Are Chips Cooled? Heat Sinks, Heat Pipes and Limits
  24. How AC Adapters and Chargers Work: From Wall Outlet to 5 V
  25. What Chips Are Inside an Electric Car? EV Chips Explained
  26. How Do Smartwatches Measure Heart Rate? Reading Blood Flow
  27. How Power Banks Work: How Many Charges From 10,000 mAh?
  28. What Is NFC? How Contactless Cards and Tap to Pay Work

Questions on this topic: Embedded Systems & Firmware

Sources

All explainers