Introduction
As part of the Fab Opportunity Academy, Week 2 focused on the fundamentals of Embedded Systems and Embedded Programming, exploring how hardware and software work together in modern electronic devices.
During this week, I learned the difference between microcontrollers and microprocessors, studied various microcontroller families, and explored their applications. I also installed and configured Thonny and learned the basics of programming microcontroller boards using both Arduino IDE and Thonny. In addition, I gained an understanding of binary and hexadecimal number systems, which are essential for embedded programming.
Overall, this week provided me with a solid foundation in embedded systems and the basic programming concepts required for developing embedded applications.
What is an Embedded System?
I learned that an embedded system is a small computer built inside a device to perform a specific task. It combines hardware (such as a microcontroller, sensors, and other electronic components) with software (programs) to control the device. Unlike a regular computer, an embedded system is designed to do one particular job efficiently, such as controlling a washing machine, traffic signal, microwave oven, or smart home device. During this week, I understood how embedded systems use a microcontroller to receive inputs, process information, and produce outputs.


What is an Embedded Programming
I learned that embedded programming is the process of writing code for a microcontroller to control how an embedded system works. It helps the microcontroller read inputs from sensors or buttons, process the information, and control outputs such as LEDs, motors, or displays.
During this week, I learned the basics of embedded programming using Arduino IDE and Thonny . I also understood how to write, upload, and test programs on a microcontroller board, making the hardware perform specific tasks. Embedded programming is an important part of developing smart electronic devices.
Microcontroller (MCU)
A microcontroller is a tiny computer on a single chip that controls electronic devices. It has a processor (CPU), memory, and input/output connections built into one small piece of silicon


Microprocessor (MPU)
A microprocessor is a small electronic chip that acts as the brain of a computer. It contains the CPU (Central Processing Unit), which performs calculations, makes decisions, and runs instructions from software

