This week's assignment focused on understanding the fundamentals of embedded programming by studying microcontroller datasheets, writing embedded software, and interfacing output devices with a microcontroller. The primary objective was to gain practical experience in developing firmware, understanding hardware-software interaction, and implementing a working embedded application.
My contribution to the group assignment focused on studying the Seeed Studio XIAO ESP32-C3 microcontroller, understanding its datasheet, and exploring communication protocols such as UART, I²C, and SPI. I also worked on interfacing display modules using the I²C protocol and documented the programming workflow, hardware setup, and communication process. This activity helped me gain a deeper understanding of embedded system architecture and hardware-software integration.
The complete group assignment documentation, including experimental procedures, observations, and results from all team members, can be accessed through the Fab Academy Lab page linked below.
Through this collaborative exercise, I learned how different communication protocols are implemented in embedded systems and how development boards can be programmed to interact with external peripherals. The experience also strengthened my understanding of datasheet interpretation, circuit connections, and firmware development.
For this week's assignment, I explored the datasheet of the
Seeed Studio XIAO ESP32-C3
.
Studying the datasheet helped me understand the microcontroller's architecture, pin configuration, communication interfaces, memory organization, power management features, and wireless capabilities. It provided a detailed overview of how a compact development board can integrate processing, connectivity, and I/O functionality within a small footprint. Reviewing the datasheet was an important first step before beginning any programming or hardware interfacing activities.
View XIAO ESP32-C3 Datasheet
| Feature | Arduino Uno | XIAO ESP32C3 |
|---|---|---|
| Processor | ATmega328P (8-bit AVR @ 16 MHz) | ESP32-C3 (32-bit RISC-V @ 160 MHz) |
| Wi-Fi/Bluetooth | None | Wi-Fi + BLE 5.0 |
| Flash Memory | 32 KB | 4 MB |
| SRAM | 2 KB | 400 KB |
| I/O Pins | 14 Digital, 6 Analog | 11 Multipurpose I/Os |
| ADC Resolution | 10-bit | 12-bit |
| USB Type | USB-B | USB-C |
| Power Consumption | Higher | Very Low (Supports sleep modes) |
| Form Factor | Large (68.6 x 53.4 mm) | Ultra-compact (21 x 17.5 mm) |
| Programming Language | Arduino (C++) | Arduino (C++), MicroPython |
| Cost & Availability | Widely available, low cost | Compact, modern, affordable |
| Microcontroller | ATmega328P |
|---|---|
| Operating Voltage | 5V |
| Input Voltage | 7-12V (recommended) |
| Digital I/O Pins | 14 (6 provide PWM output) |
| Analog Input Pins | 6 |
| Flash Memory | 32 KB (0.5 KB used by bootloader) |
| SRAM | 2 KB |
| EEPROM | 1 KB |
| Clock Speed | 16 MHz |
| Dimensions | 68.6mm × 53.4mm |
Microcontrollers rarely work alone. In most embedded systems, they communicate with sensors, displays, memory modules, and other controllers through standardized communication protocols. These protocols define how information is transmitted and received between devices. During this week's assignment, I explored three commonly used communication methods: UART, I²C, and SPI.
| Protocol | Lines Required | Speed | Complexity | Applications |
|---|---|---|---|---|
| UART | TX, RX | Moderate | Easy | Serial Monitor, PC Communication |
| I²C | SDA, SCL | Moderate | Medium | OLED Displays, Sensors |
| SPI | MOSI, MISO, SCK, CS | High | Medium | Displays, SD Cards, Memory Devices |
UART (Universal Asynchronous Receiver Transmitter) is one of the simplest communication protocols used in embedded systems. It transfers data through two lines: TX (Transmit) and RX (Receive). Since UART does not require a clock signal, it is commonly used for serial monitoring, debugging, and communication between microcontrollers and computers.
SPI (Serial Peripheral Interface) is a high-speed communication protocol that uses separate lines for clock and data transfer. It provides faster communication compared to I²C but requires more wiring. SPI is commonly found in TFT displays, SD cards, flash memory devices, and high-speed peripherals.
For this assignment, I selected an OLED display that communicates using the I²C protocol. I²C, which stands for Inter-Integrated Circuit, is a two-wire communication standard developed to simplify communication between electronic devices.
Only two signal lines are required:
The microcontroller acts as the master device while the OLED display behaves as the slave device. Data is transferred over the SDA line while synchronization is maintained using the SCL clock signal.
One of the major advantages of I²C is that multiple devices can share the same communication bus, reducing the number of wires required in a project.
s Comparison of UART, I²C, and SPI communication protocols.
The following videos helped me understand communication protocols such as UART, I²C, and SPI, as well as the process of interfacing an OLED display with Arduino. These resources provided additional insight into the concepts explored during this assignment.
The following tutorial provides a practical introduction to interfacing an SSD1306 OLED display with Arduino using the I²C communication protocol. It covers hardware connections, library installation, code explanation, and display testing, making it a useful reference while performing this assignment.
Reference tutorial demonstrating SSD1306 OLED display interfacing with Arduino using I²C communication.
Basic I²C communication architecture showing SDA and SCL connections.
Online electronics circuit simulators are web-based tools that allow users to design, simulate, and test electronic circuits virtually—without any physical components. These platforms are especially useful for beginners, educators, and hobbyists, as they offer a low-risk environment to learn and experiment.
| Simulator Name | Features | Ideal For | Download Link |
|---|---|---|---|
| Tinkercad Circuits | Arduino simulation, breadboard view, code editor | Beginners, students | TinkerCAD |
| Falstad Circuit Simulator | Analog and digital simulation, waveform visualization | Intermediate users | Falstad Circuit Simulator |
| EasyEDA | PCB design + simulation, schematic editor | PCB designers | EasyEDA |
| CircuitVerse | Digital logic circuit simulator | Digital electronics learners | CircuitVerse |
| Multisim Live | SPICE simulation, schematic design | Engineering-level projects | Multisim Live |
TinkerCAD is a free, easy-to-use app for 3D design, electronics, and embedded coding. It's used by designers, hobbyists, teachers, and kids, for creating simple 3D models and circuits.
TinkerCAD is not just only for designing circuits, we can also use it to design 3D models and many inbuilt examples are available in the website
Let's Create a new circuit for our Assignment
Click on the Circuits button below
Navigation bar in KiCAD
This guide explains how to display "Welcome to Fab Academy" on a 16x2 LCD using an Arduino and the Adafruit_LiquidCrystal library.
This image shows a 16x2 LCD Display connected to an Arduino, demonstrating basic display functionalities.
| LCD Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | A4 (Uno) / 20 (Mega) |
| SCL | A5 (Uno) / 21 (Mega) |
#include <Adafruit_LiquidCrystal.h>
int seconds = 0;
Adafruit_LiquidCrystal lcd_1(0);
void setup() {
lcd_1.begin(16, 2);
lcd_1.print("Welcome to Fab");
lcd_1.setCursor(0, 1);
lcd_1.print("Academy");
delay(2000);
lcd_1.clear();
}
void loop() {
lcd_1.setCursor(0, 0);
lcd_1.print("Time (sec): ");
lcd_1.setCursor(11, 0);
lcd_1.print(seconds);
lcd_1.setBacklight(1);
delay(500);
lcd_1.setBacklight(0);
delay(500);
seconds++;
}
#include <Adafruit_LiquidCrystal.h> int seconds = 0; Adafruit_LiquidCrystal lcd_1(0);
lcd_1. The parameter 0 is used when only one LCD is connected.
void setup() {
lcd_1.begin(16, 2);
lcd_1.print("Welcome to Fab");
lcd_1.setCursor(0, 1);
lcd_1.print("Academy");
delay(2000);
lcd_1.clear();
}
void loop() {
lcd_1.setCursor(0, 0);
lcd_1.print("Time (sec): ");
lcd_1.setCursor(11, 0);
lcd_1.print(seconds);
lcd_1.setBacklight(1);
delay(500);
lcd_1.setBacklight(0);
delay(500);
seconds++;
}
seconds.This Arduino code displays a welcome message ("Welcome to Fab Academy") for 2 seconds, then starts counting time in seconds. The LCD backlight blinks every 0.5 seconds to create a visual effect while the time increases.
After understanding the communication protocols and validating the circuit in TinkerCAD, I implemented the project physically using an Arduino Uno and a 0.96-inch SSD1306 OLED display. The objective was to establish I²C communication and display custom text on the OLED screen. This experiment helped me understand how embedded systems communicate with external display devices and present information in real time.
OLED stands for Organic Light Emitting Diode. Unlike traditional LCD displays, OLED displays do not require a backlight because each pixel emits its own light. This results in better contrast, lower power consumption, and excellent visibility. The SSD1306 OLED used in this assignment has a resolution of 128 × 64 pixels and communicates using the I²C protocol through only two signal lines: SDA and SCL.
The OLED display was connected to the Arduino Uno using the I²C communication interface. The connections used are shown below.
| OLED Pin | Arduino Uno Pin | Function |
|---|---|---|
| VCC | 5V | Power Supply |
| GND | GND | Ground |
| SDA | A4 | Serial Data Line |
| SCL | A5 | Serial Clock Line |
To communicate with the OLED display, the following Arduino libraries were used:
| Library | Purpose |
|---|---|
| Wire.h | Provides I²C communication support. |
| Adafruit_GFX.h | Provides graphics functions such as text, lines, and shapes. |
| Adafruit_SSD1306.h | Controls the SSD1306 OLED display module. |
The program begins by including the required libraries for I²C communication and OLED control. The display object is then initialized with a resolution of 128 × 64 pixels. Inside the setup function, communication with the OLED display is established and the display is initialized. In the main loop, the display buffer is cleared, the cursor position is set, and the text "WELCOME TO ACADEMY!" is written to the screen. Finally, the display buffer is updated so that the text becomes visible on the OLED screen.
Arduino IDE showing the SSD1306 OLED display program.
After successfully uploading the program, the OLED display initialized correctly and displayed the programmed text. The experiment verified successful I²C communication between the Arduino Uno and the SSD1306 OLED display module.
Physical implementation of the OLED display experiment using Arduino Uno and SSD1306 OLED module.
Through this experiment, I gained practical experience in interfacing an OLED display with a microcontroller using the I²C communication protocol. I learned how external libraries simplify hardware interaction, how display modules are initialized, and how embedded software can be used to present information on graphical displays. This activity strengthened my understanding of hardware-software integration in embedded systems.
The following resources were used throughout this week's Embedded Programming assignment. These references include the microcontroller documentation, development board documentation, and the Arduino source code used for the OLED display experiment.
| Resource | Description | Link |
|---|---|---|
| Arduino Uno Datasheet | Official technical documentation for the Arduino Uno development board. | View Datasheet |
| XIAO ESP32-C3 Documentation | Hardware specifications, pinout, and programming guide. | View Documentation |
| OLED Display Source Code | Arduino sketch used to interface the SSD1306 OLED display using I²C communication. | Download Code |
These resources can be used to reproduce the experiment, understand the hardware architecture, and further explore embedded system development using Arduino and ESP32-based platforms.