Embedded Programming ยท HTMAA 2025
Key achievements and insights from the embedded programming week, including successful microcontroller programming, sensor integration, and the development of the ReactionAge reaction time measurement system.
Comprehensive analysis of critical design decisions in embedded system development
๐ป Design Files Available
Download Arduino code, view circuit diagrams, and access all embedded programming assets from this week's assignments
๐ View Design FilesThis week focuses on embedded programming fundamentals, exploring how to program microcontrollers and create interactive electronic systems. We'll dive into the world of digital electronics, sensors, and real-time programming to build responsive devices that can sense, process, and react to their environment.
Essential training materials and resources for embedded programming fundamentals, microcontroller setup, and sensor integration techniques.
Comprehensive guide to soldering techniques for embedded electronics, covering both wire soldering and solder paste methods.
Safety First:
Always wear safety glasses and use proper ventilation. Lead-free solder requires extra caution due to flux crystallization at high temperatures.
Step-by-step video demonstrations of essential soldering techniques for embedded electronics, covering both wire soldering and surface-mount component assembly.
Learn the proper technique for soldering wires to components, starting with one edge to keep the part in place, then soldering the rest easily by keeping your wrist stable and the solder tip on the pad to heat it up with the part, and slowly bringing in solder.
Wire soldering demonstration showing proper technique and wrist stability
Complete process for surface-mount component assembly: apply solder paste first, place the component, then heat up with a heat gun to create strong, reliable connections.
Applying solder paste to PCB pads
Placing microcontroller on prepared solder paste
Using heat gun to reflow solder paste and complete the connection
Pro Tips:
For detailed soldering guides and advanced techniques, refer to the Electronics & Soldering Training section above for comprehensive documentation and resources.
Complete programming setup and workflow for QPAD development boards, covering bootloader configuration, IDE setup, and code deployment for different microcontroller architectures.
The QPAD-XIAO features a Raspberry Pi RP2040 microcontroller with built-in bootloader support. No bootloader burning required - simply configure your IDE and start programming!
The QPAD21 uses an ATSAMD21 microcontroller that requires bootloader programming using a XIAO programmer chip. Follow these steps to get it ready for development.
The QPAD-XIAO-ESP32S3 features an ESP32-S3 microcontroller with built-in WiFi and Bluetooth capabilities. No bootloader burning required - just configure your IDE and start programming!
Comprehensive documentation covering embedded programming fundamentals, electronics theory, and practical implementation guides.
Official course slides covering microcontroller architecture, I/O techniques, sensor integration, and real-time system design.
Essential resources for designing custom PCBs and development boards for embedded programming projects, covering schematic design, layout principles, and manufacturing considerations.
USB-C board design showing proper connector placement, power routing, and signal integrity considerations for embedded development boards
Design Files Available:
Complete KiCad project files, schematics, and PCB layouts are available in the Design Files section below for download and modification.
Essential troubleshooting techniques for embedded development boards, covering power supply verification and connector testing using multimeter measurements.
Verify that your voltage regulator is functioning correctly by measuring output voltages with a multimeter when power is connected to the board.
Voltage regulator testing points showing input, output, and ground connections for multimeter verification
๐ก Pro Tip:
Use a portable multimeter for easy on-the-go testing and debugging of embedded circuits.
Verify USB-C connector functionality by testing power delivery, data lines, and ground connections using multimeter measurements.
USB-C pinout diagram showing power, data, and ground connections for multimeter testing and verification
๐ง Troubleshooting Tips:
Comprehensive analysis of design tradeoffs in embedded programming, covering language selection, development workflows, and microcontroller choices. This collaborative project examines the critical decisions that shape embedded system development and their impact on project success.
Comprehensive comparison of microcontroller architectures and their tradeoffs in embedded programming
Programming language tradeoff analysis showing performance vs development speed considerations
As illustrated in the language tradeoff diagram above, the choice of programming language involves critical tradeoffs between performance and development speed. The analysis shows how different languages balance factors like memory efficiency, execution speed, development time, and ecosystem support for embedded system development.
Development workflow tradeoff analysis comparing different methodologies and their impact on project outcomes
The development workflow tradeoff diagram above demonstrates how different methodologies balance project timeline, code quality, and team collaboration. This visual analysis compares traditional waterfall approaches with agile methodologies, showing the impact of various toolchains, testing strategies, and deployment processes on embedded system development success.
Microcontroller tradeoff analysis showing performance vs power consumption and cost considerations
The microcontroller tradeoff diagram above illustrates the critical balance between performance, power consumption, and cost in embedded system design. This visual analysis evaluates different architectures, processing capabilities, memory configurations, and peripheral options, providing a clear framework for selecting the optimal platform based on specific application requirements.
Workflow examples showing different development approaches for ARM and RP2040 architectures
The example workflow table above provides specific recommendations for different embedded system applications, showing how the tradeoff analyses from the previous sections translate into practical implementation strategies. This comprehensive table demonstrates the relationship between project requirements and optimal technology choices.
As demonstrated in the workflow table above, ARM workflows emphasize professional-grade debugging with industry-standard tools, while RP2040 workflows emphasize accessibility and flexibility through drag-and-drop deployment and unique PIO capabilities. The comprehensive architecture comparison shows that optimal design choices depend heavily on project constraints, performance requirements, and development timeline. High-performance applications favor ARM Cortex-M with professional toolchains, while rapid prototyping benefits from RP2040's flexible development environment and built-in features.
Build a reaction time measurement system based on research methodologies from cognitive science literature. This project combines embedded programming with scientific measurement principles to create a tool for studying human cognitive performance.
Based on PLOS ONE study (2017) examining reaction time variability and cognitive decline.
Repository: github.com/saleemaldajani/reaction-timer-saleemaldajani
Reaction time model showing the relationship between age and cognitive performance, based on research from PLOS ONE (2017)
# | Image | Part | Description | Qty | Unit Price | Datasheet | Price |
---|---|---|---|---|---|---|---|
1 |
![]() |
ATmega32 Microcontroller | 8-bit AVR MCU, 32 KB Flash, 2 KB SRAM, ADC, timers, USART | 1 | $7.50 | $7.50 | |
2 |
![]() |
0.96โณ OLED Display Module (SSD1306) | 128ร64 mono OLED, IยฒC/SPI interface | 1 | $2.50 | $2.50 | |
3 |
![]() |
Male Header Pins (2.54 mm) | Breakaway straight male headers | 2 | $0.20 | $0.40 | |
4 |
![]() |
Dual-Row Header (2ร5, 2.54 mm) | 10-pin dual-row header, unshrouded | 1 | $0.50 | $0.50 | |
5 |
![]() |
SMD MOSFET (AO3400A example) | N-channel MOSFET, SOT-23 | 2 | $0.15 | $0.30 | |
6 |
![]() |
SMD Capacitor (MLCC 0603 example) | Ceramic capacitor, value TBD | 5 | $0.03 | $0.15 | |
7 |
![]() |
SMD Resistors โ 1 kฮฉ (code '1001') | Precision SMD resistors | 5 | $0.02 | $0.10 | |
8 |
![]() |
SMD LED (0603, color TBD) | Indicator LED | 2 | $0.05 | $0.10 | |
9 |
![]() |
USB-C Receptacle | Surface-mount USB TypeโC connector | 1 | $0.60 | $0.60 | |
10 |
![]() |
Custom PCB (Capacitive-Touch Board) | Project-specific PCB | 1 | $10.00 | N/A | $10.00 |
TOTAL | $22.15 |
Complete bill of materials for the ReactionAge embedded programming project. All prices are in USD and subject to supplier variations.
An interactive training module designed for young children, utilizing Nintendo Switch controller input to create an engaging letter-matching game that develops motor skills and cognitive recognition.
An AI-powered Mario-style platformer game built with ChatGPT assistance, featuring touch controls, adaptive gameplay mechanics, and classic 2D platforming elements optimized for embedded systems.
Mario-style platformer gameplay with touch controls and adaptive difficulty
ChatGPT-assisted development process and code generation demonstration
Button mapping obtained using QPAD21 Touch Monitor utility in Design Files
A collaborative multiplayer game featuring geometric shape interactions, synchronized gameplay between two ESP32 devices, inspired by educational content in Shape Song Swing Along.
Shape Song Swing Along educational content integration and gameplay
Circle and square shape interaction gameplay mechanics
MAC addresses obtained using Get MAC Address utility in Design Files
Source code, circuit diagrams, and documentation files for embedded programming projects.
This code was developed collaboratively with ChatGPT. View development transcript
// Reaction time prediction models
const float A_POOLED = -35.392393f, B_POOLED = 0.1930446f;
const float A_MALE = -58.123019f, B_MALE = 0.2640664f;
const float A_FEMALE = -31.603679f, B_FEMALE = 0.176111015f;
float predictAgeFromRT(unsigned long rt_ms) {
float x = (float)rt_ms;
float a, b, c;
switch (currentModel) {
case SX_MALE: a=A_MALE; b=B_MALE; c=C_MALE; break;
case SX_FEMALE: a=A_FEMALE; b=B_FEMALE; c=C_FEMALE; break;
default: a=A_POOLED; b=B_POOLED; c=C_POOLED; break;
}
return a + b*x + c*x*x;
}
This code was developed collaboratively with ChatGPT. View development transcript
// Touch control mapping and adaptive thresholds
#define N_TOUCH 6
#define THRESHOLD 500
uint8_t touch_pins[N_TOUCH] = {2,3,4,5,6,7}; // P0..P5 -> pins (2,3,4,5,6,7)
// Game state management
enum GameState { MENU, PLAYING, PAUSED, GAME_OVER };
GameState currentState = MENU;
// Player physics and collision detection
struct Player {
float x, y, vx, vy;
bool onGround, canJump;
int lives, coins;
};
// Adaptive difficulty system
#define USE_ADAPTIVE_THRESH 1
int adaptive_thresholds[N_TOUCH] = {500, 500, 500, 500, 500, 500};
void updateGame() {
// Physics update
player.vy += GRAVITY;
player.y += player.vy;
// Collision detection with platforms
for (int i = 0; i < N_PLATFORMS; i++) {
if (checkCollision(player, platforms[i])) {
player.onGround = true;
player.vy = 0;
}
}
}
This code was developed collaboratively with ChatGPT. View development transcript
// ESP-NOW communication setup
#include
#include
// Player state structure for network synchronization
struct PlayerState {
int x, y, vx, vy;
bool onGround;
};
struct NetPacket {
PlayerState st;
bool ready;
};
// MAC address-based player identification
uint8_t macP1[] = {0xD8, 0x3B, 0xDA, 0x75, 0x05, 0xAC};
uint8_t macP2[] = {0xD8, 0x3B, 0xDA, 0x75, 0xE1, 0x9C};
// Touch controls for shape interaction
#define N_TOUCH 6
#define THRESHOLD 100000UL
int touch_pins[N_TOUCH] = {9, 8, 7, 2, 3, 1};
#define IDX_LEFT 1
#define IDX_RIGHT 0
#define IDX_JUMP 2
// ESP-NOW callback for receiving data
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
memcpy(&otherState, incomingData, sizeof(otherState));
otherReady = true;
}
A touch monitoring utility developed with ChatGPT assistance for debugging and calibrating touch sensor inputs on the QPAD21 development board. This tool provides real-time visualization of touch sensor values and helps optimize touch thresholds for embedded applications.
This code was developed collaboratively with ChatGPT. View development transcript
// Touch monitoring and calibration utility
#include
#include
#include
#define N_TOUCH 6
#define THRESHOLD 500
uint8_t touch_pins[N_TOUCH] = {2,3,4,5,6,7};
Adafruit_FreeTouch* touch_devices[N_TOUCH];
int touch_values[N_TOUCH] = {0,0,0,0,0,0};
bool pin_touched[N_TOUCH] = {false,false,false,false,false,false};
void updateTouchMonitor() {
for (int i = 0; i < N_TOUCH; i++) {
int value = touch_devices[i]->measure();
touch_values[i] = value;
pin_touched[i] = (value > THRESHOLD);
// Serial output for debugging
Serial.print("Touch ");
Serial.print(i);
Serial.print(": ");
Serial.print(value);
Serial.print(" ");
Serial.println(pin_touched[i] ? "PRESSED" : "RELEASED");
}
}
A utility developed with ChatGPT assistance for retrieving and displaying MAC addresses on ESP32 devices. This tool is essential for ESP-NOW communication setup, allowing developers to identify device MAC addresses for peer-to-peer networking configuration in multiplayer embedded applications.
This code was developed collaboratively with ChatGPT. View development transcript
// MAC address retrieval utility for ESP32
#include
#include
void setup() {
Serial.begin(115200);
// Get WiFi STA MAC address
uint8_t mac[6];
esp_read_mac(mac, ESP_MAC_WIFI_STA);
Serial.print("WiFi STA MAC: ");
for (int i = 0; i < 6; i++) {
if (i > 0) Serial.print(":");
if (mac[i] < 16) Serial.print("0");
Serial.print(mac[i], HEX);
}
Serial.println();
// Get Bluetooth MAC address
esp_read_mac(mac, ESP_MAC_BT);
Serial.print("Bluetooth MAC: ");
for (int i = 0; i < 6; i++) {
if (i > 0) Serial.print(":");
if (mac[i] < 16) Serial.print("0");
Serial.print(mac[i], HEX);
}
Serial.println();
}
Complete KiCad project files for custom PCB design, including schematics, PCB layouts, and project configurations for embedded development boards.
Design Documentation:
For detailed board design principles, USB-C connector placement, and manufacturing considerations, refer to the Board Design Documentation section above.
[Reflection notes placeholder.]
Acknowledgments for collaborative support and technical assistance during the embedded programming project development.
Helped me so much with the ESP32S3 code development with his awesome examples. Also assisted with resoldering the microcontroller when we were debugging the USBC QPAD issues. Couldn't have done it without you!
Spent so many hours helping me debug my USBC QPAD while resoldering the USBC port. Eventually it turned out the problem was that we crashed the board with XIAO code on a D21! Too much to say and so little time until class. Couldn't have done it without you.
Helped me test the boards after programming them, providing valuable assistance with debugging and validation of the embedded programming projects. Your support was crucial for ensuring everything worked correctly.
Contributed valuable insights and technical discussions about microcontroller tradeoffs during the group assignment development. Provided expertise in evaluating different microcontroller architectures and their suitability for various embedded programming applications.
Engaged in extensive discussions throughout the embedded programming design trades section, providing valuable technical insights and collaborative support during the group assignment development process.
Participated in numerous office hours discussions about embedded programming design trades, contributing significantly to the technical analysis and collaborative development of the group assignment content.
Thank you for showing me Flappy Bird and inspiring me to push through the game development part of my plan this week. Your demonstration and encouragement were instrumental in motivating me to complete the ChatGPTMario2D and CircleSquareShapeSongSwingalong projects, helping me overcome technical challenges and stay focused on the embedded programming goals.
Thank you for taking videos of the soldering training! Your documentation of the training process was incredibly helpful for understanding the techniques and procedures. The visual reference you provided made it much easier to follow along and learn the proper soldering methods for the embedded programming projects.
Special thanks to the collaborative learning environment that enabled knowledge sharing and technical problem-solving throughout the embedded programming week.
Transparent documentation of AI assistance used in this week's work, following course guidelines for ethical AI usage.
Used ChatGPT to generate the weekly template HTML structure and styling framework, and created structured task prompts for week 2 embedded programming content development.
Used Cursor AI for iterative content development, page structure optimization, and aesthetic improvements. The AI helped with HTML/CSS implementation, content organization, and maintaining consistent styling across the embedded programming documentation.
Used Cursor AI to implement the comprehensive BOM table with clickable images, datasheet links, and full-width responsive design. The AI helped with HTML table structure, CSS styling, and integration of CSV data into an aesthetically pleasing table format.
Used ChatGPT for image recognition of electronic components to identify parts and construct the bill of materials CSV file. The AI analyzed component images and provided detailed part specifications, descriptions, and pricing information for the embedded programming project.
Used Cursor AI for comprehensive project content updates, documentation improvements, and HTML structure optimization. The AI assisted with content organization, styling consistency, and integration of multimedia elements for the embedded programming documentation.
Used ChatGPT for Arduino programming assistance based on the ReactionAge project code from GitHub repository and Quentin Bolsรฉe's QPAD documentation available on the course website embedded system assignment page. The AI provided guidance on embedded programming concepts, code optimization, and integration with the QPAD-xiao board design.
Used Cursor AI for comprehensive development of the embedded programming design trades group assignment section. The AI assisted with creating structured subsections for language, development workflow, and microcontroller tradeoffs, implementing professional HTML tables with data extracted from PowerPoint presentations, and integrating download links for PDF and PPTX files.
Used Cursor AI for comprehensive development of the training section, including soldering techniques, QPAD programming guides, board design documentation, and troubleshooting procedures. The AI assisted with creating structured subsections, implementing video demonstrations, adding download links for design files, and developing comprehensive troubleshooting guides with multimeter testing procedures.
Used Cursor AI to analyze file sizes and break down large changes into smaller, manageable commits to avoid exceeding Git's 25MB commit size limit. The AI helped organize files by size, created a logical commit strategy, and automated the commit and push process for better version control practices.
Used ChatGPT for collaborative development of the ChatGPTMario2D platformer game, including touch control implementation, adaptive difficulty systems, collision detection, and game physics. The AI provided guidance on embedded programming concepts, state machine architecture, and optimization for the QPAD21 development board.
Used ChatGPT for collaborative development of the CircleSquareShapeSongSwingalong multiplayer game, including ESP-NOW wireless communication, MAC address-based player identification, synchronized game state management, and educational content integration. The AI provided guidance on embedded networking, real-time synchronization, and touch-based geometric learning systems.
Used ChatGPT for collaborative development of the QPAD21 touch monitoring utility, including real-time sensor value display, threshold calibration assistance, debugging tools, and serial output for data logging. The AI provided guidance on touch sensor integration, calibration procedures, and embedded debugging techniques for the QPAD21 development board.
Used ChatGPT for collaborative development of the get_mac_address utility for ESP32 devices, including WiFi STA and Bluetooth MAC address retrieval, serial output formatting, and ESP-NOW integration support. The AI provided guidance on embedded networking concepts, MAC address extraction methods, and device identification techniques for multiplayer embedded applications.
Used Cursor AI for comprehensive development of toddler training subsections, including ChatGPTMario2D and CircleSquareShapeSongSwingalong game implementations. The AI assisted with creating structured subsections, implementing video demonstrations, adding download links for Arduino code files, and developing comprehensive documentation for embedded programming educational content.
This work is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License