A microcontroller is a whole computer on one chip, and there is one inside nearly every device you use: the thermostat, the remote, the washing machine, the car, the smart meter. Programming one is different from programming a laptop. There is no operating system to protect you, memory is measured in kilobytes, time matters down to the microsecond, and the code must run for months without anyone touching it.
This course teaches that discipline in the order you need it. You start with what a microcontroller is and how code reaches it, then read and drive the real world (digital and analog inputs and outputs, PWM, serial), make a program do several things at once without blocking, respond to events with interrupts and timers, talk to chips over I2C and SPI, and read sensors and displays. The last third is what separates a demo from a product: low-power design, reliability, the watchdog, and firmware structure with version control.
What makes this different
Each lesson follows one pattern: the idea, a worked example in C++, what to build and measure on your bench, the mistakes people make, and a lab that runs in your browser. The labs are small functions and command sequences that check your understanding of the arithmetic and the logic behind the firmware: clock and timer maths, baud rates, wrap-safe timing, debouncing, state machines, ADC conversions, bus timing, battery budgets, CRCs and version rules. Two projects then ask you to design and build real firmware on a board, and a graded capstone asks you to prove a complete embedded device.
You do not need an oscilloscope to start, but one helps from the interrupts lesson on. The code is written for Arduino-style C++ on an Uno or Nano and an ESP32, and notes where the two differ. Library and core function names change between versions, so check the documentation for the version you install.
The material is written from public documentation and widely used practice (the Arduino and PlatformIO documentation, the AVR and ESP32 datasheets, and published guidance on embedded reliability). It is independent of, and not endorsed by, any manufacturer named.
What you will learn
- Foundations: microcontroller architecture, memory and clock; board choice; the toolchain from source to flash; C and C++ for small chips (fixed-width types, overflow, bits,
volatile); digital I/O, pull-ups and pin limits; timing withoutdelay(); debouncing and state machines. - Input and output: the ADC and analog sensors, noise and filtering; PWM, servos and motors; serial communication, framing and command parsing.
- Timing and control: interrupts and the rules for ISRs; timers, prescalers and compare-match arithmetic; low-power design with duty cycling, sleep modes and battery budgets.
- Buses and sensors: I2C and SPI, pull-ups, addresses and modes; reading sensors, two’s complement, fixed-point, displays and memory cost.
- Reliability: debugging, timeouts and retries, fail-safe outputs, the watchdog, reset causes, EEPROM wear, CRC; firmware structure, libraries, secrets, git and semantic versioning.
How to practise
You need an Arduino Uno or Nano (or an ESP32 board), a USB cable, a breadboard, jumper wires, a few LEDs, a button, resistors, a potentiometer, a temperature sensor (TMP36 or similar), an I2C sensor such as a BME280, and a small servo. Use low-voltage parts only, keep motors and servos on their own supply, and never connect a pin to mains electricity. Keep a notebook of measurements, code decisions and mistakes.
Prerequisites
The Electronics Fundamentals and Circuit Design course, or equivalent knowledge of Ohm’s law, dividers, LEDs and transistors, and using a multimeter. Some programming experience helps, but the C and C++ lesson covers what you need.
Where it leads
This is the second course of the Embedded Systems and IoT division. It prepares you for single-board computers and Linux physical computing, connecting devices to the cloud, and home automation and robotics projects.