A microcontroller (MCU) is a small computer on one chip: a processor, memory and connections to the outside world, all on one die, the single piece of silicon inside the chip's package. It runs one job, such as a washing machine's wash cycle, a car window, a ceiling fan or a thermostat. It does that job with software written only for it, called embedded software or firmware.
What is inside? The processor core is usually small and simple. Many follow the Arm design, which chip companies license through processor IP licensing, and a growing number follow the open RISC-V design. The core's instruction set is the fixed list of basic commands it understands. The core typically runs at tens to a few hundred megahertz, that is, tens to a few hundred million steps a second. Flash memory on the same die stores the program, from 32 KB to a few MB. RAM, the working memory, holds a few KB to a few hundred KB. A laptop has many thousands of times more memory. Around the core sit the connections: timers, a converter that reads analog voltages, outputs that switch motors and lights, and communication ports that send data to other chips. An MCU costs from about ₹20 to a few hundred rupees.
Take, for example, a front-loading washing machine in a flat in Nagpur. Its MCU has 256 KB of flash memory and 32 KB of RAM, and costs the appliance maker less than ₹150. The owner chooses the 'Cotton 40 °C' programme and presses Start. The MCU locks the door and opens the water valve. It reads the water-level sensor several times a second, and closes the valve when the drum holds about 12 litres. It switches on the heater until the temperature sensor reads 40 °C. It turns the drum at about 50 revolutions per minute (rpm), first one way and then the other, for 40 minutes. Then it drains, rinses and spins the drum at 1,200 rpm. If the clothes have bunched to one side and the drum shakes, it slows the spin and redistributes the load first. Each decision is a line of the firmware, and every machine of that model runs the same firmware.
The MCU does not work alone. Sensor chips measure the world, analog chips turn their signals into numbers, and power semiconductors switch the motor and the heater. A connected appliance adds an IoT wireless chip, so that the owner can start a wash from a phone; see smart home appliances.
Once an appliance maker or a carmaker chooses an MCU, it rarely changes it. Switching would mean rewriting and retesting all the firmware. So one MCU model can stay in production for 10 to 20 years. Being chosen in this way is called a design win. To win it, the chip makers also write the free development tools, code libraries and examples that engineers use to program their chips. Engineers write the firmware by hand, generate it from a model with model-based design, or run it on a real-time operating system (RTOS) when the device must handle several tasks on a strict schedule. A car has dozens of MCUs, each inside an electronic control unit. The large MCU makers design their chips and tools in Bengaluru, Hyderabad, Chennai and Noida.