Skip to content

Week 18 - Application and Implications

Assignments of the Week

  • Plan a final project masterpiece that integrates the range of units covered, answering:

    What will it do? Who's done what beforehand? What sources will you use? What will you design? What materials and components will be used? Where will come from? How much will they cost? What parts and systems will be made? What processes will be used? What questions need to be answered? How will it be evaluated?

  • Your project should incorporate 2D and 3D design, additive and subtractive fabrication processes, electronics design and production, embedded microcontroller design, interfacing, and programming, system integration and packaging.

    Where possible, you should make rather than buy the parts of your project. Projects can be separate or joint, but need to show individual mastery of the skills, and be independently operable.

Idea sketch

alt text

The initial concept began with a small robot combined with contact-based patch sensors(Figure 1), designed to monitor the driver's physiological signals in an autonomous vehicle. As the design evolved, we explored more refined and lightweight approaches, shifting towards a non-contact sensor system supplemented with saliva-based detection for assessing stress and mood levels. This transition led to the development of several appearance sketches(Figure 2) that reflect the updated sensing approach and more compact form factors.

alt textalt text

A stress and mood detection device designed for autonomous vehicles, integrating a sodium ion sensor for saliva-based stress detection and a camera for facial emotion analysis, capable of uploading data to the cloud and providing feedback to the user, enabling safer takeover decisions. By continuously analyzing emotional and stress signals, the system predicts driver readiness for manual control, offering proactive interventions and real-time guidance to ensure a smooth transition from autonomous to manual driving.

Computer Aided Design

  • Created sensor housings, mechanical shells, and magnetic mounting structures using Fusion 360.

Computer Controlled Cutting

  • CNC laser-cut acrylic sheets to fabricate structural components.

Embedded Systems Programming

  • Developed real-time firmware for XIAO ESP32C3 to process facial recognition and salivary sodium data simultaneously.
  • Implemented LED control and wireless data transmission.

3D Printing

  • Printed PLA and PETG enclosures using high-resolution FDM printers for housing sensors and electronics.

Electronics Design

  • Designed circuits with signal conditioning for biosensors, onboard voltage regulation, and ESD protection.

  • Ensured compatibility across analog and digital sensor interfaces.

Electronics Production

  • Procured discrete components and manually soldered them onto fabricated PCBs.
  • Assembled breakout boards and tested circuit continuity and logic functionality.

Input Devices

  • Integrated solid-state sodium-ion selective electrodes for salivary analysis.
  • Deployed onboard AI vision through MAIXCAM or equivalent camera modules.

Output Devices

  • Integrated RGB LED strip for emotional state visualization.
  • Designed mobile IOT page and external interface screen to display takeover suggestions.

IoT Networking and Data Communication

  • Established Wi-Fi-based data exchange between XIAO ESP32C3 and smartphone app.
  • Enabled live mood/stress readings and takeover recommendations on connected displays.

Interface and Application Programming

  • Designed the interface for emotion characterization result and sensor readings with Ardiuno cloud dashbroad design platform.

Questions Answersd

1.What does it do?

This is a stress and mood detection device designed for autonomous vehicles. It is installed on the car's air vent and uses biosensors (e.g., saliva sodium-ion detection) to monitor passengers or the driver for signs of stress and mood changes. Upon detection, it provides light and sound feedback, which has been shown to help alleviate symptoms associated with stress and negative moods.

2.Who’s done what beforehand?

Existing research has primarily focused on stress and mood detection in lab settings or general health data collection in daily life. However, few studies have adapted these methods for real-world autonomous driving environments with cloud-based analysis and real-time user feedback. Current solutions also tend to rely on bulky, inconvenient setups, making them impractical for seamless in-car integration.

3.What did you design?

Our design encompasses the following key components:

  • Biosensor data input & IoT integration – Saliva sodium-ion sensors paired with low-power Bluetooth/Wi-Fi modules for real-time physiological monitoring and vehicle system communication.

  • Circuit design & PCB fabrication – Custom input interface (signal conditioning for biosensors), main control board, and output system (multicolor LEDs).

  • Cloud processing & UI implementation – IoT platform for stress and mood pattern analysis, with dashboard visualization of historical episodes and severity trends.

  • Enclosure design & 3D printing – Vent-mounted housing with ​​patch-style magnetic attachment​​ for secure docking to a matching base, featuring an integrated cavity to house all biosensors and concealed cable routing channels.

4.What sources did you use?

The following lab equipment and tools were utilized for prototyping:​​

  • FDM 3D Printer – for printing PLA enclosures and mechanical parts

  • CNC Milling Machine – for subtractive fabrication of LED light board

  • Soldering Station – for PCB assembly and component soldering

  • Multimeter & Oscilloscope – for electrical testing and signal validation

  • Workbench & Hand Tools – for general assembly, finishing, and mounting

5.What materials and components were used?

The project incorporated a range of electronic modules, structural parts, and custom-fabricated components for sensing, control, and output functions. The full Bill of Materials (BOM) is listed below:

Main Components

  • Biosensing Module: All-solid-state sodium-selective electrode for detecting stress via saliva analysis
  • Feedback Output: Addressable RGB LED strip for visualizing mood and stress levels
  • Control Unit: XIAO ESP32C3 with a custom-designed PCB for sensor integration and communication
  • Structural Housing: PLA filament was used for 3D printing enclosures and mounts

Material & Component BOM