Microcontroller vs Microprocessor
| Feature | Microcontroller | Microprocessor |
|---|---|---|
| Definition | A small computer on a single chip used to control specific tasks | A CPU chip designed to perform general-purpose computing tasks |
| Main Components | CPU + RAM + ROM/Flash + Input/Output ports on one chip | Mainly CPU; requires external RAM, storage, and input/output devices |
| Purpose | Designed for dedicated applications | Designed for running multiple applications |
| Processing Power | Lower processing power | Higher processing power |
| Power Consumption | Uses very little power | Uses more power |
| Cost | Cheaper | More expensive |
| Size | Smaller | Larger system because extra components are needed |
| Memory | Built-in memory available | Usually needs external memory |
| Operating System | Usually runs without an OS or with a small real-time OS | Runs full operating systems like Windows, Linux, or macOS |
| Speed | Moderate speed | Higher speed |
| Applications | Washing machines, robots, toys, smart sensors, remote controls | Laptops, desktops, servers, smartphones |
| Examples | Arduino (ATmega chips), STM32, PIC, ESP32 | Intel Core processors, AMD Ryzen, Apple M-series |
Microcontroller Families
| Microcontroller Family | Simple Description | Main Features | Common Uses |
|---|---|---|---|
| AVR | A beginner-friendly microcontroller family | 8-bit, easy programming, low cost | Arduino boards, small robots |
| PIC | A flexible and reliable family made by Microchip | Many sizes, low cost, many built-in features | Industrial control, appliances, embedded systems |
| ARM | A powerful processor family used in modern devices | 32-bit/64-bit, high speed, efficient | Smartphones, IoT, advanced embedded systems |
| 8051 | One of the oldest microcontroller families | Simple 8-bit design, easy to understand | Education, basic control systems |
| MSP430 | A low-power microcontroller family | Very low energy use, 16-bit | Battery-powered devices, sensors |
| STM32 | A popular ARM-based microcontroller family by STMicroelectronics | 32-bit, fast, many peripherals | Industrial devices, drones, IoT, robotics |
| ESP Series | Wi-Fi/Bluetooth-enabled microcontrollers by Espressif Systems | Built-in wireless communication, low cost | Smart home, IoT devices, connected gadgets |
| RP Series | Microcontroller family by Raspberry Pi Foundation (example: RP2040) | Dual-core ARM Cortex-M, programmable I/O | DIY electronics, education, embedded projects |
Group Assignment
As a group, We Studied the microcontroller datasheet to understand its pin configuration, GPIO functions, memory, communication interfaces, and electrical characteristics.we explored and compared the development workflows of different embedded platforms, including Arduino Uno, ESP32-WROOM, ESP32-C3, Seeed XIAO RP2040 and Raspberry Pi Pico. We evaluated the software environments, programming languages, board setup procedures, code compilation, firmware uploading for each platform.
Comparison between Micro-controllers
| Parameters | Arduino Uno | ESP32 WROOM | Seeed Studio XIAO ESP32-C3 | Seeed Studio XIAO RP2040 | Raspberry Pi Pico |
|---|---|---|---|---|---|
| Microcontroller | ATmega328P | ESP32-D0WD | ESP32-C3 | RP2040 | RP2040 |
| Core | 8-bit AVR | Dual-core Xtensa LX6 | Single-core RISC-V | Dual-core ARM Cortex-M0+ | Dual-core ARM Cortex-M0+ |
| Architecture | AVR 8-bit | 32-bit | 32-bit RISC-V | 32-bit ARM | 32-bit ARM |
| Clock Speed | 16 MHz | 240 MHz | 160 MHz | 133 MHz | 133 MHz |
| Operating Voltage | 5V | 3.3V | 3.3V | 3.3V | 3.3V |
| GPIO Voltage | 5V | 3.3V | 3.3V | 3.3V | 3.3V |
| Digital GPIO | 14 pins | 34 pins | 11 pins | 11 pins | 26 pins |
| PWM | 6 pins | 16 channels | 6 channels | 16 channels | 16 channels |
| Analog Input | 6 channels (10-bit ADC) | 18 channels (12-bit ADC) | 4 channels (12-bit ADC) | 4 channels (12-bit ADC) | 3 ADC channels |
| Communication | UART, SPI, I2C | UART, SPI, I2C, CAN | UART, SPI, I2C | UART, SPI, I2C | UART, SPI, I2C |
| WiFi | No | Yes | Yes | No | No |
| Bluetooth | No | Yes | Yes (BLE) | No | No |
| Programming Language | C/C++, Arduino IDE | C/C++, MicroPython, Arduino IDE | C/C++, MicroPython, Arduino IDE | C/C++, MicroPython | C/C++, MicroPython |
| On-board LED Pin | Pin 13 | GPIO 2 | GPIO 10 | GPIO 25 | GPIO 25 |
| Flash Memory | 32 KB | 4 MB | 4 MB | 2 MB | 2 MB |
| RAM | 2 KB | 520 KB | 400 KB | 264 KB | 264 KB |
| USB Interface | USB-B | Micro USB | USB-C | USB-C | Micro USB |


Components and development workflow
| Parameter | Arduino Uno | ESP32-WROOM | Seeed Studio XIAO ESP32-C3 | Seeed Studio XIAO ESP32 RP2040 | Raspberry Pi Pico |
|---|---|---|---|---|---|
| Compiler | AVR-GCC | Xtensa GCC / ESP-IDF GCC | RISC-V GCC | ARM GCC | ARM GCC |
| Uploader Tool | avrdude | esptool.py | esptool.py | UF2 bootloader / drag-and-drop USB | UF2 bootloader / drag-and-drop USB |
| Firmware Format | HEX (.hex) | Binary (.bin) | Binary (.bin) | UF2 (.uf2), BIN | UF2 (.uf2), BIN |
| Connection Type | USB-to-Serial (ATmega16U2), UART, SPI, I²C | Wi-Fi, Bluetooth, UART, SPI, I²C, USB-UART | Wi-Fi, Bluetooth LE, USB, UART, SPI, I²C | USB, UART, SPI, I²C | USB, UART, SPI, I²C |
| Wireless Capability | None (requires external module) | Wi-Fi + Bluetooth | Wi-Fi + Bluetooth LE | None built-in | None built-in |
| Operating System Support | Bare-metal / simple scheduler | FreeRTOS, Bare-metal | FreeRTOS, Bare-metal | Bare-metal, MicroPython runtime | Bare-metal, MicroPython runtime |



