An embedded and microcontroller lab: simulators first, hardware second
Start programming microcontrollers for free in an online simulator, then move to a low-cost board with the right tools, safe wiring habits and a simple way to test and debug.
What you need
You can learn embedded programming without buying anything, then add hardware when you are ready.
- Start in a simulator. Browser tools such as Wokwi (wokwi.com) and Tinkercad Circuits (tinkercad.com) simulate popular boards, LEDs, buttons, sensors and displays. You write real code and see it run, with nothing to break.
- Then use real hardware. A low-cost board such as an Arduino-compatible board, an ESP32 or a Raspberry Pi Pico costs little. A starter kit adds a breadboard, jumper wires, LEDs, resistors, buttons and a few sensors.
- Tools. The Arduino IDE (arduino.cc) is the simplest way to write and upload code. PlatformIO (platformio.org) inside Visual Studio Code is a more professional setup with better project management.
Set it up
- Open a simulator project with a board and an LED, and run the classic “blink” program to see it work.
- For real hardware, install the Arduino IDE, plug the board in with a data-capable USB cable (some cables only charge), choose the board and port under the Tools menu, and open File, Examples, Basics, Blink.
- For ESP32 or Pico boards, add the board support package in the IDE’s Boards Manager, following the board maker’s own instructions.
- On Linux, add yourself to the serial-port group if uploads are refused:
sudo usermod -aG dialout $USER, then log out and in. - Upload the program. The built-in LED should blink.
Check that it works
- The IDE reports “Done uploading” and the board’s LED blinks at the rate you set.
- The Serial Monitor shows text you print with
Serial.println("hello")at the speed you set (for example 9600 baud). - Changing the delay in the code and uploading again changes the blink rate.
If the port does not appear, try another cable, install the board’s USB driver, or press the board’s boot button while connecting.
Practise safely
- Never connect mains voltage (wall power) to anything in these courses. Practise only at the low voltages the boards use (3.3 V or 5 V) unless a lesson with proper safety instructions says otherwise, and never open powered mains equipment.
- Always use a resistor with an LED, check polarity, and double-check wiring before applying power.
- Do not draw more current from a pin than the board allows; use a transistor or driver module for motors and relays.
- Disconnect power before changing wiring.
- Keep a notebook: wiring diagrams, pin numbers and the code version that worked.
Go further
- Rebuild each lesson’s task in the simulator first, then on real hardware, and compare.
- Read a sensor, print its value and use it to control an output (a light that turns on when it is dark).
- Learn to debug: use serial prints, then a logic analyser or the simulator’s wire inspector, to see what the pins really do.
- Add a network feature (Wi-Fi on an ESP32) that publishes sensor readings to a free MQTT broker you run yourself (see the home automation lab guide).
Courses that use this lab
- Firmware in Practice: The Small Rules That Decide Whether Embedded Code Works
- Home Automation in Practice: The Rules That Make a Smart Building Behave
- Internet of Things and Cloud Connectivity
- IoT in Practice: The Rules That Keep a Fleet of Devices Connected
- Microcontrollers and Embedded Programming
- Robotics, Actuators and Advanced Projects
- Robotics in Practice: The Arithmetic That Keeps a Robot Moving and Safe
Other lab guides
- A virtual machine lab on your own computer
- A Linux practice machine
- A network lab with free simulators and virtual routers
- A packet-capture lab with Wireshark and tcpdump
- A network-services lab: DHCP, DNS, proxy, load balancer, time and failover
- A Windows Server and Active Directory lab
- A developer workstation: editor, Git, Python and Node
- A container and Kubernetes lab
- A monitoring lab with Prometheus and Grafana
- A security operations (SOC) practice lab
- An isolated security lab for authorised practice
- A cloud lab that cannot surprise you with a bill
- An electronics lab: simulate first, then build on a breadboard
- A Raspberry Pi lab, with or without a Pi
- A home automation lab with Home Assistant and MQTT
- An audio, video, streaming and show-control lab
- A data lab: Python, pandas and Jupyter on your own computer
- A machine learning lab: scikit-learn, notebooks and honest experiments
- An LLM lab: a free local model, embeddings and a test harness
- A TypeScript lab: Node.js, the compiler and a test runner
- A web deployment lab: Git, a free host and environment settings
Software changes quickly. Menu names and version numbers may differ a little from what you see; the ideas and the check at the end of each section stay the same. Always download from the project's own website, and read the licence terms for your situation.