NameQuantityCost (CNY)Vendor
Vehicle-mounted magnetic bracket114.70Taobao
430 magnetic conductive stainless steel plate25.88Taobao
MagSafe transmitter magnet112.00Taobao
32GB memory card125.90Taobao
3M adhesive magnetic patch13.50Taobao
MAIXCAM camera module1244.00Taobao
XIAO ESP32C3150.00Taobao
PLA filament (for 3D printing)2 rolls120.00Taobao
JLCPCB fabrication cost5.00
Screen-printed carbon electrode10300.00Taobao
Sodium ion-selective membrane solution1100.00Taobao

6.Where did they come from?

All components were sourced from reliable suppliers including electronics specialists like EDA and Seeed Studio for sensors and controllers, 3D printing materials from Bambu Studi. UNNC Fab Lab provided fabrication equipment like laser cutters and 3D printers.

7.How much did they cost?

The material and manufacturing costs are approximately 1,600 RMB.

8.What parts and systems were made?

The following parts and systems were fabricated as part of the project:

  • The external enclosure of the device, designed for compact integration and mounting.

  • Machined stainless steel components with magnetic properties for modular attachment.

  • Custom PCB boards were soldered and assembled to support biosensor interfacing.

  • A takeover interface was developed to visually present driver status and intervention prompts.

  • LED light panels were CNC machined and integrated for real-time feedback.

  • A solid-state sodium ion sensor was fabricated for stress detection via saliva analysis.

9.What processes were used?

  • 2D and 3D Design: Utilized Fusion 360 for mechanical design of enclosures and sensor assemblies,and Fusion 360 was also used for 2D drafting of stainless steel parts.

  • Additive Manufacturing: Used FDM 3D printing with PLA to produce sensor housings and structural components.

  • Subtractive Manufacturing: CNC machining was used to fabricate LED light boards.

  • PCB Design and Production: Custom PCBs were designed with integrated power regulation and signal conditioning, manufactured by JLCPCB and assembled manually.

  • Embedded Programming: Developed firmware for XIAO ESP32C3 microcontroller, integrating camera input and sodium sensor data.

  • System Integration: Combined mechanical, electronic, and software components into a compact unit with wireless data transmission and visual feedback.

  • Sensor Fusion: Implemented real-time analysis of facial expression and saliva sodium concentration to assess driver stress levels.

  • Interface & Feedback Design: Created an LED feedback system and mobile display interface for takeover readiness alerts.

10.What questions were answered?

The following key questions were addressed during the development of the stress and mood monitoring device for autonomous vehicles:

  • How can a driver’s emotional and stress state be detected non-invasively in real time? → By integrating a facial expression camera and a solid-state sodium ion saliva sensor, we enabled continuous, contactless monitoring.

  • Can sensor data be used to assess driver readiness for takeover during autonomous driving? → Yes; the system combines physiological and emotional data to evaluate the driver’s condition and trigger takeover alerts.

  • How can feedback be intuitively delivered to the driver? → Through programmable LED indicators and an IoT-connected user interface displaying mood/stress levels and takeover status.

  • Is the solution compact and seamlessly integrable into the car environment? → Yes; the device is magnetically mounted on the air vent, supports mobile integration, and maintains minimal driver distraction.

11.What worked? What didn’t?

What Worked

  • Multimodal Sensing Integration: The combination of the Na⁺ saliva sensor and ESP32C3 camera successfully captured both physiological and emotional indicators of driver stress and mood.

  • Magnetic Modular Design: The dual-sided magnetic assembly allowed smooth attachment between the phone, sensor module, and air vent holder, supporting both in-car and handheld modes.

  • LED Feedback System: The gradient LED ring effectively communicated stress levels with intuitive color-coded signals, offering clear takeover readiness cues.

  • Wi-Fi Communication & IoT Interface: Real-time data transmission to the Xiao ESP32C3 and mobile dashboard worked with low latency.

  • 3D Printed and CNC-Fabricated Components: The PLA enclosures and CNC-cut LED boards fit well, ensuring neat integration and secure sensor placement.

What Didn’t Work (Initially)

  • Sensor Calibration Variability: The Na⁺ electrode readings were inconsistent without proper baseline calibration, requiring additional testing with multiple saliva samples.

  • Facial Expression Detection Limits: In low-light or occluded scenarios (e.g., sunglasses), the camera-based emotion recognition performed poorly, prompting the need for supplemental IR lighting or fallback logic.

  • Mechanical Fit Tolerances: Some 3D-printed parts required reprinting due to tight tolerances or warping during print cooling.

12.How was it evaluated?

The system was evaluated through a series of functional and performance tests:

  • Sensor Accuracy: The sodium-selective electrode was calibrated and tested using artificial saliva samples with known Na⁺ concentrations to verify measurement consistency.

  • Facial Recognition Reliability: The ESP32S3 camera module’s emotion detection was evaluated under varied lighting and facial conditions to assess recognition accuracy.

  • Takeover Decision Output: The LED ring and mobile UI were tested for clarity and intuitiveness in conveying the driver's readiness status.

  • System Integration Robustness: All components—including magnetic mounts, PCBs, and enclosures—were tested in actual vehicle scenarios to evaluate physical stability and user interaction.

13.What are the implications?

This project demonstrates a practical path toward enhancing safety in autonomous driving through physiological and emotional monitoring. By integrating real-time stress and mood detection using both facial cues and salivary biomarkers, the system enables more informed and timely takeover decisions when manual control is necessary. The approach shows potential for:

  • Improving driver readiness evaluation, reducing risks during human-vehicle transitions.
  • Enabling personalized interventions, such as alerts or environmental adjustments based on mood.
  • Paving the way for standardized driver monitoring systems in next-generation vehicles.
  • Encouraging multimodal biosensing in wearable or in-car systems beyond visual cues alone.

In broader terms, it emphasizes the role of human-centric design in autonomous systems, where emotional and physiological states are part of operational logic—not just external variables.