Conclusion
Arduino Uno: Best for beginners and basic electronics projects.
ESP32 WROOM: Best for IoT applications requiring WiFi and Bluetooth.
XIAO ESP32-C3: Best for compact IoT and low-power projects.
XIAO RP2040: Best for small embedded systems and wearable applications.
Raspberry Pi Pico: Best for learning embedded programming and advanced microcontroller projects.
Overall, we understood that the best board depends on the needs of the project, such as speed, connectivity, size, and power consumption.
Microcontrollers & their datasheets overview
1.Arduino UNO
Arduino Uno is a microcontroller board based on the ATmega328P. It is used to control electronic devices such as LEDs, motors, sensors, and buzzers. It can be programmed using the Arduino IDE through a USB cable. Arduino Uno is widely used for learning electronics, robotics, and automation projects because it is simple, low-cost, and easy to use.

Embedded programming with Arduino UNO
Installation of Arduino IDE
Step 1-First, I google Download Arduino IDE For Windows.Then I Go to the Arduino official website.

Step 2- I Choose computer’s operating system (Windows).Download the Arduino IDE file.

Step 3- Install the setup by clicking Next and Install.

Arduino IDE is downloaded from the Arduino website and installed on the computer to write and upload programs to the Arduino board.

Binary Number System
The binary number system is a base-2 number system that uses only the two digits 0 and 1.It is the language that computers and microcontrollers use to process and store data.
In binary:
- 0 means OFF or Low.
- 1 means ON or High.
Example
- Decimal 0 = Binary 0
- Decimal 1 = Binary
- Decimal 3 = Binary 11
- Decimal 4 = Binary 100
| Power | Value |
|---|---|
| 2⁰ | 1 |
| 2¹ | 2 |
| 2² | 4 |
| 2³ | 8 |
| 2⁴ | 16 |
| 2⁵ | 32 |
| 2⁶ | 64 |
| 2⁷ | 128 |
| 2⁸ | 256 |
| 2⁹ | 512 |
| 2¹⁰ | 1024 |
| 2¹¹ | 2048 |
| 2¹² | 4096 |
Real-Life Examples
- Light Switch
- 0 = Light OFF
- 1 = Light ON
- LED
- 0 = LED OFF
- 1 = LED ON
1. Decimal to Binary
Method: Divide the decimal number by 2 repeatedly and write the remainders. Read the remainders from bottom to top.
Example: Convert 13 to binary.
| Division | Remainder |
|---|---|
| 13 ÷ 2 = 6 | 1 |
| 6 ÷ 2 = 3 | 0 |
| 3 ÷ 2 = 1 | 1 |
| 1 ÷ 2 = 0 | 1 |
Read the remainders from bottom to top:
13₁₀ = 1101₂
- 13₁₀ means 13 in the decimal (base-10) number system.
- 1101₂ means 1101 in the binary (base-2) number system.
2. Binary to Decimal
Method: Multiply each binary digit by its corresponding power of 2 and add the results.
Example: Convert 1101 to decimal.
| Binary | 1 | 1 | 0 | 1 |
|---|---|---|---|---|
| Power of 2 | 2³ | 2² | 2¹ | 2⁰ |
| Value | 8 | 4 | 2 | 1 |
Calculation:
(1 × 8) + (1 × 4) + (0 × 2) + (1 × 1) = 13
1101₂ = 13₁₀
- 1101₂ is the number 1101 in the binary (base-2) number system.
- 13₁₀ is the number 13 in the decimal (base-10) number system
Short Summary
- Decimal → Binary: Divide by 2, write the remainders, and read them from bottom to top.
- Binary → Decimal: Multiply each binary digit by its power of 2 and add the values.
Hexadecimal Number System
Hexadecimal is commonly used in computers, programming, and digital electronics because it provides a shorter way to represent binary numbers.The hexadecimal number system is a base-16 number system. It uses 16 symbols to represent numbers:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Here:
- A = 10
- B = 11
- C = 12
- D = 13
- E = 14
- F = 15
Example
1.Hexadecimal to Decimal
Convert 2F₁₆ to decimal:
Hex digits: 2 and F
(F = 15)
= (2 *16^1) + (15 *16^0)
= (2*16) + (15*1)
= 32 + 15 = 47
Answer: 2F₁₆ = 47₁₀
2.Decimal to Hexadecimal
Convert 255₁₀ to hex:
Divide by 16:
=255 \div 16 = 15 remainder 15
15 in hex is F.
Answer: 255₁₀ = FF₁₆
| Power | Value |
|---|---|
| 16⁰ | 1 |
| 16¹ | 16 |
| 16² | 256 |
| 16³ | 4,096 |
| 16⁴ | 65,536 |
| 16⁵ | 1,048,576 |
| Prefix | Number System | Base | Example |
|---|---|---|---|
0b | Binary | 2 | 0b1010 = 10 (decimal) |
0x | Hexadecimal | 16 | 0xA = 10 (decimal) |
Binary & Hexadecimal coding in Arduino UNO





2.ESP32-Wroom
ESP32-WROOM is a powerful microcontroller module developed by Espressif Systems. It has built-in Wi-Fi and Bluetooth connectivity, making it ideal for Internet of Things (IoT) and wireless communication projects. The module is based on a 32-bit dual-core processor, offers low power consumption, and includes multiple GPIO pins for connecting sensors, motors, LEDs, and other electronic devices. It can be programmed using the Arduino IDE, ESP-IDF, or MicroPython. ESP32-WROOM is widely used in smart home automation, robotics, weather monitoring, industrial automation, and other embedded system applications because of its high performance, reliability, and ease of use.

Pinout of ESP32-Wroom

Installation of Thonny
Step 1-First,I opened a web browser and searched for Thonny download for windows

Step 2-I opened the official Thonny website.Then I clicked the Download for Windows button.



Step 3- Thonny is install successfully,Then I set the interpreter and port Finally, the installation was completed, and Thonny IDE was ready to use for programming the microcontroller board using MicroPython.


Embedded programming in ESP32-Wroom
Interpreter settings in Thonny configured for an ESP32 board. The interpreter is set to MicroPython (ESP32), and the board is connected to the port COM14. The selected variant is Espressif – ESP32/WROOM.This configuration allows Thonny to communicate with the ESP32.

The installation process is in progress, with the firmware being written to the ESP32 board. Once the installation is complete, the ESP32 is ready to run MicroPython programs through Thonny IDE.

MicroPython Code to Blink the Onboard LED
from machine import Pinfrom time import sleepled = Pin(2, Pin.OUT) # Onboard LED (GPIO 2)while True: led.on() # Turn LED ON sleep(1) # Wait for 1 second led.off() # Turn LED OFF sleep(1) # Wait for 1 second


3.XIAO ESP32 C3
XIAO ESP32-C3 is a compact and low-power microcontroller board developed by Seeed Studio. It is based on the ESP32-C3 chip, which features a 32-bit single-core RISC-V processor with built-in Wi-Fi and Bluetooth Low Energy (BLE). Despite its small size, it provides multiple GPIO pins, ADC, PWM, UART, I²C, and SPI interfaces for connecting sensors and other electronic devices. It can be programmed using the Arduino IDE, ESP-IDF, or MicroPython. The XIAO ESP32-C3 is widely used in IoT, smart home automation, wireless sensor networks, wearable devices, and embedded system projects because of its compact design, low power consumption, and reliable wireless connectivity.

Pinout of XIAO ESP32 C3

4.XIAO RP2040
XIAO RP2040 is a compact and powerful microcontroller board developed by Seeed Studio. It is based on the RP2040 microcontroller from the Raspberry Pi Foundation, featuring a dual-core ARM Cortex-M0+ processor. Despite its small size, it provides multiple GPIO pins, analog inputs, PWM, I²C, SPI, and UART communication interfaces. It can be programmed using the Arduino IDE, MicroPython, or C/C++. The XIAO RP2040 is widely used in IoT devices, wearable electronics, robotics, embedded systems, and DIY projects because of its compact design, low power consumption, and high performance.

Pinout of XIAO RP2040

Embedded programming with XIAO RP2040 (Blinking RGB Led)
1.First i open Arduino IDE
2.Then go to file tool choose preferances paste the link
Board Manager URL for the Arduino IDE

3.Then i open Tools → Board → Boards Manager. Searched RP2040. Install Raspberry Pi Pico/RP2040 (Earle Philhower)→Seeed XIAO RP2040.Then i select correct COM port

4.Then i Go to Sketch → Include Library → Manage Libraries.

5.Searched Adafruit NeoPixel.Click Install.This library is used to control the onboard NeoPixel RGB LED.

6.Very & Compile the code to the XIAO RP2040.Then I Open Serial Monitor
The program waits for a color name from the Serial Monitor and changes the onboard NeoPixel to that color

7.Type a supported color and press Enter.




