Integrated Circuits (ICs)

Integrated circuits are miniaturized networks of transistors, resistors, and capacitors built into a semiconductor chip. They can perform complex functions like computation, memory storage, or signal processing.

Microcontrollers (MCUs)

Microcontrollers are an integrated circuit that contains a CPU, memory (RAM & ROM/Flash), and peripherals (timers, I/O ports, ADCs, etc.) all on a single chip.

MCUs are designed to handle simple, repetitive tasks like blinking an LED, reading a sensor, or basic motor control. They can run standalone as complete embedded systems and are found in appliances, IoT devices, cars, and industrial machines. Typical MCUs run at a few MHz and have a few KB of RAM.

Microprocessors (MPUs)

Microprocessors are an integrated circuit that contain only the CPU.

Microprocessors are designed for high-speed instruction execution and data processing. They require external components like RAM, ROM, timers, and I/O circuits to form a complete system. MPUs are used in personal computers, servers, and high-performance applications. They typically run at multiple GHz and interface with several GB or external RAM.

Microcontrollers

A microcontroller is a tiny computer. We are surrounded by them every day - they are embedded in timers, thermostats, toys, remote controls, and microwave ovens. They are programmed to sense and control activity using sensors and actuators.

  • A sensor listens to the physical world. They convert other forms of energy into electrical energy/signals.
  • An actuator takes action in the physical world. They convert electrical energy into other forms of energy, like light, heat, and movement.

Microcontrollers listen to sensors and talk to actuators. They decide what to do based on a program inside them.

A microcontroller reads inputs, makes decisions (through code), and changes outputs. It can be thought of as a programmable decision-maker that controls the voltage on pins based on logic. Unless pre-loaded with firmware, microcontrollers need code to be flashed on them to do anything useful.

For example, if a microcontroller reads HIGH, the code says "turn the light on," the pin goes HIGH, and the light activates.

Types of Microcontrollers

ATmega328P - A widely-used, 8-bit AVR microcontroller, renowned for its balance of performance, low power consumption, and ease of use in prototyping.

ESP32 - A series of low-cost, low-power system-on-chip (SoC) microcontrollers with integrated Wi-Fi and dual-mode Bluetooth, commonly used for IoT, wearables, and automation.

STM32 - A widely-used family of 32-bit ARM microcontrollers and microprocessors, featuring high-performance (up to 800 MHz), low-power consumption, and diverse peripherals.

Microcontroller Inputs & Outputs

A microcontroller has large external pins that connect to a breadboard or PCB. These pins need to be large and strong enough to be soldered to a circuit board, handle mechanical stress (don't get bent easily), carry external currents, and connect to breadboard contacts or PCB traces.

Inside the chip package, these pins connect to very small wires called bond wires. These bond wires connect the pins to metal pads on the silicon die, which then connect to the nano-scale circuitry inside the chip.

Digital Output

A digital output pin can produce two voltage levels:

  • HIGH - near the supply voltage (5V or 3.3V)
  • LOW - near 0V (Ground)

When you write HIGH to a pin, internal transistors inside the microcontroller drive the pin to the supply voltage. When you write LOW, the pin is driven to ground.


Digital Input

A digital input pin reads whether a voltage applied to the pin is HIGH or LOW.

This allows a microcontroller to detect things like:

  • A button press
  • A sensor trigger
  • A logic signal from another chip

The microcontroller determines HIGH or LOW based on voltage thresholds.


Analog Input

Analog input pins can measure a range of voltages instead of just HIGH or LOW.

An Analog-to-Digital Converter (ADC) converts the voltage into a number.

For example, with a 10-bit ADC:

0V = 0
2.5V = 512
5V = 1023