Embedded Programming
This week we dove into the world of embedded programming — the process of developing software that directly controls physical hardware. We explored what microcontrollers are, how they work internally, and how to program them using different development boards and toolchains. We compared development boards, read datasheets, and wrote our first programs to interact with input and output devices. It was a foundational week that bridges hardware and software in a very hands-on way.
Embedded programming is the process of developing software that controls physical electronic devices (hardware), especially microcontrollers, which act as the brain of the system. An embedded system is made up of three main components: sensors, a microcontroller, and actuators.
Sensors capture information from the environment. The microcontroller plays the central role: it receives that data, processes it according to the loaded program, and makes logical decisions in real time. Finally, the actuators carry out the corresponding physical action — such as turning on a motor, activating a light, or moving a mechanism.
Capture information from the physical environment
Processes data and makes real-time logical decisions
Execute the corresponding physical action
A microcontroller is a complete system integrated into a single chip. It is important to distinguish it from a development board: the development board is the physical PCB (printed circuit board) that surrounds and supports the microcontroller chip, adding connectors, voltage regulators, USB ports, and other components that make it easy to program and prototype with. The microcontroller itself is just the chip — the brain — while the development board is the full tool you hold in your hands.
Internally, the microcontroller chip is made up of a microprocessor (CPU) that includes the ALU (Arithmetic Logic Unit), registers, and a control unit — all responsible for executing instructions and performing mathematical and logical operations.
In addition, the microcontroller integrates different types of memory:
It also incorporates peripherals such as:
The operation depends on an oscillator (sometimes with a quartz crystal) that generates the clock signal to synchronize all operations.
Thanks to this integration, the microcontroller can receive digital signals (0 and 1, like a button press) or analog signals (such as temperature or light), process them, and generate a corresponding action.
Microcontrollers on their own do not directly understand programming languages — they only understand binary language (0s and 1s). However, they can be programmed using Assembly, C, C++, MicroPython, and more.
Since it was our first time reading a microcontroller datasheet, our instructor gave us a quick explanation using the pin diagram (pinout) of the Raspberry Pi Pico 2 W as an example. With that diagram, we learned how to interpret what each label means, how to identify the function of each pin, and how to read this type of schematic.
Instructor explaining the pinout diagram of the Raspberry Pi Pico 2 W
The Raspberry Pi Pico 2 W is a development board with integrated WiFi, which allows it to be used in IoT (Internet of Things) projects — devices that can connect to the internet to send and receive data.
The board operates at 3.3V, so its pins deliver that same voltage. Although it can be powered with 5V from a laptop via USB, it includes a voltage regulator that steps it down to 3.3V for internal operation.
Its GPIO pins can be configured as digital inputs or outputs. It cannot directly measure analog signals; for that, it uses an ADC (analog-to-digital converter) that transforms the analog signal into digital data the microcontroller can process. It also supports communication protocols such as SPI, I2C, and UART for connecting to other devices. The red pin typically indicates 3.3V (positive) and the black corresponds to GND.
| Feature | Specification |
|---|---|
| Main MCU | RP2350 (ARM Cortex-M33 dual-core) |
| Total Pins | 40 (38 GPIO — 19 on each side) |
| Digital GPIO | Up to 30 programmable pins |
| PWM | 16 hardware channels |
| Analog (ADC) | 12-bit ADC |
| SPI | 2 buses |
| I2C | 2 buses |
| UART | 2 ports |
| Wireless | WiFi + Bluetooth (CYW43439) |
| Flash / RAM | 4 MB Flash / 520 KB SRAM |
The RP2350 is a 32-bit ARM Cortex-M33 dual-core microcontroller. It is designed for higher performance and security compared to previous RP2040 versions. It includes programmable I/O blocks (PIO), which allow custom hardware communication protocols to be implemented in software.
| Feature | Specification |
|---|---|
| Architecture | ARM Cortex-M33 (dual-core) |
| Frequency | Up to 150 MHz |
| SRAM | Up to 520 kB |
| Flash | External (typically 4 MB) |
| ADC | 12-bit |
| PWM | 16 channels |
| PIO | 2 programmable I/O blocks |
The Pico 2 W integrates the CYW43439 module for wireless communication, enabling WiFi and Bluetooth Low Energy connectivity.
| Feature | Specification |
|---|---|
| WiFi | 802.11 b/g/n (2.4 GHz) |
| Bluetooth | BLE 5.2 |
| Operating Voltage | 3.3V |
The Raspberry Pi Pico 2 W combines modern ARM architecture with integrated wireless communication. Its dual-core design and programmable I/O (PIO) blocks provide flexibility for advanced hardware control. It supports both traditional C/C++ development and alternative environments such as MicroPython.
The process starts by writing code in MicroPython using Thonny. The Pico 2 W also accepts C/C++ with the official SDK, but Thonny with MicroPython is more direct. Once the code is written, Thonny automatically uploads it to the board via USB without needing to compile or generate intermediate files. The board executes the program instantly, and results appear in the integrated Thonny console where errors can be seen and corrected without disconnecting anything.
| Step | Description |
|---|---|
| 1. Write code | In C/C++ (official SDK) or MicroPython from VS Code or Thonny |
| 2. Compile | ARM GCC compiler translates the code into RP2350 language |
| 3. Generate binary | A .uf2 file ready to upload is produced |
| 4. Flash | Press BOOTSEL + USB, Pico appears as a storage drive, drag the .uf2 |
| 5. Execute | The board restarts automatically and runs the program |
| 6. Monitor | View results via VS Code or Thonny serial monitor |
The Pico 2 W supports two paths: C/C++ with the official SDK (requiring ARM GCC, CMake, and generating a .uf2 file) or MicroPython with Thonny, which simplifies everything. With Thonny, the MicroPython firmware is flashed once to the board from within the program. From that point, Thonny acts as the entire toolchain: editor, uploader, and serial monitor in one tool — no external compiler or .uf2 files needed. Code is sent directly to the Pico via USB and runs immediately. It is the ideal workflow for rapid prototyping while maintaining full access to all RP2350 functions including GPIO, ADC, PWM, I2C, SPI, UART, and WiFi.
| Tool | Purpose |
|---|---|
| Pico SDK | Official library to access RP2350 pins and functions |
| ARM GCC | Compiles code for the Cortex-M33 processor |
| CMake + Make | Organizes and builds the project |
| UF2 Format | Firmware file loaded via USB without extra hardware |
| VS Code + Pico Extension | Recommended IDE; configures and compiles with one click |
| Thonny | MicroPython IDE; simpler and more direct |
| OpenOCD / SWD | Advanced debugging using a second Pico as debugger |
The Arduino UNO R4 WiFi is an upgraded version of the classic UNO platform. It is designed for embedded programming, rapid prototyping, and IoT applications. This board integrates a powerful 32-bit microcontroller and a WiFi/Bluetooth module, making it suitable for both control systems and wireless communication.
| Category | Function |
|---|---|
| Digital | ON/OFF control signals |
| PWM | Power control (motors, LEDs) |
| Analog | Voltage reading |
| I2C | 2-wire communication |
| SPI | High-speed communication |
| UART | Serial TX/RX |
| Power | 5V system supply |
| Main MCU | R7FA4M1AB3CFM#AA0 |
The R7FA4M1AB3CFM#AA0 is a 32-bit ARM Cortex-M4 based microcontroller. It operates at 5V logic level for compatibility with previous Arduino shields. It includes internal memory, ADC, DAC, timers, and advanced communication interfaces for industrial and embedded applications.
| Feature | Specification |
|---|---|
| Flash | 256 kB |
| SRAM | 32 kB |
| Data Flash | 8 kB (EEPROM) |
| ADC | 14-bit |
| DAC | Up to 12-bit |
| CAN | Yes |
| DMAC | 4 channels |
The ESP32-S3 module acts as a secondary processor dedicated to wireless communication. It operates at 3.3V and communicates with the main MCU through a logic-level translator.
| Feature | Specification |
|---|---|
| WiFi | 2.4 GHz (802.11 b/g/n) |
| Bluetooth | BLE 5 |
| SRAM | 512 kB |
| ROM | 384 kB |
| Operating Voltage | 3.3V |
The Arduino UNO R4 WiFi represents a significant evolution from the classic UNO architecture. With a 32-bit ARM Cortex-M4 microcontroller and integrated wireless capabilities, it bridges the gap between beginner-friendly boards and more advanced embedded systems.
The process starts by writing code in C/C++ from the Arduino IDE, the main tool for programming this board. Unlike the Raspberry Pi Pico, Arduino uses its own environment that greatly simplifies the process. Once the sketch is written, the IDE compiles it automatically using an ARM GCC compiler adapted for the Cortex-M4. The result is loaded directly to the board via USB with a single click — no button pressing or file dragging needed. The board runs the program immediately and results are monitored in the integrated Arduino IDE Serial Monitor.
| Step | Description |
|---|---|
| 1. Write code | In C/C++ from the Arduino IDE (called a "sketch") |
| 2. Compile | Arduino IDE uses ARM GCC to translate code for the Cortex-M4 |
| 3. Generate binary | A .hex or .bin file ready to upload is produced |
| 4. Flash | Loaded directly via USB with one click from the IDE |
| 5. Execute | The board restarts automatically and runs the program |
| 6. Monitor | Results visible in the Arduino IDE Serial Monitor |
The toolchain for the Arduino UNO R4 WiFi is designed to be as simple and accessible as possible. The Arduino IDE concentrates almost the entire toolchain into one tool: editor, compiler, uploader, and serial monitor. Internally it uses the ARM GCC compiler to translate C/C++ code for the Cortex-M4 processor. The Arduino Core for Renesas provides all the libraries and drivers needed to access pins, WiFi, Bluetooth, and other board functions. The program is loaded via USB using the integrated bootloader, with no additional hardware required.
| Tool | Purpose |
|---|---|
| Arduino IDE | Main environment: editor, compiler, and uploader in one |
| ARM GCC | Compiles C/C++ code for the Cortex-M4 processor |
| Arduino Core (Renesas) | Official libraries and drivers for all pins and modules |
| USB Bootloader | Loads programs directly via USB without extra hardware |
| Serial Monitor | Displays program results in real time |
| VS Code + PlatformIO | Advanced alternative with more control over compilation and debugging |
| WiFiS3 Library | Official library to control the ESP32-S3 module from code |
The Arduino UNO R3 is one of the most popular development boards for learning embedded systems. It is widely used in education and beginner projects to control LEDs, sensors, motors, and other electronic components. It provides a simple and accessible way to understand how hardware and software interact.
| Feature | Specification |
|---|---|
| Digital Pins | 14 |
| PWM | 6 |
| Analog Inputs | 6 |
| Operating Voltage | 5V |
| Main MCU | ATmega328P |
The ATmega328P is an 8-bit AVR microcontroller running at 16 MHz. It is simple, efficient, and widely supported. It integrates memory, timers, ADC, and communication interfaces in a single chip.
| Feature | Specification |
|---|---|
| Architecture | 8-bit AVR |
| Flash Memory | 32 kB |
| SRAM | 2 kB |
| EEPROM | 1 kB |
| ADC Resolution | 10-bit |
| Clock Frequency | 16 MHz |
The Arduino UNO R3 is an ideal board for understanding the fundamentals of embedded systems. Its 8-bit architecture and simple development workflow make it highly suitable for beginners and educational environments. Although it has limited memory and processing power compared to modern boards, it remains a classic reference platform.
The code is written in C/C++ from the Arduino IDE. Upon clicking Upload, the AVR-GCC compiler translates it to a .hex file and AVRDUDE loads it into the ATmega328P's Flash memory through the bootloader via USB. The board restarts automatically, executes the program, and results are visible in the Serial Monitor.
| Step | Description |
|---|---|
| 1. Write code | In C/C++ from the Arduino IDE (called a "sketch") |
| 2. Compile | AVR-GCC translates code to instructions for the 8-bit ATmega328P |
| 3. Generate binary | A .hex file ready to upload is produced |
| 4. Flash | AVRDUDE communicates with the bootloader via USB and writes the .hex to Flash |
| 5. Execute | The board restarts automatically and runs the program |
| 6. Monitor | Results visible in the Arduino IDE Serial Monitor |
The Arduino IDE concentrates the entire toolchain into one tool. It uses AVR-GCC to compile for the 8-bit AVR architecture and AVRDUDE to transfer the program to the chip via the pre-flashed bootloader. No external hardware or additional configuration is required. Its only limitation is the lack of on-chip debugging, so errors can only be detected through the Serial Monitor.
| Tool | Purpose |
|---|---|
| Arduino IDE | Main environment: editor, compiler, and uploader in one |
| AVR-GCC | Compiles C/C++ code for the 8-bit AVR architecture of the ATmega328P |
| AVRDUDE | Transfers the .hex file to the microcontroller via USB and bootloader |
| Bootloader (pre-flashed) | Allows loading programs via USB without external programmer hardware |
| Arduino Core Libraries | Libraries that simplify access to pins, ADC, timers, and UART |
| Serial Monitor | Displays program results in real time |
The Seeeduino XIAO nRF52840 is a compact and powerful development board designed for IoT and Bluetooth applications. Despite its small size, it integrates wireless communication and advanced low-power features.
| Feature | Specification |
|---|---|
| Digital Pins | Up to 14 |
| Analog Inputs | Yes (12-bit ADC) |
| PWM | Yes |
| USB | Native USB |
| Main MCU | nRF52840 |
The nRF52840 is a 32-bit ARM Cortex-M4F microcontroller optimized for wireless communication and low-power applications. It integrates Bluetooth and advanced peripherals for IoT systems.
| Feature | Specification |
|---|---|
| Architecture | ARM Cortex-M4F (32-bit) |
| Flash Memory | 1 MB |
| RAM | 256 kB |
| ADC Resolution | 12-bit |
| Bluetooth | BLE 5.0 |
| USB | Full-speed USB 2.0 |
The Seeeduino XIAO nRF52840 is a compact and powerful development board based on a 32-bit ARM Cortex-M4 microcontroller with integrated Bluetooth Low Energy (BLE). Despite its small size, it offers strong processing capabilities and low power consumption.
The code is written in C/C++ from the Arduino IDE after installing the Seeed nRF52 Boards package. It also accepts MicroPython and CircuitPython. Upon clicking Upload, ARM GCC translates the code to instructions for the Cortex-M4F and transfers it to the chip via UF2 bootloader over USB-C. If the board is unresponsive, a double-click on the reset button activates USB storage mode to reactivate the port. The board executes the program immediately and results appear in the Serial Monitor.
| Step | Description |
|---|---|
| 1. Write code | In C/C++ (Arduino IDE), MicroPython, or CircuitPython |
| 2. Compile | ARM GCC translates code for the Cortex-M4F at 64 MHz |
| 3. Generate binary | A .hex / .uf2 file ready to upload is produced |
| 4. Flash | Loaded via USB-C bootloader; double reset for storage mode if needed |
| 5. Execute | The board restarts automatically and runs the program |
| 6. Monitor | Results visible in the Arduino IDE Serial Monitor |
| Tool | Purpose |
|---|---|
| Arduino IDE | Main environment: editor, compiler, and uploader in one |
| ARM GCC | Compiles C/C++ code for the Cortex-M4F at 64 MHz |
| Seeed nRF52 Boards | Official library for BLE and low-power functions |
| Seeed nRF52 mbed-enabled | Library for Machine Learning (TinyML) and advanced sensors |
| UF2 Bootloader | Loads program via USB-C without external programmer hardware |
| Serial Monitor | Displays program results in real time |
| VS Code + PlatformIO | Advanced alternative with more control over compilation and debugging |
| SWD + JLink | Advanced on-chip debugging to inspect the program during execution |
The ESP32 development board is designed for IoT and wireless applications. It integrates a powerful dual-core processor and built-in WiFi and Bluetooth. It operates at 3.3V logic level and is widely used for smart devices, home automation, and wireless control systems.
| Feature | Specification |
|---|---|
| Digital GPIO | Up to 34 pins |
| PWM | Hardware PWM (LEDC) |
| Analog | 12-bit ADC |
| DAC | 2 channels (8-bit) |
| SPI | 4 buses |
| I2C | 2 buses |
| UART | 3 ports |
| Main MCU | Xtensa LX6 |
| Wireless | WiFi + Bluetooth |
The ESP32 uses a 32-bit dual-core Xtensa LX6 architecture. It is optimized for wireless communication and real-time applications. It integrates advanced peripherals, hardware encryption, and deep sleep modes for low power consumption.
| Feature | Specification |
|---|---|
| Architecture | Xtensa LX6 (dual-core) |
| Frequency | Up to 240 MHz |
| SRAM | 520 kB |
| Flash | External (usually 4 MB) |
| ADC | 12-bit |
| DAC | 2x 8-bit |
| WiFi | Integrated |
| Bluetooth | Classic + BLE |
The ESP32 is a powerful dual-core microcontroller designed for IoT and wireless applications. Its integrated WiFi and Bluetooth capabilities make it ideal for connected systems. Compared to traditional Arduino boards, it offers significantly higher processing speed and memory, allowing for more complex and real-time applications.
The code is written in C/C++ from the Arduino IDE with the ESP32 by Espressif package, or using ESP-IDF for advanced projects. The Xtensa GCC compiler translates it for the dual-core Xtensa LX6 processor and generates a .bin file. The esptool.py tool loads it via USB, sometimes requiring the BOOT button to be held during flashing. The board restarts automatically and results appear in the Serial Monitor.
| Step | Description |
|---|---|
| 1. Write code | In C/C++ (Arduino IDE or ESP-IDF) or MicroPython |
| 2. Compile | Xtensa GCC translates code for the dual-core Xtensa LX6 at 240 MHz |
| 3. Generate binary | A .bin file ready to load into external Flash is produced |
| 4. Flash | esptool.py transfers the binary via USB; may require pressing BOOT during upload |
| 5. Execute | The board restarts automatically and runs the program |
| 6. Monitor | Results visible in the Arduino IDE or ESP-IDF Serial Monitor |
| Tool | Purpose |
|---|---|
| Arduino IDE + ESP32 Core | Accessible environment with WiFi, BT, and dual-core support in Arduino syntax |
| Xtensa GCC | Compiles C/C++ code for the Xtensa LX6 dual-core architecture at 240 MHz |
| esptool.py | Official Espressif tool to load firmware to Flash via USB |
| ESP-IDF | Professional framework with full chip access: FreeRTOS, dual-core, low power |
| FreeRTOS | Integrated real-time OS; allows tasks to run on both cores simultaneously |
| VS Code + PlatformIO | Advanced alternative compatible with Arduino and ESP-IDF |
| Serial Monitor | Displays program results in real time |
The Arduino Nano offers similar functionality to the UNO but in a much smaller form factor. It is commonly used in compact or space-limited projects, such as wearable devices or small embedded prototypes. It allows users to control electronic components while maintaining a minimal physical size.
| Feature | Specification |
|---|---|
| Digital Pins | 14 |
| PWM | 6 |
| Analog Inputs | 8 |
| Operating Voltage | 5V |
| Main MCU | ATmega328P |
The Arduino Nano uses the same 8-bit AVR ATmega328P microcontroller found in the Arduino UNO R3. It runs at 16 MHz and includes internal Flash memory, SRAM, EEPROM, ADC, timers, and communication interfaces.
| Feature | Specification |
|---|---|
| Architecture | 8-bit AVR |
| Flash | 32 kB |
| SRAM | 2 kB |
| EEPROM | 1 kB |
| ADC | 10-bit |
| Frequency | 16 MHz |
Although both boards use the same microcontroller, the main differences are physical size and pin layout.
| Feature | Arduino Nano | Arduino UNO R3 |
|---|---|---|
| Size | Compact | Larger board |
| USB | Mini/Micro USB | USB Type-B |
| Analog Pins | 8 | 6 |
| Shield Compatibility | No direct shield stacking | Compatible with Arduino shields |
| Form Factor | Breadboard friendly | Standard Arduino layout |
In summary, both boards behave almost identically in programming, but the Nano is preferred for compact designs, while the UNO is better for prototyping with shields.
Uses the same workflow as the UNO R3 since it shares the same ATmega328P microcontroller. The code is written in C/C++ in the Arduino IDE, AVR-GCC compiles it to a .hex file, and AVRDUDE loads it via USB through the bootloader. The board runs the program and results appear in the Serial Monitor.
| Step | Description |
|---|---|
| 1. Write code | In C/C++ from the Arduino IDE |
| 2. Compile | AVR-GCC translates code for the 8-bit ATmega328P at 16 MHz |
| 3. Generate binary | A .hex file ready to upload is produced |
| 4. Flash | AVRDUDE loads the .hex via USB through the pre-flashed bootloader |
| 5. Execute | The board restarts automatically and runs the program |
| 6. Monitor | Results visible in the Arduino IDE Serial Monitor |
| Tool | Purpose |
|---|---|
| Arduino IDE | Main environment: editor, compiler, and uploader in one |
| AVR-GCC | Compiles C/C++ code for the 8-bit AVR architecture |
| AVRDUDE | Transfers the .hex to the chip via USB and pre-flashed bootloader |
| Arduino Core Libraries | Libraries for accessing pins, ADC, timers, and UART |
| Serial Monitor | Displays program results in real time |
| Feature | UNO R3 | Nano | UNO R4 WiFi | ESP32 | Pico 2 W | XIAO nRF52840 |
|---|---|---|---|---|---|---|
| Main MCU | ATmega328P | ATmega328P | R7FA4M1 (ARM M4) | Xtensa LX6 | RP2350 | nRF52840 |
| Architecture | 8-bit AVR | 8-bit AVR | 32-bit Cortex-M4 | 32-bit Xtensa (dual-core) | 32-bit Cortex-M33 (dual-core) | 32-bit Cortex-M4F |
| Clock Speed | 16 MHz | 16 MHz | 48 MHz | Up to 240 MHz | Up to 150 MHz | 64 MHz |
| Flash Memory | 32 kB | 32 kB | 256 kB | ~4 MB | ~4 MB | 1 MB |
| SRAM | 2 kB | 2 kB | 32 kB | 520 kB | 520 kB | 256 kB |
| ADC | 10-bit | 10-bit | 14-bit | 12-bit | 12-bit | 12-bit |
| DAC | No | No | 12-bit | 2× 8-bit | No | No |
| Digital Pins | 14 | 14 | 14 | Up to 34 | Up to 30 | Up to 14 |
| Analog Inputs | 6 | 8 | 6 | Up to 18 | 3 | Yes |
| PWM | 6 | 6 | 6 | Hardware (LEDC) | 16 channels | Yes |
| I2C | 1 | 1 | 1 | 2 | 2 | 1 |
| SPI | 1 | 1 | 1 | 4 | 2 | 1 |
| UART | 1 | 1 | 2 | 3 | 2 | 1 |
| USB | USB-B | Mini USB | USB-C | Micro USB | Micro USB | USB-C (native) |
| WiFi | No | No | 2.4 GHz | 2.4 GHz | 2.4 GHz | No |
| Bluetooth | No | No | BLE 5 | Classic + BLE | BLE 5.2 | BLE 5.0 |
| Voltage | 5V | 5V | 5V | 3.3V | 3.3V | 3.3V |
| CAN Bus | No | No | Yes | No | No | No |
| Low Power | No | No | No | Deep sleep | Dormant mode | Ultra low power |
| Special Feature | Shield compat. | Compact UNO | Dual processor (MCU + ESP32-S3) | Dual-core FreeRTOS | Dual-core RISC-V compat. | Tiny size, BLE optimized |
| Best For | Education basics | Compact projects | IoT intermediate | IoT advanced / smart home | IoT WiFi connected | Wearables / low power |
| Price | ~$5 | ~$4 | ~$27 | ~$8 | ~$7 | ~$10 |
Final Decision
Having reviewed all available microcontrollers in my node, I decided to work with the ESP32 DEVKIT V4 with the ESP-WROOM-32 processor, programmed using Thonny. Its dual-core architecture, integrated WiFi and Bluetooth, high speed (240 MHz), and generous memory make it the most versatile board for the type of projects I have in mind.
Recently, specifically at the end of 2025, I took a course at Universidad del Pacífico where we learned to program in Arduino to develop a final project.
My project consisted of a smart garage — an embedded system controlled by an Arduino. It used a proximity sensor that emitted electromagnetic waves to detect when a person or vehicle was approaching, allowing the door to open or close automatically. It also incorporated a light sensor (LDR) that measured light intensity: if it was nighttime, it would turn on the light; during the day, it would turn it off. Additionally, it had a Bluetooth connection so a mobile application could function as a remote control to open and close the garage.
Smart garage project — Arduino-controlled embedded system
This experience gave me a solid foundation to start exploring other microcontrollers. However, to work with new boards it is necessary to understand the internal components and functions of microcontrollers, since they are the core of every embedded system.
ESP32 DEVKIT V4 — Full pinout reference
I identified the components that are directly relevant to my smart menstrual product dispenser.
Each block is highlighted based on its relevance to the smart menstrual dispenser. Hover to expand details.
The dual-core brain. Core 0 handles WiFi/BT stack; Core 1 runs the dispenser logic — sensor reading, motor control, stock monitoring — simultaneously.
Real-Time Clock and ultra-low-power coprocessor. Could enable deep sleep between dispensing events to save battery.
Hardware encryption for secure app communication. Protects user data and health notifications.
⚙️ GPIO & Peripherals
📡 WiFi & Bluetooth
🔁 PWM & Timers
⚡ Power Management
In the Group Assignment Toolchain section for the ESP32, I mentioned several ways to program the board. Among those options, I chose Arduino IDE + ESP32 Core — the most accessible option, which allows using WiFi, Bluetooth, and dual-core in Arduino syntax.
Here are the steps I followed to set everything up.
Connect the ESP32 to your laptop with a USB Type-C cable and open Device Manager:
In my case, I saw a yellow warning sign next to the port — this meant the driver was missing and the laptop could not correctly read the ESP32.
Yellow warning sign in Device Manager — driver missing
This confirmed that the chip is a CP2102.
Install the CP2102 Driver:
CP210xVCPInstaller_x64.exe
Silicon Labs CP210x USB to UART Bridge (COM5)
Download the Arduino IDE from: arduino.cc/en/software
I already had it installed from previous projects, so I skipped this step.
Arduino IDE — main interface
With Arduino IDE open:
Ctrl + ,)
esp32
Selecting ESP32 Dev Module from the board list
Selecting the COM5 port assigned to the ESP32
This program turns the ESP32's built-in LED on and off every second — a classic first test to confirm the setup works.
void setup() {
pinMode(2, OUTPUT);
Serial.begin(115200);
}
void loop() {
digitalWrite(2, HIGH); // LED on
Serial.println("Hola"); // Print Hola
delay(1000); // wait 1 second
digitalWrite(2, LOW); // LED off
Serial.println("Adios"); // Print Adios
delay(1000); // wait 1 second
}
📤 How to upload:
Connecting.... appear
Successful upload and the ESP32 LED blinking
En mi universidad llevé el curso de Física, donde nos enseñaron a programar en Arduino IDE. Gracias a eso adquirí un amplio conocimiento sobre códigos generales y el manejo de componentes especiales como pantallas LCD, sensores PIR de movimiento, sensor de humedad, buzzer, LEDs, entre otros.
Aquí estaré compartiendo mis apuntes de códigos de Arduino que realicé durante el curso, por si a alguien le pueden servir.
Algunas cosas clave a tener en cuenta en Arduino IDE: los comandos base más importantes son
pinMode(2, OUTPUT) para declarar un pin como salida y
digitalWrite(2, HIGH) para encenderlo.
También es importante recordar que el
delay()
trabaja en milisegundos, por lo que si quieres esperar 1 segundo debes escribir
delay(1000).