ABC of Electronics cosycom.com
LESSON 28

Introduction to Microcontrollers

A single chip that contains a processor, memory, and pins to read sensors and control outputs — the brain behind most modern electronics.

Every lesson up to this point has been about circuits with fixed behavior — once you wire a filter or an amplifier, it does exactly that one job forever. A microcontroller (often shortened to MCU) breaks that pattern: it's a chip that runs a program you write, so the same physical chip can blink a light, read a sensor, drive a motor, or all three at once, just by changing the code.

Inside one small package, a microcontroller typically bundles:

  • A processor core that executes your program's instructions one at a time, very fast.
  • Flash memory that stores your program permanently, even with the power off.
  • RAM that stores variables and data while the program runs, but clears when power is lost.
  • GPIO pins (general-purpose input/output) that your program can set HIGH or LOW, or read as HIGH or LOW, connecting the chip to the outside world — LEDs, buttons, sensors, motors.

Many microcontrollers also include built-in peripherals that save you from building extra external circuitry: an ADC to read analog voltages (Lesson 29), PWM generation (Lesson 30), and dedicated hardware for the communication protocols you'll cover in Lessons 32–34 (UART, I2C, SPI).

Popular families you'll encounter include the ATmega chips (used on Arduino Uno boards), the ESP32 (which adds built-in Wi-Fi and Bluetooth), and the STM32 series. You program a microcontroller on a separate computer, then transfer ("flash") the compiled program onto the chip, where it runs independently — no computer required afterward.

MCU
Microcontroller package Processor, memory, and GPIO pins in one chip — the same physical part can become almost any project, depending only on the code you load onto it.
KEY TAKEAWAY
A microcontroller packs a processor, memory, and input/output pins into one chip that runs your own program — turning fixed-function circuits into flexible, reprogrammable ones.