Code
#include <Adafruit_NeoPixel.h>#define NEOPIXEL_POWER 11#define NEOPIXEL_PIN 12#define NUMPIXELS 1Adafruit_NeoPixel pixel(NUMPIXELS, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);void setup() { Serial.begin(115200); // Enable power to the onboard NeoPixel pinMode(NEOPIXEL_POWER, OUTPUT); digitalWrite(NEOPIXEL_POWER, HIGH); pixel.begin(); pixel.clear(); pixel.show(); Serial.println("====================================="); Serial.println(" XIAO RP2040 NeoPixel Color Control "); Serial.println("====================================="); Serial.println("Type one of these colors:"); Serial.println("red"); Serial.println("green"); Serial.println("blue"); Serial.println("orange"); Serial.println("gold"); Serial.println("lime"); Serial.println("purple"); Serial.println("violet"); Serial.println("pink"); Serial.println("brown"); Serial.println("white"); Serial.println("off"); Serial.println("-------------------------------------");}void loop() { if (Serial.available()) { String color = Serial.readStringUntil('\n'); color.trim(); color.toLowerCase(); if (color == "red") { pixel.setPixelColor(0, pixel.Color(255, 0, 0)); } else if (color == "green") { pixel.setPixelColor(0, pixel.Color(0, 255, 0)); } else if (color == "blue") { pixel.setPixelColor(0, pixel.Color(0, 0, 255)); } else if (color == "orange") { pixel.setPixelColor(0, pixel.Color(255, 165, 0)); } else if (color == "gold") { pixel.setPixelColor(0, pixel.Color(255, 215, 0)); } else if (color == "lime") { pixel.setPixelColor(0, pixel.Color(50, 205, 50)); } else if (color == "purple") { pixel.setPixelColor(0, pixel.Color(128, 0, 128)); } else if (color == "violet") { pixel.setPixelColor(0, pixel.Color(148, 0, 211)); } else if (color == "pink") { pixel.setPixelColor(0, pixel.Color(255, 105, 180)); } else if (color == "brown") { pixel.setPixelColor(0, pixel.Color(165, 42, 42)); } else if (color == "white") { pixel.setPixelColor(0, pixel.Color(255, 255, 255)); } else if (color == "off") { pixel.clear(); } else { Serial.println("Unknown color!"); Serial.println("Available colors:"); Serial.println("red, green, blue, orange, gold, lime, purple, violet, pink, brown, white, off"); return; } pixel.show(); Serial.print("LED Color: "); Serial.println(color); }}
5.Raspberry Pi pico
Raspberry Pi Pico is a low-cost and high-performance microcontroller board developed by the Raspberry Pi Foundation. It is based on the RP2040 microcontroller, which features a dual-core ARM Cortex-M0+ processor. The board has multiple GPIO pins that allow it to connect to sensors, LEDs, motors, and other electronic components. It can be programmed using MicroPython, C/C++, or the Arduino IDE. Raspberry Pi Pico is widely used in embedded systems, robotics, home automation, IoT projects, and educational applications because it is affordable, easy to program, and offers excellent performance with low power consumption.

Pinout of Raspberry Pi Pico

Embedded programming with Raspberry Pi Pico
Blinking one external LED using a Raspberry Pi Pico
First, I soldered the header pins onto the Raspberry Pi Pico so that it could be connected securely to a breadboard and other electronic components. Next, I connected the Raspberry Pi Pico to my computer using a USB cable.
1.Placed the Raspberry Pi Pico on a breadboard.
2.Connected the anode (positive terminal) of the LED to GPIO 15 through a 220 Ω resistor.
3.Connected the cathode (negative terminal) of the LED to the GND pin of the Raspberry Pi Pico.
4.Connected the Raspberry Pi Pico to the computer using a USB cable.


5.Opened the Arduino IDE.
6.Selected Raspberry Pi Pico as the board from the Tools → Board menu.
7.Selected the correct COM port from the Tools → Port menu.
8.Wrote the LED blink program in the Arduino IDE.
9.Clicked the Upload button to compile and upload the program to the Raspberry Pi Pico.
10.Observed that the LED connected to GPIO 15 blinked continuously with a one-second delay.
C++ Code to Blink the External LED
// LED Blink Program (LED connected to Pin 15)const int ledPin = 15;void setup() { pinMode(ledPin, OUTPUT); // Set pin 15 as output}void loop() { digitalWrite(ledPin, HIGH); // Turn LED ON delay(100); // Wait for 1 second digitalWrite(ledPin, LOW); // Turn LED OFF delay(100); // Wait for 1 second}

