What is a microcontroller?
A microcontroller is a tiny computer on a single chip. It can read inputs (from buttons or sensors), follow a program, and control outputs (such as an LED, a buzzer or a motor). Small boards like these run many everyday electronic products.
Key idea
Input → Process → Output: the microcontroller reads an input, runs the program, then controls an output.
Building a program
To develop a program for a microcontroller, follow these steps:
- Plan the steps with a flowchart or pseudocode.
- Write the program (the code).
- Upload it to the microcontroller board.
- Test it, find any mistakes, and improve it.
Inputs and outputs
A sensor is an input that measures something, like light or temperature. An LED or buzzer is an output the program can switch on and off. Using selection, the program can decide: IF it is dark THEN turn the light ON.
Example
A night light: a light sensor is the input; when it is dark, the microcontroller turns the LED on.