Assignments Final Project About Me Contact
← Back to assignments
Fab Academy · Week 4

Embedded
Programming

Writing firmware that runs on microcontrollers to control hardware — reading sensors, processing data, and driving outputs like LEDs and motors under tight memory and power constraints.

ESP32 Arduino C++ Wokwi Tinkercad IoT
Introduction

What is Embedded Programming?

Embedded programming is the process of writing firmware that runs on a microcontroller or microprocessor to control hardware components and perform specific tasks. It enables the system to read inputs from sensors, process data, and control outputs such as motors, LEDs, and displays — operating continuously with limited memory and power resources.

During Week 4 of Fab Academy, we dived deep into microcontrollers, explored different programming languages, and wrapped up with a series of assignments.

Group Assignment
Toolchain Comparison
  • Demonstrate and compare the toolchains and development workflows for available embedded architectures
Individual Assignment
Build & Program
  • Browse through the datasheet for a microcontroller
  • Write and test a program using a microcontroller with input/output devices and wired or wireless communication
  • Extra credit: Assemble the physical system
  • Extra credit: Try different languages and/or development environments
Microcontroller

ESP32

The ESP32 is a powerful and versatile microcontroller with built-in WiFi and Bluetooth, making it ideal for IoT projects. It features multiple GPIO pins, analog and digital inputs, and supports I2C, SPI, and UART communication — all while staying energy-efficient.

ESP32 microcontroller board
ESP32 Development Board
CoreTensilica Xtensa Dual-Core 32-bit LX6
Voltage3.3V
Clock SpeedUp to 240 MHz
Flash MemoryTypically 4MB
SRAM520 KB
GPIO PinsUp to 36 configurable
ADC12-bit ADC (analog inputs)
DAC2x 8-bit outputs
WiFi802.11 b/g/n, station, soft-AP, P2P
Bluetoothv4.2 BR/EDR and BLE
PowerUltra-low power sleep modes
ESP32

A dual-core, WiFi + Bluetooth capable microcontroller built for the Internet of Things. Low power, high performance, and easy to prototype with.

Communication Protocols
UART

Serial comms — sensors, GPS, modems

SPI

High-speed — displays, SD cards

I2C

Multi-device via two wires (SDA & SCL)

CAN

Automotive/industrial variants

PWM

Motors, LEDs, servos

ADC / DAC

Analog read and output

GPIO

Switches, LEDs, relays

↓ View ESP32 Datasheet
Getting Started · Wokwi

ESP32 Blink LED

Using Wokwi — a browser-based circuit simulator — to prototype the classic blink LED without any physical hardware. Follow along step by step:

01

Sign up on Wokwi, then click Create New Project

Create new project in Wokwi
Wokwi — Create New Project screen
02

Select ESP32 as the target microcontroller board

Choosing ESP32 in Wokwi
Selecting the ESP32 board
03

Started testing with the built-in LED — but LED_BUILTIN is a reserved keyword and caused a conflict

LED_BUILTIN keyword issue
Attempting to use the LED_BUILTIN keyword
04

Defined a custom pin variable to replace the reserved keyword and resolved the conflict

Updated code with custom pin name
Updated code with a custom pin definition
05

Drew the full circuit schematic inside the Wokwi workspace

Circuit schematic in Wokwi
Circuit schematic — drawing phase
06

Added a protection resistor — even though ESP32 pin current is limited, this is best practice for circuit safety

Complete Wokwi blink circuit
Complete circuit with protection resistor
07

Full Working Demonstration — the LED blinks as programmed

ESP32 Blink — live simulation demo
Input & Output Interaction

Arduino with Tinkercad

Arduino is a beginner-friendly microcontroller with great input/output support, though it lacks built-in wireless connectivity. Inputs — push buttons, temperature sensors, light sensors, soil moisture sensors — let it sense the environment. Outputs — LEDs, motors, relays, buzzers, displays — let it respond and act.

By processing input data through programmed logic and generating appropriate outputs, Arduino can automate systems for robotics, home automation, and smart agriculture. For this section we used Tinkercad — a browser-based simulator by Autodesk.

Components Used
Arduino Uno Battery Resistor LED Push Button
01

Opened Tinkercad and started with a fresh circuit workspace

Tinkercad workspace
Getting started with Tinkercad
02

Searched for and added the Arduino board to the workspace

Adding Arduino to Tinkercad
Searching and adding the Arduino board
03

Added remaining components — resistor, battery, LED, and push button

Adding components in Tinkercad
Adding resistor, battery, LED, and button
04

Wired all components together following the circuit diagram

Connecting components
Components being connected
05

Circuit fully connected and verified

Fully connected circuit
Fully connected circuit
06

Labelled the circuit for clarity before writing code

Labelled circuit in Tinkercad
Labelled and annotated circuit
07

Writing the Code — programmed the button input and LED output logic in C++

Writing the Arduino code in Tinkercad
08

Simulation — ran the simulation and adjusted the resistor value because the LED brightness was too low

Final simulation with corrected resistor value
Takeaways

Conclusion

I studied a great deal this week and interacted extensively with inputs and outputs using beginner-friendly microcontrollers. I worked with low-level languages like C++, and I am now building my Python skills to use Thonny IDE as confidently as I use the Arduino IDE.