Complete Cursor AI transcript for Week 13 wildcard week assignment page creation, including PCB engraving documentation, design files integration, and comprehensive page structure development.
Full Conversation
UserUnknown
general guidelines:
— for each image or video add a caption and description.
— make all the text professional and succinct without losing key details
— make the information as organized and as aesthetically pleasing as possible
— don't just take my notes from the prompt, refine it before putting it on the page
tasks:
1. make a copy of week12.html and called it week13.html. make sure its linked on index.html. populate the relevant resources from
https://academy.cba.mit.edu/classes/wildcard/index.html in Useful Documentation, add a new subsection in Useful Documentation with all these references
2. add lecture and recitation notes from this week as two sections
week13 lecture notes
my theme of the week
‘step away from the panic’
major announcements
do subject evaluation
required for funding the class
feedback to the institute about the class
if you care about successors in the class
calendar alarm — wildcard week and recitation on why make (almost) anything: impact
friday is cutoff for assignments and orders
10s of dollars per person from inventory
then final presentation/final exam
combining multiple additive and subtractive processes (not just design a board and 3d print a case)
goal is system integration out of parts
final exam is did you finish a final project and does it do something and does it work
1) did you integrate and design a complete system
2) can you demo a final project? here is the cool thing I did and here is how it works
3) make a final project video! (helps but not required)
-> focus on well-integrated device!
review of week12 user interfaces
claire wang
music play and windows 3.1 interface works!
ryan hoffman
drv8251a discussion, heat sinks, breakout boards
wildcards with waterjetting, edm, multi-axis machining, laser cutting metal
class in the spring on nature of mathematical modeling
srikanth nadhamuni
background and experience to visiting fellow at mit
raspberry pi w for wifi, n8n for cloud LLM data crunching
software: node.js, mcp bridge server with n8n based on bridge connected to device (NGV tunnel)
all set! fantastic experience, haven’t worked so hard in a very long time and learning a lot of new things
hope to take forward and build other systems
the whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out
maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram)
ray song
not here
tyler jensen (Lincoln lab, group 81)
final project discussion
nylon printer
week 13
easy for web serial interface for XIAO!
web server to TFT (I think I forgot to load the camera pins with my code for it)
aditi ramakrishnan
sloan mba and strategy consulting background
discrete time filter (fft is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies
for filtering in realtime
alexandros gravalos
not here
edward chen
check final watch project by gulati into watch form factor
clear print on the form labs printer, 0.1
Kaman filter for sensor fusion (in the spring class)
for position — lsm6dsv16x from input devices
acceleration at 7 khz (at audio frequency)
show and tell
handle to sensor wifi user interface
plug to audio llm user interface
system integration reminders
mount electronics
strain relief the final projects
preview for wildcard week
assignment design and produce something with a digital process
week13 recitation notes — why make (almost) anything
map of fablabs
why make a fablab
used to create a community
building things for the community
sustainability
prototyping quickly
how impact?
how to make spaces
how to measure impact
what is important about fab
fablabs in cities vs rural areas
the ability to decide their own futures and change their lives fundamentally
‘safecast revolutionized citizen science’ e.g. radiation map
bringing back manufacturing
reducing reliance on supply chains
rural sustainability
working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge
how to establish labs their
how to make sure the labs get used
hygiene technologies with proctor and gamble
highly commercial
lots of plastic waste
how can we change how they produce? how to make their products get there through resellers?
trip to peru and ran workshops, questionnaires, analysis
collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents
out of three plants, two worked better and one wasn’t working at all (which is important to know!)
what does it mean to design infrastructure?
what did we want this lab to be able to do?
workshops and questionnaires
how much you educate people based on the info they have with the issues the community is facing
energy concerns to consider, some machines just drain the grid and can’t be used
solar powered, battery powered machines, reducing energy consumption of machines
many concerns important
ethical questions
how to maintain resources
case study water purifier packets, use them, change them, source them locally, ingredients found locally, how to distribute them globally
first few fablabs were nsf funded
now corporate csr, regional funding, labor funding (10 different ways)
successful fablabs are heterogeneous with lots of ways of funding
the ones that fail usually just have one sponsor
example DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too)
what does it mean to scale infrastructure? (besides a lot of meetings!)
what is a reasonable way to design a data collection process about what is needed and how to achieve it
back to the map: expansion
timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy
initial results from boston
how to confront local impact
collab with university of hamburg
motivation for how much food can be produced in Boston
where food waste goes and what Boston produces locally
make things for yourself locally
impact directly in the community you’re living in
hatchspace
focused on rehabilitation of addicts with woodworking
(vermont is wood producing state)
example course program
all-in session and systemic impact
natural and cultural context
skills and workshop
economic vitality
skills and workshop
co-work session
solutionspalooza
in the course, hands-on component (no physical robot exists that can do it) and community component is also important
inclusion is important
solving unconscious and institutional biases
‘fabrica! lab’ — creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech
makerspaces — access to tools behind closed doors at universities, makes a huge difference for people who don’t have the ability to prototype for themselves
materiom — fablab affiliated project on organic waste for biomaterials
fablab león
skylab workshop experiment — how to run a noodle shop out of a fablab (creating food from the community)
academany — global distributed campus for high school education
fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications)
trade-off between impactful and dangerous
people could be doing bad, but not because doing it with a group people with values
questions
clarification: adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs)
foundations for fab futures July 27-31, 2026 at fab boston 2026
3. update design files section to include either a link to a previous or upload a new folder from here.
ATtiny_QFN folder and zip
RP2354A-dev-v1.1 folder and zip
for each put the images
ATtiny1626-dev and ATtiny1626-dev-final
RP2354A-dev
4. make individual and group assignment sections based on the assignment descriptions:
Design and produce something with a digital process
(incorporating computer-aided design and manufacturing) not covered
in another assignment, documenting the requirements that your
assignment meets, and including everything necessary to reproduce
it. Possibilities include (but are not limited to):
5. for the individual assignment, summarize
week13 pcb engraving assignment
tool
carvera first for edge cuts and machine the holes (too much for the laser)
top and bottom for connectors, right side for flashing
connectors along the edges to minimize form factor and maximize usage of space
vertical connectors instead of horizontal connectors because the horizontal connectors risk being snapped
avoid large black because laser does not work with that (keep traces closer and further to minimize black*)
put connectors on 100mil spacing grid size for breadboardability
*note — need to characterize maximum black until it burns the board because dumping too much heat in one place)
missed six pins in initial design so switched from 6-pin headers to 9-pin (distributed six on top of bottom)
no sda or scl resistors so we don’t regret it when we need the board for something else (maybe adding a spot for zero-ohm or pull-up resistor later but keeping it simple for now)
adding aligned mounting holes (M3 usually — for 3mm screws)
update footprint after editing the footprint (we had different x coordinates across the pins and needed to modify the footprint)
rounded edge cuts — do 90 degrees, copy, drag, and complete the shape!
design rules
0.1 mm spacing
0.15 mm trace width minimum
0.15mm clearance between plane and the rest
ports and pins
pa (0-7)
pb (0-7)
pc (0-7)
8-bit microcontroller, 8 pins max, each port has 8 pins maximum (some less)
need to specify port letter and pin number
postprocessing
add new layer with just the holes in photoshop for carvera (only holes)
get rid of the holes for the f2 tools engraving in inkscape (the frame and the board for alignment, then only engrave the board, not the edges)
carvera machining
mods -> mill 2d pcb
0.12mm cut depth and max depth
pcb engraving
xtool f2 ultra
tape for laser alignment
run a test first on spare copper before the carvera cut board to make sure focus is good (2.7mm thickness setting worked, board is actually 1.6-1.7mm thick)
sand after
worked with bantam tools fr1 (not the random amazon copper)
short circuit test
soldering
using solder gun (heat gun)
components
1x 6-pin flipflop headers
2x 9-pin flipflop headers
1x 4.7k resistor
1x 1k resistor
1x LED
1x 1uF or 10uF capacitor
make sure to address everything in the assignment description:
individual assignment:
write an application that interfaces a user with an
input &/or output device that you made
include how the application interfaces with a user through an input and/or output device, then make a table with first column how it interfaces with the user, then column for input device(s), then column for output devices, make a row for a and a row for b
add links to download all the relevant design files when you mention them
embed all the relevant images and videos with the text
design: ATtiny1626-dev-final
engraving: ATtiny1626-dev-engraved
soldered: ATtiny1626-dev-soldered
blinking: ATtiny1626-dev-blinking
6. make sure there are no weird remnants from copying week11.html to week12.html
AssistantUnknown
Reviewing the existing files to understand the structure.
Reading week12.html in sections to understand its structure:
Reading more sections to understand the structure:
Creating the initial todo list and starting week13.html:
Copying week12.html to week13.html, then updating it:
Updating week13.html, starting with the title and header:
This week focuses on creating user interfaces and applications that connect users with input and output devices. We'll explore interface design patterns, application programming techniques, and how to build interactive systems that provide meaningful user experiences.
Creating user interfaces for embedded devices
Building applications that interface with input and output devices
Comparing interface programming tools and frameworks
This Week's Goals
User Interface Design Learn to create intuitive interfaces for embedded devices and applications
Application Programming Build applications that interface users with input and/or output devices
Tool Comparison Compare interface programming tools and frameworks to select appropriate solutions
Assignments
Group Assignment Compare as many tool options as possible
Individual Assignment Write an application that interfaces a user with an input &/or output device that you made
Tools & Materials
ESP32-S3 Development Boards
OLED Displays (SSD1306)
MAX30102 Pulse Oximeter Sensor
Buttons & User Input Devices
Interface Programming Frameworks
Training Documentation
Training materials and documentation for interface and application programming.
No recitation this week.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on creating user interfaces and applications that connect users with input and output devices. We'll explore interface design patterns, application programming techniques, and how to build interactive systems that provide meaningful user experiences.
Creating user interfaces for embedded devices
Building applications that interface with input and output devices
Comparing interface programming tools and frameworks
This Week's Goals
User Interface Design Learn to create intuitive interfaces for embedded devices and applications
Application Programming Build applications that interface users with input and/or output devices
Tool Comparison Compare interface programming tools and frameworks to select appropriate solutions
Assignments
Group Assignment Compare as many tool options as possible
Individual Assignment Write an application that interfaces a user with an input &/or output device that you made
Tools & Materials
ESP32-S3 Development Boards
OLED Displays (SSD1306)
MAX30102 Pulse Oximeter Sensor
Buttons & User Input Devices
Interface Programming Frameworks
Training Documentation
Training materials and documentation for interface and application programming.
No recitation this week.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on creating user interfaces and applications that connect users with input and output devices. We'll explore interface design patterns, application programming techniques, and how to build interactive systems that provide meaningful user experiences.
Creating user interfaces for embedded devices
Building applications that interface with input and output devices
Comparing interface programming tools and frameworks
This Week's Goals
User Interface Design Learn to create intuitive interfaces for embedded devices and applications
Application Programming Build applications that interface users with input and/or output devices
Tool Comparison Compare interface programming tools and frameworks to select appropriate solutions
Assignments
Group Assignment Compare as many tool options as possible
Individual Assignment Write an application that interfaces a user with an input &/or output device that you made
Tools & Materials
ESP32-S3 Development Boards
OLED Displays (SSD1306)
MAX30102 Pulse Oximeter Sensor
Buttons & User Input Devices
Interface Programming Frameworks
Training Documentation
Training materials and documentation for interface and application programming.
No recitation this week.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
User Interface Design Learn to create intuitive interfaces for embedded devices and applications
Application Programming Build applications that interface users with input and/or output devices
Tool Comparison Compare interface programming tools and frameworks to select appropriate solutions
Assignments
Group Assignment Compare as many tool options as possible
Individual Assignment Write an application that interfaces a user with an input &/or output device that you made
Tools & Materials
ESP32-S3 Development Boards
OLED Displays (SSD1306)
MAX30102 Pulse Oximeter Sensor
Buttons & User Input Devices
Interface Programming Frameworks
Training Documentation
Training materials and documentation for interface and application programming.
No recitation this week.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Compare as many tool options as possible
Individual Assignment Write an application that interfaces a user with an input &/or output device that you made
Tools & Materials
ESP32-S3 Development Boards
OLED Displays (SSD1306)
MAX30102 Pulse Oximeter Sensor
Buttons & User Input Devices
Interface Programming Frameworks
Training Documentation
Training materials and documentation for interface and application programming.
No recitation this week.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
Tools & Materials
ESP32-S3 Development Boards
OLED Displays (SSD1306)
MAX30102 Pulse Oximeter Sensor
Buttons & User Input Devices
Interface Programming Frameworks
Training Documentation
Training materials and documentation for interface and application programming.
No recitation this week.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for interface and application programming.
Comprehensive resource covering interface design, application programming, GUI frameworks, embedded UI development, web interfaces for embedded systems, and user interaction patterns. Includes detailed tutorials, code examples, and implementation guides for various interface programming tools and frameworks.
Key Topics
Interface Design: User experience principles, interaction patterns, feedback mechanisms
Embedded UI: OLED displays, LCD interfaces, character displays
Web Interfaces: HTTP servers, REST APIs, WebSockets, real-time data visualization
Application Frameworks: GUI toolkits, web frameworks, mobile apps
User Input: Buttons, touch interfaces, gesture recognition, voice commands
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Write an application that interfaces a user with an input &/or output device that you made. This assignment demonstrates three interface applications: (a) a simple button user interface on OLED, (b) a real-time graphical user interface through OLED and Wi-Fi for pulse oximeter readings, and (c) a Wi-Fi grip strength monitor with a mechanical gripper and age-estimation web dashboard.
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Individual Assignment: PCB Engraving with Fiber Laser
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This assignment demonstrates PCB design and fabrication using a combination of CNC milling (Carvera) for edge cuts and hole machining, and fiber laser engraving (xTool F2 Ultra) for trace creation on copper-clad boards. The project includes designing and fabricating two development boards: a simple ATtiny1626 development board and a complex RP2354A development board.
PCB Engraving Process
This project explores PCB fabrication using fiber laser engraving, a process not covered in previous assignments. The workflow combines subtractive manufacturing techniques: CNC milling for mechanical features (edge cuts and holes) and laser engraving for electrical traces. This approach enables rapid prototyping of custom PCBs without requiring chemical etching or specialized PCB manufacturing facilities.
Tools and Equipment
Carvera (CNC Mill): Used for edge cuts and hole machining. The laser cannot effectively cut through the board material, so mechanical cutting is required for board outline and mounting holes.
Fiber Laser Cutter (xTool F2 Ultra): Used for PCB trace engraving. The laser removes copper from the board surface to create electrical traces and pads.
PCB Design Software (KiCad): Used for schematic capture, PCB layout, and design rule checking.
Boards Designed
Simple Board: ATtiny1626 development board with connectors, resistors, LED, and capacitor
Complex Board: RP2354A development board with more advanced routing and component placement
Board Design Considerations
Connector Placement: Top and bottom for connectors, right side for flashing. Connectors along edges to minimize form factor and maximize space usage.
Vertical Connectors: Used instead of horizontal connectors because horizontal connectors risk being snapped during use.
Black Area Avoidance: Avoid large black areas because laser does not work well with that (keep traces closer and further to minimize black areas). Note: Need to characterize maximum black until it burns the board because dumping too much heat in one place can damage the board.
Breadboard Compatibility: Put connectors on 100mil spacing grid size for breadboardability.
Pin Count Adjustment: Missed six pins in initial design, so switched from 6-pin headers to 9-pin (distributed six on top and bottom).
I2C Resistors: No SDA or SCL resistors included to keep flexibility for future use. May add spot for zero-ohm or pull-up resistor later but keeping it simple for now.
Mounting Holes: Added aligned mounting holes (M3 usually — for 3mm screws) for mechanical mounting.
Rounded Edge Cuts: Do 90 degrees, copy, drag, and complete the shape for rounded corners.
Design Rules
0.1 mm spacing minimum
0.15 mm trace width minimum
0.15 mm clearance between plane and the rest
Ports and Pins
ATtiny1626 is an 8-bit microcontroller with 8 pins maximum per port. Each port has 8 pins maximum (some less). Need to specify port letter and pin number:
PA (0-7)
PB (0-7)
PC (0-7)
Postprocessing
For Carvera: Add new layer with just the holes in Photoshop (only holes for machining).
For Laser Engraving: Get rid of the holes for the F2 tools engraving in Inkscape (the frame and the board for alignment, then only engrave the board, not the edges).
Carvera Machining
Using mods → mill 2D PCB workflow:
0.12mm cut depth and max depth
PCB Engraving Process
Using xTool F2 Ultra fiber laser:
Use tape for laser alignment
Run a test first on spare copper before the Carvera cut board to make sure focus is good (2.7mm thickness setting worked, board is actually 1.6-1.7mm thick)
Sand after engraving to clean up any residue
Worked with Bantam Tools FR1 (not random Amazon copper)
Perform short circuit test after engraving
Soldering
Using solder gun (heat gun) for component assembly.
ATtiny1626 final designComplete PCB layout with connectors, components, traces, and mounting holes optimized for laser engraving.PCB after engravingCopper-clad board with traces engraved using fiber laser, ready for component soldering.
Soldered boardComplete ATtiny1626 development board with headers, resistors, LED, and capacitor soldered in place.Blinking LED demoVideo demonstration of the completed ATtiny1626 development board running a simple LED blink program, confirming successful fabrication and programming.
PCB engraving detailClose-up view of fiber laser engraved traces showing clean copper removal and precise trace definition.
Interface with User
The application interfaces a user with input and/or output devices through the ATtiny1626 development board. The following table describes how the application interfaces with the user:
How It Interfaces with User
Input Device(s)
Output Device(s)
(a) LED Blink Demonstration
None (programmed behavior)
LED (visual feedback indicating board functionality)
(b) Future Interface Applications
GPIO pins (PA, PB, PC ports) available for sensors, buttons, switches
GPIO pins (PA, PB, PC ports) available for LEDs, displays, actuators
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Individual Assignment: PCB Engraving with Fiber Laser
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This assignment demonstrates PCB design and fabrication using a combination of CNC milling (Carvera) for edge cuts and hole machining, and fiber laser engraving (xTool F2 Ultra) for trace creation on copper-clad boards. The project includes designing and fabricating two development boards: a simple ATtiny1626 development board and a complex RP2354A development board.
PCB Engraving Process
This project explores PCB fabrication using fiber laser engraving, a process not covered in previous assignments. The workflow combines subtractive manufacturing techniques: CNC milling for mechanical features (edge cuts and holes) and laser engraving for electrical traces. This approach enables rapid prototyping of custom PCBs without requiring chemical etching or specialized PCB manufacturing facilities.
Tools and Equipment
Carvera (CNC Mill): Used for edge cuts and hole machining. The laser cannot effectively cut through the board material, so mechanical cutting is required for board outline and mounting holes.
Fiber Laser Cutter (xTool F2 Ultra): Used for PCB trace engraving. The laser removes copper from the board surface to create electrical traces and pads.
PCB Design Software (KiCad): Used for schematic capture, PCB layout, and design rule checking.
Boards Designed
Simple Board: ATtiny1626 development board with connectors, resistors, LED, and capacitor
Complex Board: RP2354A development board with more advanced routing and component placement
Board Design Considerations
Connector Placement: Top and bottom for connectors, right side for flashing. Connectors along edges to minimize form factor and maximize space usage.
Vertical Connectors: Used instead of horizontal connectors because horizontal connectors risk being snapped during use.
Black Area Avoidance: Avoid large black areas because laser does not work well with that (keep traces closer and further to minimize black areas). Note: Need to characterize maximum black until it burns the board because dumping too much heat in one place can damage the board.
Breadboard Compatibility: Put connectors on 100mil spacing grid size for breadboardability.
Pin Count Adjustment: Missed six pins in initial design, so switched from 6-pin headers to 9-pin (distributed six on top and bottom).
I2C Resistors: No SDA or SCL resistors included to keep flexibility for future use. May add spot for zero-ohm or pull-up resistor later but keeping it simple for now.
Mounting Holes: Added aligned mounting holes (M3 usually — for 3mm screws) for mechanical mounting.
Rounded Edge Cuts: Do 90 degrees, copy, drag, and complete the shape for rounded corners.
Design Rules
0.1 mm spacing minimum
0.15 mm trace width minimum
0.15 mm clearance between plane and the rest
Ports and Pins
ATtiny1626 is an 8-bit microcontroller with 8 pins maximum per port. Each port has 8 pins maximum (some less). Need to specify port letter and pin number:
PA (0-7)
PB (0-7)
PC (0-7)
Postprocessing
For Carvera: Add new layer with just the holes in Photoshop (only holes for machining).
For Laser Engraving: Get rid of the holes for the F2 tools engraving in Inkscape (the frame and the board for alignment, then only engrave the board, not the edges).
Carvera Machining
Using mods → mill 2D PCB workflow:
0.12mm cut depth and max depth
PCB Engraving Process
Using xTool F2 Ultra fiber laser:
Use tape for laser alignment
Run a test first on spare copper before the Carvera cut board to make sure focus is good (2.7mm thickness setting worked, board is actually 1.6-1.7mm thick)
Sand after engraving to clean up any residue
Worked with Bantam Tools FR1 (not random Amazon copper)
Perform short circuit test after engraving
Soldering
Using solder gun (heat gun) for component assembly.
ATtiny1626 final designComplete PCB layout with connectors, components, traces, and mounting holes optimized for laser engraving.PCB after engravingCopper-clad board with traces engraved using fiber laser, ready for component soldering.
Soldered boardComplete ATtiny1626 development board with headers, resistors, LED, and capacitor soldered in place.Blinking LED demoVideo demonstration of the completed ATtiny1626 development board running a simple LED blink program, confirming successful fabrication and programming.
PCB engraving detailClose-up view of fiber laser engraved traces showing clean copper removal and precise trace definition.
Interface with User
The application interfaces a user with input and/or output devices through the ATtiny1626 development board. The following table describes how the application interfaces with the user:
How It Interfaces with User
Input Device(s)
Output Device(s)
(a) LED Blink Demonstration
None (programmed behavior)
LED (visual feedback indicating board functionality)
(b) Future Interface Applications
GPIO pins (PA, PB, PC ports) available for sensors, buttons, switches
GPIO pins (PA, PB, PC ports) available for LEDs, displays, actuators
Part (a): Simple Button User Interface on OLED
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Individual Assignment: PCB Engraving with Fiber Laser
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This assignment demonstrates PCB design and fabrication using a combination of CNC milling (Carvera) for edge cuts and hole machining, and fiber laser engraving (xTool F2 Ultra) for trace creation on copper-clad boards. The project includes designing and fabricating two development boards: a simple ATtiny1626 development board and a complex RP2354A development board.
PCB Engraving Process
This project explores PCB fabrication using fiber laser engraving, a process not covered in previous assignments. The workflow combines subtractive manufacturing techniques: CNC milling for mechanical features (edge cuts and holes) and laser engraving for electrical traces. This approach enables rapid prototyping of custom PCBs without requiring chemical etching or specialized PCB manufacturing facilities.
Tools and Equipment
Carvera (CNC Mill): Used for edge cuts and hole machining. The laser cannot effectively cut through the board material, so mechanical cutting is required for board outline and mounting holes.
Fiber Laser Cutter (xTool F2 Ultra): Used for PCB trace engraving. The laser removes copper from the board surface to create electrical traces and pads.
PCB Design Software (KiCad): Used for schematic capture, PCB layout, and design rule checking.
Boards Designed
Simple Board: ATtiny1626 development board with connectors, resistors, LED, and capacitor
Complex Board: RP2354A development board with more advanced routing and component placement
Board Design Considerations
Connector Placement: Top and bottom for connectors, right side for flashing. Connectors along edges to minimize form factor and maximize space usage.
Vertical Connectors: Used instead of horizontal connectors because horizontal connectors risk being snapped during use.
Black Area Avoidance: Avoid large black areas because laser does not work well with that (keep traces closer and further to minimize black areas). Note: Need to characterize maximum black until it burns the board because dumping too much heat in one place can damage the board.
Breadboard Compatibility: Put connectors on 100mil spacing grid size for breadboardability.
Pin Count Adjustment: Missed six pins in initial design, so switched from 6-pin headers to 9-pin (distributed six on top and bottom).
I2C Resistors: No SDA or SCL resistors included to keep flexibility for future use. May add spot for zero-ohm or pull-up resistor later but keeping it simple for now.
Mounting Holes: Added aligned mounting holes (M3 usually — for 3mm screws) for mechanical mounting.
Rounded Edge Cuts: Do 90 degrees, copy, drag, and complete the shape for rounded corners.
Design Rules
0.1 mm spacing minimum
0.15 mm trace width minimum
0.15 mm clearance between plane and the rest
Ports and Pins
ATtiny1626 is an 8-bit microcontroller with 8 pins maximum per port. Each port has 8 pins maximum (some less). Need to specify port letter and pin number:
PA (0-7)
PB (0-7)
PC (0-7)
Postprocessing
For Carvera: Add new layer with just the holes in Photoshop (only holes for machining).
For Laser Engraving: Get rid of the holes for the F2 tools engraving in Inkscape (the frame and the board for alignment, then only engrave the board, not the edges).
Carvera Machining
Using mods → mill 2D PCB workflow:
0.12mm cut depth and max depth
PCB Engraving Process
Using xTool F2 Ultra fiber laser:
Use tape for laser alignment
Run a test first on spare copper before the Carvera cut board to make sure focus is good (2.7mm thickness setting worked, board is actually 1.6-1.7mm thick)
Sand after engraving to clean up any residue
Worked with Bantam Tools FR1 (not random Amazon copper)
Perform short circuit test after engraving
Soldering
Using solder gun (heat gun) for component assembly.
ATtiny1626 final designComplete PCB layout with connectors, components, traces, and mounting holes optimized for laser engraving.PCB after engravingCopper-clad board with traces engraved using fiber laser, ready for component soldering.
Soldered boardComplete ATtiny1626 development board with headers, resistors, LED, and capacitor soldered in place.Blinking LED demoVideo demonstration of the completed ATtiny1626 development board running a simple LED blink program, confirming successful fabrication and programming.
PCB engraving detailClose-up view of fiber laser engraved traces showing clean copper removal and precise trace definition.
Interface with User
The application interfaces a user with input and/or output devices through the ATtiny1626 development board. The following table describes how the application interfaces with the user:
How It Interfaces with User
Input Device(s)
Output Device(s)
(a) LED Blink Demonstration
None (programmed behavior)
LED (visual feedback indicating board functionality)
(b) Future Interface Applications
GPIO pins (PA, PB, PC ports) available for sensors, buttons, switches
GPIO pins (PA, PB, PC ports) available for LEDs, displays, actuators
Group Assignment: Wildcard Week Digital Process
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This group assignment explores various digital fabrication processes available during wildcard week.
Wildcard Week Possibilities
The wildcard week assignment allows exploration of digital fabrication processes not covered in previous weeks. Possibilities include (but are not limited to):
Machining
Grinding
Multi-axis machining
Electrical discharge machining (EDM)
Waterjet cutting
Flatbed cutting
Plasma cutting
Laser metal cutting
Laser micromachining
Welding
Various welding techniques for joining materials.
Molding and Casting
Vacuum forming
Rotocasting
Folding
Mathematics
Form and function
Kirigami
Robotics
Arms
Construction
Soft actuation pneumatic inflatable
Electronics
Pick and place
Programmable logic
Embedded Programming
Machine learning
Machine vision
Food
Printing
Gastronomy
Materials
Synthesis
Mechanical
Rheological
Biotechnology
DIYbio
iGEM
HTGAA
Bio Academy
Textiles
Fiber processes
Knitting
Embroidery (PEmbroider, Ink/Stitch)
Fabricademy
Composites
Various composite fabrication techniques.
A mode-based user interface system that interfaces users with multiple input and output devices through a simple button press interface. The system provides visual feedback on an OLED display and enables navigation between different modes (Menu, Camera, Sensors) using button press patterns. Users interact by pressing a button multiple times to select modes, with visual confirmation displayed on the OLED screen.
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
Checking for remaining old content and updating the Design Files section. Finding the Design Files section:
Removing the remaining old content and updating the Design Files section. Reading what's there:
Removing the old content between the Group Assignment section and the real Design Files section, then updating the Design Files section. Removing the duplicate/misplaced content:
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Individual Assignment: PCB Engraving with Fiber Laser
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This assignment demonstrates PCB design and fabrication using a combination of CNC milling (Carvera) for edge cuts and hole machining, and fiber laser engraving (xTool F2 Ultra) for trace creation on copper-clad boards. The project includes designing and fabricating two development boards: a simple ATtiny1626 development board and a complex RP2354A development board.
PCB Engraving Process
This project explores PCB fabrication using fiber laser engraving, a process not covered in previous assignments. The workflow combines subtractive manufacturing techniques: CNC milling for mechanical features (edge cuts and holes) and laser engraving for electrical traces. This approach enables rapid prototyping of custom PCBs without requiring chemical etching or specialized PCB manufacturing facilities.
Tools and Equipment
Carvera (CNC Mill): Used for edge cuts and hole machining. The laser cannot effectively cut through the board material, so mechanical cutting is required for board outline and mounting holes.
Fiber Laser Cutter (xTool F2 Ultra): Used for PCB trace engraving. The laser removes copper from the board surface to create electrical traces and pads.
PCB Design Software (KiCad): Used for schematic capture, PCB layout, and design rule checking.
Boards Designed
Simple Board: ATtiny1626 development board with connectors, resistors, LED, and capacitor
Complex Board: RP2354A development board with more advanced routing and component placement
Board Design Considerations
Connector Placement: Top and bottom for connectors, right side for flashing. Connectors along edges to minimize form factor and maximize space usage.
Vertical Connectors: Used instead of horizontal connectors because horizontal connectors risk being snapped during use.
Black Area Avoidance: Avoid large black areas because laser does not work well with that (keep traces closer and further to minimize black areas). Note: Need to characterize maximum black until it burns the board because dumping too much heat in one place can damage the board.
Breadboard Compatibility: Put connectors on 100mil spacing grid size for breadboardability.
Pin Count Adjustment: Missed six pins in initial design, so switched from 6-pin headers to 9-pin (distributed six on top and bottom).
I2C Resistors: No SDA or SCL resistors included to keep flexibility for future use. May add spot for zero-ohm or pull-up resistor later but keeping it simple for now.
Mounting Holes: Added aligned mounting holes (M3 usually — for 3mm screws) for mechanical mounting.
Rounded Edge Cuts: Do 90 degrees, copy, drag, and complete the shape for rounded corners.
Design Rules
0.1 mm spacing minimum
0.15 mm trace width minimum
0.15 mm clearance between plane and the rest
Ports and Pins
ATtiny1626 is an 8-bit microcontroller with 8 pins maximum per port. Each port has 8 pins maximum (some less). Need to specify port letter and pin number:
PA (0-7)
PB (0-7)
PC (0-7)
Postprocessing
For Carvera: Add new layer with just the holes in Photoshop (only holes for machining).
For Laser Engraving: Get rid of the holes for the F2 tools engraving in Inkscape (the frame and the board for alignment, then only engrave the board, not the edges).
Carvera Machining
Using mods → mill 2D PCB workflow:
0.12mm cut depth and max depth
PCB Engraving Process
Using xTool F2 Ultra fiber laser:
Use tape for laser alignment
Run a test first on spare copper before the Carvera cut board to make sure focus is good (2.7mm thickness setting worked, board is actually 1.6-1.7mm thick)
Sand after engraving to clean up any residue
Worked with Bantam Tools FR1 (not random Amazon copper)
Perform short circuit test after engraving
Soldering
Using solder gun (heat gun) for component assembly.
ATtiny1626 final designComplete PCB layout with connectors, components, traces, and mounting holes optimized for laser engraving.PCB after engravingCopper-clad board with traces engraved using fiber laser, ready for component soldering.
Soldered boardComplete ATtiny1626 development board with headers, resistors, LED, and capacitor soldered in place.Blinking LED demoVideo demonstration of the completed ATtiny1626 development board running a simple LED blink program, confirming successful fabrication and programming.
PCB engraving detailClose-up view of fiber laser engraved traces showing clean copper removal and precise trace definition.
Interface with User
The application interfaces a user with input and/or output devices through the ATtiny1626 development board. The following table describes how the application interfaces with the user:
How It Interfaces with User
Input Device(s)
Output Device(s)
(a) LED Blink Demonstration
None (programmed behavior)
LED (visual feedback indicating board functionality)
(b) Future Interface Applications
GPIO pins (PA, PB, PC ports) available for sensors, buttons, switches
GPIO pins (PA, PB, PC ports) available for LEDs, displays, actuators
Group Assignment: Wildcard Week Digital Process
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This group assignment explores various digital fabrication processes available during wildcard week.
Wildcard Week Possibilities
The wildcard week assignment allows exploration of digital fabrication processes not covered in previous weeks. Possibilities include (but are not limited to):
Machining
Grinding
Multi-axis machining
Electrical discharge machining (EDM)
Waterjet cutting
Flatbed cutting
Plasma cutting
Laser metal cutting
Laser micromachining
Welding
Various welding techniques for joining materials.
Molding and Casting
Vacuum forming
Rotocasting
Folding
Mathematics
Form and function
Kirigami
Robotics
Arms
Construction
Soft actuation pneumatic inflatable
Electronics
Pick and place
Programmable logic
Embedded Programming
Machine learning
Machine vision
Food
Printing
Gastronomy
Materials
Synthesis
Mechanical
Rheological
Biotechnology
DIYbio
iGEM
HTGAA
Bio Academy
Textiles
Fiber processes
Knitting
Embroidery (PEmbroider, Ink/Stitch)
Fabricademy
Composites
Various composite fabrication techniques.
Design Files
Design files for PCB engraving projects including ATtiny1626 and RP2354A development boards.
ATtiny1626 Development Board
Simple development board for ATtiny1626 microcontroller with connectors, resistors, LED, and capacitor. Designed for breadboard compatibility with 100mil spacing grid.
Initial designFirst iteration of ATtiny1626 development board layout.Final designComplete ATtiny1626 development board with connectors, mounting holes, and optimized trace routing.
Download Design Files
ATtiny_QFN.zip — Complete KiCad project files for ATtiny1626 development board
RP2354A Development Board
Complex development board for RP2354A microcontroller with advanced routing and component placement.
RP2354A board designComplete PCB layout for RP2354A development board with complex routing and component placement.
Download Design Files
RP2354A-dev-v1.1.zip — Complete KiCad project files for RP2354A development board
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
Design Files
Design files and code documentation for interface and application programming projects.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
This week focuses on exploring digital fabrication processes not covered in previous assignments. We'll design and produce something using computer-aided design and manufacturing, documenting requirements and including everything necessary for reproduction. This week also includes reflection on the impact and purpose of making (almost) anything.
Exploring new digital fabrication processes
Designing and producing with CAD/CAM
Understanding the impact and purpose of fabrication labs
This Week's Goals
Explore New Processes Design and produce something with a digital process not covered in other assignments
Complete Documentation Document requirements and include everything necessary to reproduce the project
Reflect on Impact Understand the purpose and impact of fabrication labs and making
Assignments
Group Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment
Individual Assignment Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment, documenting the requirements that your assignment meets, and including everything necessary to reproduce it
PCB Design Software (KiCad) — Board layout and design
ATtiny1626 Microcontroller — Target device for development board
RP2354A Microcontroller — Complex board design
Lecture Notes
Week 13 lecture covering major announcements, week 12 review, system integration reminders, and wildcard week preview.
Theme of the Week
'Step away from the panic'
Major Announcements
Subject evaluation: Required for funding the class. Provides feedback to the institute about the class. Important for future students if you care about successors in the class.
Calendar alarm: Wildcard week and recitation on why make (almost) anything: impact. Friday is cutoff for assignments and orders (10s of dollars per person from inventory).
Final presentation/final exam: Combining multiple additive and subtractive processes (not just design a board and 3D print a case). Goal is system integration out of parts. Final exam criteria:
Did you integrate and design a complete system?
Can you demo a final project? Here is the cool thing I did and here is how it works.
Make a final project video! (helps but not required)
Focus on well-integrated device!
Review of Week 12 User Interfaces
Claire Wang: Music play and Windows 3.1 interface works!
Ryan Hoffman: DRV8251A discussion, heat sinks, breakout boards. Wildcards with waterjetting, EDM, multi-axis machining, laser cutting metal. Class in the spring on nature of mathematical modeling.
Srikanth Nadhamuni: Background and experience to visiting fellow at MIT. Raspberry Pi W for WiFi, n8n for cloud LLM data crunching. Software: Node.js, MCP bridge server with n8n based on bridge connected to device (NGV tunnel). All set! Fantastic experience, haven't worked so hard in a very long time and learning a lot of new things. Hope to take forward and build other systems. The whole culture of doing and trying yourself fascinating, especially with failing a number of times until you figure it out. Maybe set one up at an IIT in India or AI centers of excellence with education ministry into the Indian education system (see fablabkerala.in or vigyam ashram).
Ray Song: Not here.
Tyler Jensen (Lincoln Lab, Group 81): Final project discussion (nylon printer). Week 13: Easy for web serial interface for XIAO! Web server to TFT (I think I forgot to load the camera pins with my code for it).
Aditi Ramakrishnan: Sloan MBA and strategy consulting background. Discrete time filter (FFT is blown) in skimage.filters — make a bandpass filter, then run a series of these filters, much less computing only adds and multiplies for filtering in realtime.
Alexandros Gravalos: Not here.
Edward Chen: Check final watch project by Gulati into watch form factor. Clear print on the Form Labs printer, 0.1. Kaman filter for sensor fusion (in the spring class). For position — LSM6DSV16X from input devices. Acceleration at 7 kHz (at audio frequency).
Show and Tell
Handle to sensor WiFi user interface
Plug to audio LLM user interface
System Integration Reminders
Mount electronics
Strain relief the final projects
Preview for Wildcard Week
Assignment: Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment.
Recitation Notes: Why Make (Almost) Anything
Recitation exploring the purpose, impact, and scaling of fabrication labs and making infrastructure.
Map of Fab Labs
Why Make a Fab Lab?
Used to create a community
Building things for the community
Sustainability
Prototyping quickly
How Impact?
How to make spaces: How to measure impact. What is important about fab:
Fablabs in cities vs rural areas: The ability to decide their own futures and change their lives fundamentally. 'Safecast revolutionized citizen science' e.g. radiation map.
Bringing back manufacturing: Reducing reliance on supply chains.
Rural sustainability: Working with indigenous communities on creating technologies themselves at scale and measure their usefulness and efficacy to preserve their ancestral knowledge:
How to establish labs there
How to make sure the labs get used
Hygiene technologies with Proctor and Gamble: Highly commercial. Lots of plastic waste. How can we change how they produce? How to make their products get there through resellers?
Trip to Peru and ran workshops, questionnaires, analysis: Collaboration developed into how to produce the products but also how to test their products to be market valuable e.g. mosquito repellents. Out of three plants, two worked better and one wasn't working at all (which is important to know!).
What Does It Mean to Design Infrastructure?
What did we want this lab to be able to do?
Workshops and questionnaires
How much you educate people based on the info they have with the issues the community is facing
Energy concerns to consider, some machines just drain the grid and can't be used. Solar powered, battery powered machines, reducing energy consumption of machines. Many concerns important.
Ethical questions
How to maintain resources
Case Study: Water Purifier Packets
Use them, change them, source them locally, ingredients found locally, how to distribute them globally.
Funding Models
First few fablabs were NSF funded. Now corporate CSR, regional funding, labor funding (10 different ways). Successful fablabs are heterogeneous with lots of ways of funding. The ones that fail usually just have one sponsor.
Example: DIY Raman spectrometer for water purification (even after purifications still have sulfates and improving that too).
What Does It Mean to Scale Infrastructure?
(Besides a lot of meetings!) What is a reasonable way to design a data collection process about what is needed and how to achieve it.
Back to the Map: Expansion
Timeline of development, cocreation, portable, skin analysis, water testing, biomaterial tech, microscopy.
Initial Results from Boston
How to Confront Local Impact
Collab with University of Hamburg. Motivation for how much food can be produced in Boston. Where food waste goes and what Boston produces locally. Make things for yourself locally.
Impact directly in the community you're living in.
Hatchspace
Focused on rehabilitation of addicts with woodworking. (Vermont is wood producing state).
Example Course Program
All-in session and systemic impact
Natural and cultural context
Skills and workshop
Economic vitality
Skills and workshop
Co-work session
Solutionspalooza
In the Course
Hands-on component (no physical robot exists that can do it) and community component is also important. Inclusion is important. Solving unconscious and institutional biases.
'Fabrica! Lab' — Creating new laboratory spaces for female high school students, courses aimed for women in technology, online advising sessions for females interested in tech.
Makerspaces — Access to tools behind closed doors at universities, makes a huge difference for people who don't have the ability to prototype for themselves.
Materiom — Fablab affiliated project on organic waste for biomaterials.
Fablab León
Skylab workshop experiment — How to run a noodle shop out of a fablab (creating food from the community).
Academany — Global distributed campus for high school education. Fablab all-in (belonging, impact, community), fab futures (future vocational skills), bio academy (synthetic biology), fabricademy (textiles, fab, bio), fab academy (digital fab apps and implications).
Trade-off Between Impactful and Dangerous
People could be doing bad, but not because doing it with a group people with values.
Questions
Clarification: Adding infrastructure to existing fablab infrastructure to help support specific community needs (not specialized fab labs).
Foundations for Fab Futures
July 27-31, 2026 at Fab Boston 2026.
Useful Documentation
Essential resources for wildcard week digital fabrication processes and PCB design.
Individual Assignment: PCB Engraving with Fiber Laser
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This assignment demonstrates PCB design and fabrication using a combination of CNC milling (Carvera) for edge cuts and hole machining, and fiber laser engraving (xTool F2 Ultra) for trace creation on copper-clad boards. The project includes designing and fabricating two development boards: a simple ATtiny1626 development board and a complex RP2354A development board.
PCB Engraving Process
This project explores PCB fabrication using fiber laser engraving, a process not covered in previous assignments. The workflow combines subtractive manufacturing techniques: CNC milling for mechanical features (edge cuts and holes) and laser engraving for electrical traces. This approach enables rapid prototyping of custom PCBs without requiring chemical etching or specialized PCB manufacturing facilities.
Tools and Equipment
Carvera (CNC Mill): Used for edge cuts and hole machining. The laser cannot effectively cut through the board material, so mechanical cutting is required for board outline and mounting holes.
Fiber Laser Cutter (xTool F2 Ultra): Used for PCB trace engraving. The laser removes copper from the board surface to create electrical traces and pads.
PCB Design Software (KiCad): Used for schematic capture, PCB layout, and design rule checking.
Boards Designed
Simple Board: ATtiny1626 development board with connectors, resistors, LED, and capacitor
Complex Board: RP2354A development board with more advanced routing and component placement
Board Design Considerations
Connector Placement: Top and bottom for connectors, right side for flashing. Connectors along edges to minimize form factor and maximize space usage.
Vertical Connectors: Used instead of horizontal connectors because horizontal connectors risk being snapped during use.
Black Area Avoidance: Avoid large black areas because laser does not work well with that (keep traces closer and further to minimize black areas). Note: Need to characterize maximum black until it burns the board because dumping too much heat in one place can damage the board.
Breadboard Compatibility: Put connectors on 100mil spacing grid size for breadboardability.
Pin Count Adjustment: Missed six pins in initial design, so switched from 6-pin headers to 9-pin (distributed six on top and bottom).
I2C Resistors: No SDA or SCL resistors included to keep flexibility for future use. May add spot for zero-ohm or pull-up resistor later but keeping it simple for now.
Mounting Holes: Added aligned mounting holes (M3 usually — for 3mm screws) for mechanical mounting.
Rounded Edge Cuts: Do 90 degrees, copy, drag, and complete the shape for rounded corners.
Design Rules
0.1 mm spacing minimum
0.15 mm trace width minimum
0.15 mm clearance between plane and the rest
Ports and Pins
ATtiny1626 is an 8-bit microcontroller with 8 pins maximum per port. Each port has 8 pins maximum (some less). Need to specify port letter and pin number:
PA (0-7)
PB (0-7)
PC (0-7)
Postprocessing
For Carvera: Add new layer with just the holes in Photoshop (only holes for machining).
For Laser Engraving: Get rid of the holes for the F2 tools engraving in Inkscape (the frame and the board for alignment, then only engrave the board, not the edges).
Carvera Machining
Using mods → mill 2D PCB workflow:
0.12mm cut depth and max depth
PCB Engraving Process
Using xTool F2 Ultra fiber laser:
Use tape for laser alignment
Run a test first on spare copper before the Carvera cut board to make sure focus is good (2.7mm thickness setting worked, board is actually 1.6-1.7mm thick)
Sand after engraving to clean up any residue
Worked with Bantam Tools FR1 (not random Amazon copper)
Perform short circuit test after engraving
Soldering
Using solder gun (heat gun) for component assembly.
ATtiny1626 final designComplete PCB layout with connectors, components, traces, and mounting holes optimized for laser engraving.PCB after engravingCopper-clad board with traces engraved using fiber laser, ready for component soldering.
Soldered boardComplete ATtiny1626 development board with headers, resistors, LED, and capacitor soldered in place.Blinking LED demoVideo demonstration of the completed ATtiny1626 development board running a simple LED blink program, confirming successful fabrication and programming.
PCB engraving detailClose-up view of fiber laser engraved traces showing clean copper removal and precise trace definition.
Interface with User
The application interfaces a user with input and/or output devices through the ATtiny1626 development board. The following table describes how the application interfaces with the user:
How It Interfaces with User
Input Device(s)
Output Device(s)
(a) LED Blink Demonstration
None (programmed behavior)
LED (visual feedback indicating board functionality)
(b) Future Interface Applications
GPIO pins (PA, PB, PC ports) available for sensors, buttons, switches
GPIO pins (PA, PB, PC ports) available for LEDs, displays, actuators
Group Assignment: Wildcard Week Digital Process
Design and produce something with a digital process (incorporating computer-aided design and manufacturing) not covered in another assignment. This group assignment explores various digital fabrication processes available during wildcard week.
Wildcard Week Possibilities
The wildcard week assignment allows exploration of digital fabrication processes not covered in previous weeks. Possibilities include (but are not limited to):
Machining
Grinding
Multi-axis machining
Electrical discharge machining (EDM)
Waterjet cutting
Flatbed cutting
Plasma cutting
Laser metal cutting
Laser micromachining
Welding
Various welding techniques for joining materials.
Molding and Casting
Vacuum forming
Rotocasting
Folding
Mathematics
Form and function
Kirigami
Robotics
Arms
Construction
Soft actuation pneumatic inflatable
Electronics
Pick and place
Programmable logic
Embedded Programming
Machine learning
Machine vision
Food
Printing
Gastronomy
Materials
Synthesis
Mechanical
Rheological
Biotechnology
DIYbio
iGEM
HTGAA
Bio Academy
Textiles
Fiber processes
Knitting
Embroidery (PEmbroider, Ink/Stitch)
Fabricademy
Composites
Various composite fabrication techniques.
Design Files
Design files for PCB engraving projects including ATtiny1626 and RP2354A development boards.
ATtiny1626 Development Board
Simple development board for ATtiny1626 microcontroller with connectors, resistors, LED, and capacitor. Designed for breadboard compatibility with 100mil spacing grid.
Initial designFirst iteration of ATtiny1626 development board layout.Final designComplete ATtiny1626 development board with connectors, mounting holes, and optimized trace routing.
Download Design Files
ATtiny_QFN.zip — Complete KiCad project files for ATtiny1626 development board
RP2354A Development Board
Complex development board for RP2354A microcontroller with advanced routing and component placement.
RP2354A board designComplete PCB layout for RP2354A development board with complex routing and component placement.
Download Design Files
RP2354A-dev-v1.1.zip — Complete KiCad project files for RP2354A development board
Interface Design
The interface uses a mode-based navigation system where button presses trigger mode changes. A single press enters Camera mode, two presses enter Sensors mode, three presses return to Menu, and holding the button activates a flashlight function. The OLED display shows the current menu state and provides clear visual feedback for each mode transition. See Ethical AI Use: Menu System with Modes for AI-assisted development details.
OLED button user interface menuMenu screen showing available modes: Camera, Sensors, and Menu navigation options with button press instructions.Button UI demonstrationVideo showing button press interactions navigating through different modes on the OLED display.
First video stream on OLEDInitial camera feed streaming to OLED display using dithering algorithm for monochrome conversion, demonstrating real-time video output interface.
Download Design Files
outputs.ino — Button user interface code with mode system
outputs.zip — Complete project archive including all dependencies
Part (b): Real-Time Graphical User Interface through OLED and WiFi
A dual-interface health monitoring system that interfaces users with a MAX30102 pulse oximeter sensor through both an OLED display and a WiFi-enabled web interface. The system provides real-time visualization of heart rate (BPM), blood oxygen saturation (SpO2), and raw sensor data (IR and RED LED readings) through multiple output channels. Users can view data locally on the OLED display or remotely via a web browser accessing the ESP32-S3's built-in HTTP server. See Ethical AI Use: I2C Device Not Found for troubleshooting documentation.
Interface Design
The system provides dual-interface access: a local OLED display shows real-time sensor readings (IR, RED, BPM, SpO2) with visual heartbeat indicators, while a WiFi web interface provides comprehensive data visualization including numerical displays and real-time plotting charts. The web interface uses Chart.js for dynamic graph generation and automatically refreshes every 300ms to maintain real-time data updates. Both interfaces run simultaneously, enabling local monitoring and remote access.
Hello World on OLED
Initial OLED display test showing successful I2C communication and display initialization. See Ethical AI Use: Hello World Code for development details.
Hello World on OLEDInitial OLED test confirming I2C communication and display functionality before implementing sensor interfaces.
Pulse Oximeter Readings on OLED
Real-time pulse oximeter data displayed on OLED showing IR and RED LED readings, heart rate (BPM), and blood oxygen saturation (SpO2) percentage. A heartbeat indicator flashes when a pulse is detected. See Ethical AI Use: MAX30102 Initialization Fix for sensor setup documentation.
OLED sensor readings displayReal-time pulse oximeter data showing IR and RED LED values, heart rate (BPM), and blood oxygen saturation (SpO2) with heartbeat indicator.BPM and SpO2 demonstrationVideo showing real-time heart rate and blood oxygen saturation measurements updating on OLED display with sensor interaction.
Pulse Oximeter Readings on WiFi GUI
WiFi web interface providing remote access to pulse oximeter data through a responsive HTML dashboard. The interface displays real-time numerical values for BPM, SpO2, IR, and RED readings with automatic data refresh. The web server runs on the ESP32-S3, allowing access from any device on the same WiFi network.
WiFi GUI readings dashboardRemote web interface showing real-time pulse oximeter data accessible from any device on the WiFi network, displaying BPM, SpO2, IR, and RED values with automatic updates.
Pulse Oximeter Plots on WiFi GUI
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library. The interface displays live line charts for BPM and SpO2 values, showing trends over time with automatic scrolling and data point management. This visualization enables users to observe patterns in heart rate and blood oxygen levels during monitoring sessions.
Serial monitor sensor responseSerial output demonstrating sensor readings increase when finger is placed on MAX30102 sensor, showing IR and RED LED response to touch.WiFi GUI with plotting chartsEnhanced web interface displaying real-time line charts for BPM and SpO2 values, showing trends over time with automatic data refresh and chart scrolling.
I2C Device Detection
Successful I2C device detection after fixing power isolation issues. The system now correctly identifies the OLED display at address 0x3C and the MAX30102 sensor at address 0x57. Initial troubleshooting required isolating the RD (red LED) and IRD (infrared LED) ground terminals from the general ground plane to prevent power issues and enable proper sensor operation.
20:04:48.612 -> Scanning...
20:04:48.644 -> I2C device found at address 0x3C !
20:04:48.644 -> I2C device found at address 0x57 !
20:04:48.644 -> done
Part (c): Real-Time GUI through Mechanical Gripper and WiFi
A Wi-Fi-connected grip strength meter that interfaces a user with a mechanical hand gripper, an 80 kg load cell, and an HX711 amplifier. The ESP32-S3 continuously measures grip force, streams it to a web dashboard, and uses a published relationship between handgrip strength and age to display an estimated “physiological age” in real time. The design is inspired by the open-source grip strength meter from NeuroTech Hub at WashU and the associated PLOS ONE paper on grip strength and age trajectories (Syddall et al., 2014), adapted to my load cell and handle geometry.
Mechanically, a custom 3D-printed gripper clamps around a CZL601-type 80 kg bar load cell (sourced from Amazon 80 kg load cell). I imported a 100 kg load cell CAD from GrabCAD, checked the mounting dimensions against the CZL601AC datasheet (online, download), and confirmed that the hole spacing and footprint match the commercial part used here.
Mechanical Design and Fabrication
Grip strength base CADTop view of the grip strength base showing the bar load cell pocket, mounting bosses, and handle interface.Side view of gripper assemblySide profile showing how the fixed base, moving handle, and load cell align along the force axis of the bar sensor.
Full grip strength assemblyComplete CAD of the base, handle, and load cell, sized for comfortable adult hand placement and full-finger contact.Load cell mounting holesDetail of the M6 clearance and counterbore geometry used to capture the load cell without constraining bending.
Handle ergonomicsPerspective view of the curved handle designed to distribute pressure across the palm and fingers during maximal grip.Clearance hole verificationPrinted pilot holes used as drill guides to match the metric mounting dimensions from the CZL601AC datasheet.
Fresh off the printer3D-printed base and handle components in PLA prior to post-processing and hardware installation.Workholding for accurate drillingThe printed base clamped to the drill press table so the pilot features guide the final clearance holes into the load cell.
Drilling practiceTraining cuts on scrap material to dial in drill press settings and avoid cracking the printed base during final holes.Final load cell holesDrilling the final M6 clearance holes through the printed base, constrained by the pilot features to preserve alignment.
Electronics and Calibration
Electronics stack-upHX711 amplifier breakout from Amazon wired to the ESP32-S3 and 80 kg load cell with short, twisted signal pairs for noise reduction.Assembled grip strength meterCompleted mechanical and electrical assembly ready for calibration and software bring-up.
Serial Plotter calibration tracesRaw HX711 output converted to kilograms and visualized in the Arduino Serial Plotter while applying known weights and grip forces.Wi-Fi grip strength dashboardBrowser-based GUI with live grip strength (kg), estimated age, and a Chart.js time series plot of recent squeezes.
Model Used for Age Estimation
The age-estimation logic in the firmware is based on the non-linear, sex-specific grip-strength trajectories reported in Dodds et al., 2014 (PLOS ONE). As shown in Figure 1 of that paper, grip strength rises rapidly through adolescence, peaks around ages 30–40, and then declines non-linearly with age, with different magnitudes for males and females.
Reference trajectories (Figure 1)Age-dependent grip strength curves for males and females from Dodds et al., 2014, used as the qualitative target for the embedded model.Quadratic approximation (Table 2-inspired)Simplified male and female trajectories using peak strengths and curvatures chosen to approximate the summary values reported in Table 2 of Dodds et al., 2014.
To reproduce this shape efficiently on the ESP32, the firmware uses inverted quadratic approximations centered at age 35, consistent with the observed peak in the PLOS ONE data. In the forward direction, grip strength is approximated as:
On the device, this relationship is analytically inverted so that the measured grip strength can be mapped back to an estimated age:
age = 35 + √((a − Grip)/b), where a is the peak strength (52 kg for males, 32 kg for females) and b is the curvature (0.0089 for males, 0.0059 for females). The firmware clamps grip strength to physiologically meaningful ranges before applying this formula so the square root remains well-defined.
float ageFromGripMale(float g) {
float a = 52.0f, b = 0.0089f;
if (g > a) g = a;
if (g < 5) g = 5;
return 35.0f + sqrtf((a - g) / b);
}
float ageFromGripFemale(float g) {
float a = 32.0f, b = 0.0059f;
if (g > a) g = a;
if (g < 4) g = 4;
return 35.0f + sqrtf((a - g) / b);
}
For full methodological details and original tables/figures, see the open-access paper: Dodds et al., 2014, PLOS ONE (download local PDF). The implementation here is an educational approximation and not intended for clinical or diagnostic use.
End-to-end live demoReal-time demonstration of squeezing the mechanical gripper and watching the Wi-Fi dashboard update grip strength and estimated age on a laptop.
ChatGPT code development: Full code design and refactoring conversation for the grip strength monitor is documented here: Grip Strength Monitor Code Chat.
Calibration workflow: Calibration and scaling details for mapping HX711 counts to kilograms are documented in: Grip Strength Calibration Chat.
User Interface Comparison
Summary of how each interface application connects users with input and output devices.
Application
How It Interfaces with the User
Input Device(s)
Output Device(s)
(a) Button User Interface
Button press patterns (single, double, triple press, hold) provide mode selection input. OLED display shows current menu state and mode options. Users receive immediate visual feedback for each interaction.
Physical finger placement on MAX30102 sensor provides input. OLED displays real-time sensor data locally. WiFi web interface enables remote monitoring with numerical displays and live plotting charts accessible from any web browser.
MAX30102 Pulse Oximeter Sensor (I²C 0x57)
OLED Display (SSD1306, I²C 0x3C) WiFi Web Interface (HTTP Server with Chart.js visualization)
(c) Grip Strength GUI (Load Cell & WiFi)
Users squeeze a mechanical hand gripper that transfers force into an 80 kg bar load cell. The ESP32-S3 measures grip strength through the HX711 amplifier and streams results to a WiFi web dashboard that displays live grip force and an estimated physiological age in real time.
Mechanical gripper linked to 80 kg load cell (CZL601-type) HX711 load cell amplifier
WiFi Web Interface (HTTP Server with Chart.js visualization) Optional Serial Plotter (for calibration traces)
Group Assignment: Compare as Many Tool Options as Possible
Compare as many tool options as possible for interface and application programming.
General Comparison: Interface & Application Programming Tools
Comprehensive comparison of interface and application programming tools available for embedded systems and IoT development. This analysis covers tools from the MIT Academy Interface & Application Programming class page, evaluating their capabilities, use cases, and trade-offs for different application scenarios.
Embedded Display Interfaces
Tool/Framework
Description
Pros
Cons
Best For
OLED (SSD1306)
Monochrome OLED displays via I²C
Low power, high contrast, simple I²C interface, pixel-level control
Limited resolution (128x64), monochrome only, small display size
Status displays, sensor readouts, simple menus, embedded dashboards
LCD Character Displays
Character-based LCD displays (16x2, 20x4)
Simple API, readable in sunlight, low cost
Limited to text/characters, no graphics, requires backlight power
Text-only interfaces, status messages, debugging output
TFT Color Displays
Full-color TFT LCD displays
Color graphics, touch support, high resolution
High power consumption, complex drivers, larger footprint
Requires JavaScript, CDN dependency or local hosting
Data visualization, time series plots, sensor monitoring dashboards
Mobile & Native App Frameworks
Tool/Framework
Description
Pros
Cons
Best For
React Native
Cross-platform mobile app framework
Cross-platform (iOS/Android), native performance, large ecosystem
Complex setup, requires mobile development knowledge
Full-featured mobile apps, production deployments
Flutter
Google's UI toolkit for cross-platform apps
Single codebase, high performance, customizable UI
Dart language, larger app size, learning curve
Custom mobile interfaces, platform-specific designs
Progressive Web Apps (PWA)
Web apps with native-like features
No app store, cross-platform, offline capability
Limited native API access, browser dependency
Web-based mobile interfaces, simple deployment
Specific Comparison: Tools Used in Individual Assignment
Detailed comparison of the specific interface programming tools implemented in this week's individual assignment, evaluating their performance, ease of use, and suitability for embedded health monitoring applications.
Accessible from any device on WiFi network (phone, tablet, computer), no app installation required
Visualization Capabilities
Chart.js enables rich data visualization with real-time plotting, smooth animations, and interactive features
Real-Time Updates
JSON API endpoint provides efficient data transfer, 300ms refresh rate maintains responsive feel
Limitations
Requires WiFi network, limited to local network without additional configuration, power consumption higher than OLED alone
Best Use Cases
Remote monitoring, data logging visualization, multi-user access, professional dashboards
Button Input Interface
Aspect
Evaluation
Implementation Approach
Digital GPIO reading with debouncing, press pattern detection (single/double/triple/hold) enables mode navigation
User Experience
Intuitive press patterns, immediate visual feedback on OLED, no complex UI navigation required
Reliability
Hardware debouncing with INPUT_PULLUP, timeout-based pattern recognition prevents accidental triggers
Limitations
Limited to single button interaction, pattern learning required, less flexible than touchscreen interfaces
Best Use Cases
Simple mode selection, menu navigation, embedded system controls, low-cost input solutions
Comparison Summary
The combination of OLED display and WiFi web interface provides complementary benefits: OLED offers immediate local feedback with minimal latency and power consumption, while the WiFi interface enables rich visualization and remote access. The button-based input provides an intuitive, low-cost navigation method suitable for embedded systems. Together, these tools create a robust interface system that supports both local and remote interaction with sensor data.
ESP32-S3 Development Board and Pinouts
Code files for ESP32-S3 development board interfaces including I2C scanning, OLED display control, and button-based user interface systems. See Week 4 documentation for board design and Week 8 documentation for pinout configurations.
I2C Scanner (i2cscan_generic.ino)
Utility code for scanning and detecting I2C devices on the bus, essential for troubleshooting connection issues.
How the Code Works (Pseudocode)
SETUP:
Initialize I2C bus
Initialize Serial communication
Print "I2C Scanner" message
LOOP:
Print "Scanning..." message
Initialize device counter to 0
FOR each address from 1 to 126:
Begin I2C transmission to address
Check transmission result
IF transmission successful (error == 0):
Print device found at address (hex format)
Increment device counter
ELSE IF unknown error (error == 4):
Print unknown error at address
IF no devices found:
Print "No I2C devices found"
ELSE:
Print "done"
Wait 5 seconds before next scan
Key Features
Scans all 127 possible I2C addresses (0x01-0x7E)
Detects and reports connected devices with hex address format
Handles multiple error conditions (device not found, unknown errors)
Continuous scanning mode with 5-second intervals
Compatible with any I2C bus configuration (Wire, Wire1, etc.)
What You Need to Know
I2C Address Range: Valid addresses are 0x08-0x77 (8-119 decimal); addresses 0x00-0x07 and 0x78-0x7F are reserved
Common Addresses: OLED displays typically use 0x3C or 0x3D; sensors vary (MAX30102 uses 0x57)
Troubleshooting: If no devices found, check wiring (SDA, SCL, power, ground), verify pull-up resistors, confirm device power
Usage: Run this before connecting other devices to verify I2C bus is working correctly
Basic OLED display test code that initializes the display and shows "Hello World" text, confirming I2C communication and display functionality.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication at 115200 baud
Wait 500ms for Serial to stabilize
Initialize I2C bus with SDA pin 5, SCL pin 6
Print "Starting..." message
Attempt to initialize OLED display:
IF initialization fails:
Print "OLED not found" error
Enter infinite loop (halt)
Clear display buffer
Set text size to 2
Set text color to white
Set cursor position to (0, 20)
Print "Hello" line
Print "World!" line
Update display (send buffer to hardware)
LOOP:
Empty (runs once, then waits)
Key Features
Simple OLED initialization and text display
Custom I2C pin configuration for XIAO ESP32-S3 (SDA=5, SCL=6)
Error handling with infinite loop if display not found
Text size and cursor positioning for centered display
One-time display update (no loop refresh needed for static text)
What You Need to Know
I2C Pin Configuration: XIAO ESP32-S3 uses pins 5 (SDA) and 6 (SCL) by default; verify your board's pinout
Display Address: SSD1306 OLED typically uses address 0x3C; some variants use 0x3D
Display Update: Must call display.display() to send buffer to hardware; drawing functions only modify buffer
Testing: Use this as first test after connecting OLED to verify wiring and I2C communication before adding complex features
Mode-based navigation system using button press patterns (single, double, triple, hold) to control multiple output devices including OLED display, camera, sensors, and LED flashlight.
How the Code Works (Pseudocode)
SETUP:
Initialize OLED display
Initialize camera module
Initialize sensors (MPU6050, HX711)
Initialize button pin (INPUT_PULLUP)
Initialize LED pin (OUTPUT)
Set current mode to MENU
Display menu screen
LOOP:
Read button state
IF button pressed:
Record press start time
Start press detection timer
IF press timeout exceeded:
Process accumulated press count:
IF press count == 1: Switch to CAMERA mode
IF press count == 2: Switch to SENSORS mode
IF press count == 3: Switch to MENU mode
Reset press count
IF current mode == MENU:
Display menu screen (button instructions)
IF current mode == CAMERA:
Capture camera frame
Process image with dithering algorithm
Display on OLED
Run Edge Impulse inference (optional)
Overlay results on display
IF current mode == SENSORS:
Read accelerometer/gyroscope data
Read load cell data
Display sensor readings on OLED
Update display
Key Features
Press pattern detection: single (1x), double (2x), triple (3x), and hold
Mode-based navigation system (Menu, Camera, Sensors)
Button debouncing with timeout-based pattern recognition
Floyd-Steinberg dithering for camera-to-OLED video display
Edge Impulse AI inference integration for face detection
Design files and firmware for a Wi-Fi-enabled grip strength meter built around an 80 kg bar load cell, HX711 amplifier, and ESP32-S3. The mechanical design was informed by the open-source grip strength meter from NeuroTech Hub and validated against the CZL601AC bar load cell datasheet (online, download).
Mechanical Design Files (3D-Printed Components)
Base.3mf — main chassis that captures the bar load cell and anchors the fixed side of the gripper.
Case.3mf — protective enclosure for the ESP32-S3 and HX711 amplifier with cable strain relief.
Handle.3mf — curved grip handle that transfers hand force into the free end of the load cell.
Calibration Print.3mf — small test piece used to verify hole diameters and load cell clearances before printing the full assembly.
All parts were printed in PLA with high infill in the load paths to minimize creep and flex during repeated maximal grip trials.
Basic HX711 Reader (loadcell_simple.ino)
Minimal firmware to bring up the HX711 amplifier and read calibrated weight values over Serial for debugging and calibration.
How the Code Works (Pseudocode)
SETUP:
Configure HX711 data and clock pins (DT=A1, SCK=A0)
Initialize Serial at 115200 baud
Begin HX711 with DT/SCK pins
Set calibration factor (grams per ADC unit)
Tare the scale so current load is zero
LOOP (every 200 ms):
If HX711 is ready:
Read averaged weight using get_units(4)
Print "weight:<value>" to Serial for Serial Plotter
Else:
Print "HX711 not ready" for troubleshooting
Key Features
Simple initialization of the HX711 on analog pins A0/A1.
Configurable calibration factor for mapping counts to grams or kilograms.
Timed reads (200 ms) to keep Serial output manageable and Plotter-friendly.
Graceful handling of HX711 not-ready states.
What You Need to Know
Use for initial bring-up: Run this first when wiring the HX711 and load cell to confirm clean, stable readings.
Calibration factor: Determined experimentally by hanging known weights and adjusting until readings match; see the calibration notes in Calibration Chat.
Serial Plotter: The weight:<value> format is convenient for quickly visualizing changes while squeezing the handle.
Serial Plotter-Friendly Reader (loadcell_plot.ino)
Refined HX711 reader tuned for the Arduino Serial Plotter: it outputs a single numeric value per line for clean plotting of grip strength over time.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial at 115200 baud
Initialize HX711 on DT=A1, SCK=A0
Set calibration factor
Tare the scale
Optionally print debug messages when DEBUG=1
LOOP (every 200 ms):
If HX711 is ready:
Read filtered weight with get_units(4)
Optionally print labeled debug text
Print only the numeric weight to Serial for the Plotter
Else:
Optionally print "not ready" debug text
Print 0 so the plotted line continues gracefully
Key Features
DEBUG toggle: Compile-time switch to enable/disable human-readable logs without breaking the Serial Plotter format.
Clean “one number per line” output for multi-trial grip testing in the Serial Plotter.
Automatic zero output when the HX711 is not ready to keep the time axis continuous.
Shared pinout and calibration approach with loadcell_simple.ino for easy swapping.
What You Need to Know
Use this sketch to tune calibration and visualize grip curves without any GUI overhead.
When collecting data for analysis, keep DEBUG set to 0 so the output is a pure numeric stream.
The sample interval (200 ms) gives a smooth trace while keeping file sizes reasonable for multi-second squeezes.
Full application firmware that exposes grip strength and an estimated age over Wi-Fi using an HTTP server and a Chart.js web dashboard.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial
Initialize HX711 (pins, calibration factor, tare)
Connect ESP32-S3 to WiFi (MIT network in this build)
Start WebServer on port 80
Register handlers:
"/" → serve HTML+JS GUI page from PROGMEM
"/metrics" → serve JSON with current grip and age
LOOP:
Handle incoming HTTP clients
Every 200 ms:
If HX711 is ready:
Read smoothed grip strength (kg) via get_units(3)
Clamp negative values to zero
Store in global gripStrength
AGE ESTIMATION HELPERS:
ageFromGripMale(g):
Clamp g to plausible range
Compute age using inverted quadratic fit derived from normative data
ageFromGripFemale(g):
Same structure with female-specific parameters
CLIENT-SIDE GUI (HTML + JS):
Render dark-themed dashboard with:
- Sex toggle buttons (male/female)
- Numeric grip strength (kg) and age
- Scrolling Chart.js line plot of recent grip values
Poll /metrics every 200 ms and update DOM + chart
Key Features
Embedded HTML/JS dashboard served directly from the ESP32-S3 using PROGMEM.
Real-time grip strength plot using Chart.js with ~120 recent samples.
Simple sex toggle that switches between male and female age-estimation curves.
JSON API at /metrics for future extensions (e.g., logging clients).
What You Need to Know
WiFi credentials: Update the ssid and password constants to match your network.
Normative model: The age equations are simplified fits inspired by the grip-strength trajectories reported in Syddall et al., PLOS ONE 2014 and are for educational visualization only, not clinical use.
Browser requirements: Any modern browser with JavaScript and network access can connect to the ESP32-S3’s IP address to view the dashboard.
Development log: The full iterative design of this sketch is captured in the ChatGPT transcript: Grip Strength Monitor Code Chat.
Code files for the Invisible String pulse oximeter interface system, providing real-time health monitoring through OLED display and WiFi web interface. See Week 11 PCB design documentation for hardware details.
OLED GUI for Pulse Oximeter (pulse_vo2_reads_fixing.ino)
Local OLED display interface showing real-time pulse oximeter readings including heart rate (BPM), blood oxygen saturation (SpO2), and raw IR/RED LED sensor values.
How the Code Works (Pseudocode)
SETUP:
Initialize Serial communication
Initialize I2C bus (SDA=5, SCL=6) at 400kHz
Initialize MAX30102 sensor
Configure sensor:
Set LED mode to RED + IR
Set ADC range to 16384
Set sample rate to 100 Hz
Set pulse width to 411 μs
Set LED brightness to medium (0x3F)
Initialize OLED display
Clear and prepare display
LOOP:
Read IR and RED LED values from sensor
Heart Rate Detection:
Check for heartbeat in IR signal using peak detection
IF heartbeat detected:
Calculate time since last beat
Calculate BPM = 60 / (time_delta / 1000)
Set beat flag for visual indicator
Update last beat timestamp
SpO2 Calculation (every 300ms):
Add IR and RED values to circular buffer
IF buffer has 50 samples:
Calculate DC components (average)
Calculate AC components (RMS)
Calculate R ratio = (AC_RED/DC_RED) / (AC_IR/DC_IR)
Estimate SpO2 = 110 - 25 * R
Clamp SpO2 to 70-100% range
Serial Output:
Print IR, RED, BPM for Serial Plotter visualization
OLED Display Update:
Clear display buffer
Display IR value (small text)
Display RED value (small text)
Display BPM value (large text, size 2)
Display SpO2 percentage (small text)
IF beat detected: Draw heartbeat indicator dot
Update display hardware
Delay 20ms (50 Hz update rate)
Key Features
Real-time heart rate detection using peak detection algorithm on IR signal
SpO2 calculation using ratio-of-ratios method with DC/AC component analysis
Circular buffer system for storing 50 samples of IR/RED data
Visual heartbeat indicator (flashing dot) when pulse detected
Dual output: OLED display and Serial Plotter for real-time waveform visualization
Optimized sensor configuration for reliable readings (100 Hz sample rate, medium brightness)
What You Need to Know
Sensor Placement: Finger must cover sensor completely; proper contact ensures accurate readings
I2C Address: MAX30102 uses address 0x57; verify with I2C scanner if sensor not detected
Ground Isolation: RD and IRD pins must be isolated from main ground plane to prevent power issues (see Week 11 PCB design)
Enhanced WiFi web interface with real-time plotting capabilities using Chart.js library, displaying live line charts for BPM and SpO2 values with automatic scrolling and data management.
How the Code Works (Pseudocode)
SETUP:
(Same as pulse_gui.ino)
Initialize WiFi, sensor, OLED, HTTP server
GUI HTML PAGE (embedded in PROGMEM):
Load Chart.js library from CDN
Create two Chart.js line chart instances:
- BPM chart (y-axis: 40-160 BPM)
- SpO2 chart (y-axis: 70-100%)
Initialize data arrays for each chart
JavaScript Update Function (runs every 300ms):
Fetch JSON data from /metrics endpoint
Update numerical displays (BPM, SpO2, IR, RED)
Add new BPM value to BPM data array
Add new SpO2 value to SpO2 data array
IF array length > maxPoints (100):
Remove oldest value (shift)
Update chart labels (array indices)
Update chart datasets with new data
Call chart.update() to refresh display
Set interval to call update function every 300ms
Key Features
Real-time line chart visualization using Chart.js library
Dual chart display: BPM and SpO2 trends over time
Automatic data scrolling: maintains 100 most recent data points
Numerical displays alongside charts for precise values
Responsive design with dark theme for OLED-style aesthetic
Automatic chart scaling with fixed y-axis ranges for consistent visualization
CDN-based Chart.js loading for minimal memory footprint
What You Need to Know
Chart.js CDN: Library loaded from jsdelivr.net CDN; requires internet connection on client device
Data Management: Arrays limited to 100 points to prevent memory overflow; older data automatically discarded
Update Rate: 300ms refresh rate balances responsiveness with server load; adjust based on network conditions
Chart Configuration: Y-axis ranges fixed (BPM: 40-160, SpO2: 70-100) for consistent scaling; modify in JavaScript if needed
Browser Compatibility: Requires modern browser with JavaScript enabled; tested on Chrome, Firefox, Safari
Performance: Chart updates are lightweight; multiple simultaneous clients may impact ESP32 performance
Offline Operation: Charts won't load if client device lacks internet (Chart.js CDN unavailable); consider local hosting for offline use
Key insights and learnings from working with interface and application programming.
Contributions
Acknowledgements and team roles for interface and application programming work.
Ethical AI Use
Transparent documentation of AI assistance used in this week's interface and application programming work.
This section documents all AI assistance used during Week 12 interface and application programming work. ChatGPT was used for code development, troubleshooting, and technical guidance. All transcripts are linked below for transparency.
Menu System with Modes
AI assistance for developing the button-based menu system with mode navigation (Menu, Camera, Sensors) using press pattern detection. The conversation covered button debouncing, press pattern recognition, mode state management, and OLED menu display design.
Troubleshooting session for I2C device detection issues with MAX30102 pulse oximeter sensor. The conversation addressed power isolation problems, I2C wiring verification, sensor initialization order, and ground plane isolation requirements for accurate sensor operation.
Development assistance for creating the initial OLED "Hello World" test program. The conversation covered I2C initialization, OLED display library setup, text rendering, and basic display configuration for XIAO ESP32-S3 development board.
Code-focused assistance for designing and refining the WiFi grip strength monitor firmware. The conversation covered HX711 bring-up, load cell pin mapping, Serial Plotter debugging sketches, the ESP32-S3 HTTP server, the Chart.js dashboard, and the age-estimation helpers used in loadcell_simple.ino, loadcell_plot.ino, and loadcell_gui.ino.
Calibration-focused assistance for mapping HX711 counts to kilograms and validating the grip strength readings. The discussion walked through using the Serial Plotter, collecting reference weights, tuning the calibration factor, and sanity-checking the age-estimation model derived from normative grip strength data.
Full Cursor AI transcript focused on organizing the grip strength monitor section: structuring Part (c), integrating design files, embedding images and videos, and aligning captions, external references, and the Ethical AI Use documentation for the load cell project.
Complete Cursor AI transcript for Week 12 interface and application programming project documentation. This comprehensive conversation covers the creation and population of the Week 12 HTML page, including Individual Assignment sections (button UI and WiFi GUI), Group Assignment tool comparisons, Design Files documentation with pseudocode, and Ethical AI Use section organization. The transcript demonstrates the collaborative process of building professional documentation with structured content, embedded media, and comprehensive code documentation.
Verifying the cleanup and checking for remaining issues:
Checking what's between the Group Assignment and Design Files sections:
Finding and removing the remaining old Part (a), (b), and (c) sections:
Searching for the old Part sections to remove them:
Trying a simpler search:
The remaining references are in the Ethical AI Use section, which is fine. Marking the cleanup as complete and verifying the page structure:
Created and updated week13.html with the requested content:
1. Copied week12.html to week13.html and updated the title/header for Wildcard Week
2. Added lecture notes section with week 13 content (theme, announcements, week 12 review, system integration reminders)
3. Added recitation notes section on "Why Make (Almost) Anything" covering fab labs, impact, infrastructure design, and scaling
4. Updated Useful Documentation with:
- Wildcard week class page link
- ATtiny1626 references (datasheet, pinout, AVR Freaks discussion)
- Embedded programming course resources with ATtiny412 examples
5. Updated Design Files section with:
- ATtiny1626 development board (images and zip download)
- RP2354A development board (image and zip download)
6. Created Individual Assignment section with:
- PCB engraving process documentation
- Tools and equipment (Carvera, fiber laser)
- Board design considerations
- Postprocessing steps
- Images and videos embedded with captions
- Interface table showing how it interfaces with user
7. Created Group Assignment section listing wildcard week possibilities (machining, welding, molding, folding, robotics, etc.)
8. Cleaned up remnants from the week12.html copy
The page is linked in index.html (already present). All images and videos are embedded with captions and descriptions. No linting errors found. The page is ready for use.
Download Options
For the complete technical details and full conversation transcript: