Final Project: Interactive Device for Autistic Children
Literature Review & Conceptual Design
Final Project Poster Display
Device Introduction
Our final project is an interactive sensory training device designed specifically for autistic children. The device combines multi-sensory feedback mechanisms including visual light responses, tactile interactions, and physiological monitoring to create an engaging and therapeutic experience.
Project Demonstration Video
Problem Statement
Our design aims to support autistic children through fun interactive cognitive training, utilizing multi-sensory feedback (visual, tactile, emotional) to enhance concentration and alleviate anxiety.
Design Purpose:
- Targeting autistic children
- Conduct cognitive training through fun interaction
- Enhance concentration via multi-sensory feedback
- Alleviate anxiety and coordinate limbs
Innovation
I. Material Innovation (Core Highlight)
This interactive device abandons the hard, cold industrial plastic and metal materials of traditional teaching aids, and instead adopts natural, soft, low-stimulation ecological materials, adapting to the sensitive tactile and emotional characteristics of autistic children.
1. Natural Soft Material Combination
The main body of the device uses natural wood materials, paired with simulated moss soft decoration landscapes and fabric soft sheep-shaped ornaments. The overall material is warm, fluffy, and comfortable to touch, with no hard edges or cold tactile sensation. Natural materials can soothe children's emotions, reduce unfamiliar resistance, and help autistic children relax their bodies and minds and stabilize their emotions.
2. All-Soft Safety Protection Design
All touchable and interactive components are softened, with gentle and safe textures. Targeting the characteristics of autistic children's emotional agitation and uncontrollable limb movements, it effectively avoids bumps and injuries, improving safety and comfort during use.
II. Visual Lighting Technology Innovation
1. Low-Saturation Cool Color Scheme
The overall visual design adopts a low-saturation, low-contrast cool color scheme, with elegant and soft colors, without bright and glaring colors. It avoids visual stimulation and emotional anxiety caused by high-saturation colors, adapts to the sensory sensitivity characteristics of autistic children, and creates a quiet, healing immersive atmosphere.
2. Flicker-Free Constant Soft Light Technology
The device is equipped with a professional constant lighting system that completely eliminates screen flickering and light flashing problems. The light is uniform, soft, and stable, without causing visual fatigue and sensory overload, effectively preventing children from experiencing irritability, uneasiness, and emotional loss of control, supporting long-term, stable interactive healing experiences.
3. Behavioral Data Automatic Collection Component
Records children's interaction preferences, operation duration, and other behavioral information throughout the process, providing visual references for rehabilitation assessment and simplifying teachers' recording work.
III. Innovation Summary
This product innovation focuses on material sensory optimization + visual atmosphere adaptation. Through natural soft materials such as wood, moss, and soft dolls, it reduces stimulation and soothes emotions from a tactile perspective; through low-saturation cool colors paired with flicker-free soft light technology, it adapts to the sensory tolerance of autistic children from a visual perspective. Distinguishing itself from the shortcomings of ordinary teaching aids—strong stimulation, stiff texture, and visual clutter—it achieves a healing-type interactive experience specially designed for special needs children.
Market
Case Study: Chuangyu CY-RZKF Portable Cognitive Multi-Sensory Interactive Training Terminal (Institutional Small Home Model)
1. Basic Information
- Market Price: 29,800 yuan/set
- Sales Channels: Procurement by small and medium-sized rehabilitation institutions, limited sales to high-income autistic families.
2. Interaction and Sensory Design
Palm-press interactive device. When children press colorful buttons, the device responds with circular flowing lights and varying sound effects. It focuses on tactile pressing, visual tracking, and auditory regulation training, mainly targeting causal relationship understanding and concentration training for non-verbal, severe autistic children. Modular panel design allows separate disassembly and use.
3. Advantages
- Compact size, portable placement
- Simple operation, even severe non-verbal children can operate independently
- Rough light brightness adjustment, accommodating sensory-sensitive children
4. Core Shortcomings
- Pricing remains high, difficult for ordinary working-class families to afford
- Limited functionality, only basic audio-visual-tactile stimulation, lacking social and daily living skills training content
- No step-by-step difficulty upgrade scheme, insufficient product targeting, easy to lose training value with long-term use
Comparative Analysis:
- Autistic children's therapeutic devices are priced too high, cannot be accessible to every autistic family under different financial conditions
- High technical requirements, such as heart rate sensors
- High-saturation colorful buttons are not suitable for autistic children
Key tech analyse
Concept Device Description
Our concept device integrates distance sensors and heart rate monitoring to create an engaging, therapeutic experience for autistic children:
Core Features:
- Distance Sensor Line-Tracing: Children trace shapes or lines along grooves. Correct completion triggers positive light feedback, guiding hands-on practice to improve concentration.
- Heart Rate Monitoring: Real-time monitoring via heart rate sensor. When children squeeze the light bulb, breathing effects display according to heartbeat speed, allowing observation of emotional fluctuations to adjust training rhythm.
- Gamified Interaction: Reduces resistance through game-like interaction format.
- Positive Reinforcement: Enhances concentration through positive incentives.
Design Benefits:
- Alleviate anxiety
- Coordinate limbs
- Improve concentration
- Reduce resistance
- Positive reinforcement approach
Potential Issues
1. Hardware Wear and Stability Issues
- Ultrasonic sensors are frequently touched and blocked by children at close range, easily accumulating dust and sensitivity drift. After half a year of use, frequent false triggers occur, resulting in high maintenance costs.
- LED strips and Arduino main control work continuously for long periods with poor heat dissipation. In long-term home high-temperature environments, they are prone to short circuits and light flickering. Flickering directly stimulates autistic children's vision.
- Heart rate pulse sensors are contact accessories. Uneven gripping strength and sweating by children lead to inaccurate data, causing the emotion monitoring function to fail.
2. Program Iteration and Compatibility Shortcomings
- The current program is a standalone offline system without cloud storage or data export functions. Rehabilitation therapists cannot track children's training and emotional data long-term, making it difficult to integrate with special education rehabilitation assessment systems.
- There is no wireless program upgrade function. To modify level logic or lighting modes in the future, the device must be disassembled to rewrite code. Ordinary parents and institutions cannot update independently.
- Error tolerance logic is fixed. Once lag or false triggers occur, there is no backend buffer algorithm, requiring whole machine reset. Long-term use will continuously increase failure frequency.
3. Mass Production Process Challenges
- The device includes handmade simulated moss and wooden landscapes, making standardized assembly line production difficult. Mass-produced products will have appearance and texture differences, making quality control difficult to unify.
- 3D printed sliders and bases have high single-piece production costs, limiting bulk pricing pressure reduction space. Landscape consumables (moss, wooden parts) have poor moisture resistance and are prone to mold and deformation in humid southern environments.
Materials and Fabrication Process
Material Preparation
Including Arduino development board, jumper wires, LED strips, ultrasonic sensor, heart rate sensor, and RFID sensor.
Cost Breakdown
| Component | Price (CNY) |
|---|---|
| MAX30102 Blood Oxygen Heart Rate Pulse Sensor Module | ¥11.7 |
| WS2812 LED Strip RGB30 beads 50cm*2 + RGB10 beads 17cm*2 | ¥42 |
| Artificial Grass | ¥20.8 |
| Small Sheep Ornaments *2 | ¥6 |
| Epoxy Resin | ¥15 |
| Wooden Fish *2 | ¥5.8 |
| Foam Board *3 | ¥26 |
| UNO R4 Development Board | ¥144 |
| Ultrasonic Sensor | ¥20 |
| Jumper Wires 60 pieces | ¥5.8 |
| RFID Sensor | ¥48 |
| Total Cost | ¥345.1 |
Fabrication Process
Step 1: Component Modeling and 3D Printing
Final Printed Components:
Step 2: Sketch Drawing and Model Making
Step 3: Circuit Connection and Testing
Step 4: Enclosure Assembly and Circuit Integration
SDG 3 Good Health and Well-being Alignment Analysis
The multi-sensory interactive device developed in this project directly responds to United Nations Sustainable Development Goal 3 (SDG 3): Good Health and Well-being, with particular focus on its sub-goals 3.4 (Promote mental health and well-being) and 3.8 (Achieve universal health coverage and access to essential health services).
1. Promoting Mental Health and Well-being (Corresponding to 3.4)
First, in terms of promoting mental health and well-being, the device targets autistic children as its core user group. It aims to provide a safe, predictable, and non-intrusive emotional regulation tool through gentle tactile feedback and adjustable visual (lighting) stimuli for children who often face sensory overload or sensory seeking behaviors. By attracting children to actively interact, the device helps alleviate anxiety, improve concentration, and serves as a "social bridge" between therapists and children, naturally promoting joint attention and willingness to interact during play, thereby supporting their mental health and socio-emotional development.
2. Improving Accessibility of Health Services (Corresponding to 3.8)
Secondly, in terms of improving health service accessibility, this project fully leverages the technological advantages of 3D printing and open-source hardware (Arduino) to create a low-cost, easily customizable, and replicable intervention aid. It reduces the price barrier of professional sensory training equipment, enabling resource-limited schools, community rehabilitation centers, and even families to obtain effective intervention resources. This narrows the inequality faced by special needs children in accessing developmental support and promotes more inclusive health service coverage.
Furthermore, the device's built-in interactive behavior recording function—heart rate detection—provides objective behavioral data references for parents and therapists, helping them observe changes in children's states more carefully and assist in developing personalized intervention plans. This aligns with the concept of "evidence-based health promotion" advocated by SDG 3.
In summary, this project does not attempt to "cure" autism, but rather creates a friendlier and more inclusive perceptual and interactive environment for autistic children through the integration of technology and design, tangibly improving their daily health and well-being, and striving to make such support more accessible and within reach.
SDG 4 Quality Education Alignment Analysis
This project also has a profound connection with United Nations Sustainable Development Goal 4 (SDG 4): Quality Education, with particular focus on its sub-goals 4.5 (Eliminate discrimination in education and ensure equal access to all levels of education for vulnerable groups) and 4.a (Establish and improve educational facilities that are child-, disability-, and gender-sensitive).
1. Responding to Target 4.5: Providing Equal Educational Opportunities for Special Needs Children
SDG 4.5 requires eliminating inequalities in education and ensuring equal educational opportunities for vulnerable groups such as children with disabilities. Autistic children often struggle to integrate into regular teaching due to sensory overload, and traditional static teaching materials fail to capture their attention. This project's device transforms abstract learning objectives into touchable, instantly feedback-providing gamified experiences through multi-sensory feedback mechanisms—different tactile sensations and adjustable lighting effects—that better align with the perceptual characteristics of autistic children. It effectively reduces learning anxiety, transforming "passive acceptance" into "active exploration," tangibly supporting their participation and integration into educational scenarios.
2. Responding to Target 4.a: Providing Inclusive Learning Environments and Tools for Special Education
SDG 4.a emphasizes establishing disability-sensitive educational facilities and providing inclusive and effective learning environments. Professional sensory training equipment is typically expensive, bulky, and confined to specialized institutions, making it inaccessible to ordinary schools and families. This project utilizes 3D printing and Arduino open-source hardware development, significantly reducing costs so that ordinary schools, community rehabilitation stations, and families can afford them. Meanwhile, the device is compact and friendly in form, allowing it to be flexibly brought into classrooms or homes to provide sensory regulation support at any time, translating "inclusive education" into tangible, accessible tools.
Literature Review
We reviewed 8 research papers on interactive devices and rehabilitation design for autistic children:
Paper 1: Application Research of Interactive Installations in Auxiliary Treatment and Education for Autistic Children
Source: https://d.wanfangdata.com.cn/periodical/mysd-s202101035
Key Points:
- Autistic children are attracted to sensory stimuli like light, shadows, and bright colors
- Interactive installations use lights, sounds, and touch to attract attention
- Through play, they gradually improve focus, reduce unusual behaviors, and learn social interaction
- Design principles from mature international devices: rounded shapes, cool colors, diverse materials, simple operation, immediate audio-visual feedback
- Author created a line-tracing device: lights up when correct path is traced, supports two-player interaction
Paper 2: Spatial Design of Rehabilitation Environment for Autistic Children: Exploration from Behavioral and Psychological Perspectives
Source: View Paper
Key Points:
- Autistic children fear noise and strong light; environmental changes cause anxiety
- Rehabilitation room design: soft lighting, sound insulation, stable furniture placement, avoid stimulation sources
- Stabilize children's emotions through environment control
- Zoned spaces: private corners for solitude and interactive areas for play
- Future direction: intelligent, personalized environments that adjust in real-time based on each child's state
Paper 3: Research Review on Multi-Sensory Design Intervention for Emotional Improvement in Autistic Children
Source: View Paper
Key Points:
- Autistic children struggle with emotion recognition, fear audio-visual stimuli, lack social skills
- Traditional single-sensory training has poor effectiveness
- This product combines visual, auditory, and tactile senses with emotional design
- Collects physiological data and provides real-time emotional feedback
- Examples: VR scenarios, smart tactile clothing, interactive toys, brain-computer interfaces
- Uses light/shadow, vibration, and sound effects to help children perceive emotions
- Future: personalized smart devices balancing cost, privacy, avoiding over-dependence on machines
Paper 4: Design of Deep Touch Pressure Smart Vest for Anxiety in Autistic Children
Source: View Paper
Key Points:
- Focuses on designing an emotion-monitoring, deep-touch-pressure, and acupoint-massage smart vest
- Tactile soothing is an effective calming method
- Core capabilities: physiological monitoring and automatic pressure therapy
- Existing smart clothing focuses on social obstacle training; few products target anxiety relief
- Most have simple structures, lacking multi-module integrated design
- Three core technologies: anxiety recognition, DTP (Deep Touch Pressure therapy), acupoint massage
- Vest includes: physiological monitoring module, acupoint massage module, central control module, automatic air pump for precise pressure control
Paper 5: Design of Multi-Sensory Cognitive Training Toys for Autistic Children Based on ABA Theory
Source: View Paper
Key Points:
- Based on ABA (Applied Behavior Analysis) theory
- Targets social and perceptual development deficits in autistic children
- Cactus-shaped multi-sensory cognitive training toy
- Integrates ABA stimulus-response principle, DTT discrete trial teaching, and color psychology
- Uses warm/cool color grading training and positive rewards for behavioral intervention
- Main body: cactus bionic shape with multi-material, multi-size thorn-like protrusions
- Provides graded tactile stimulation from weak to strong
- Built-in LED lights for visual feedback
- Three-tier cognitive cards:初级实物识图 (basic object recognition), 中级色彩场景 (intermediate color scenes), 高级社交情景 (advanced social scenarios)
- Interaction logic: tactile + visual + voice multi-modal closed-loop interaction
- Correct operation triggers light reward; errors receive voice guidance
- Modular structure adapts to home, institutional rehabilitation, and social simulation scenarios
Paper 6: VR Painting Therapy Design for Autistic Children from Embodied Cognition Perspective
Source: View Paper
Key Points:
- Based on embodied cognition theory
- Addresses sensory sensitivity and social weakness in autistic children
- Combines advantages and disadvantages of traditional painting therapy
- Proposes VR painting therapy design solution
- VR advantages: immersive, safe, customizable, 3D interaction
- Paired with gesture devices, soft visuals, and multi-sensory interaction design
- Constructs complete therapy system, providing design reference for autism art rehabilitation
Paper 7: Cultivating Motor-Social Abilities in Autistic Children Through Motion-Sensing Games: Effectiveness Study of Smart Device-Assisted Intervention
Source: View Paper
Key Points:
- Selected 15 autistic children aged 6-10 for 12-week AR motion-sensing game intervention experiment
- Used PDMS-2 and SRS scales to compare data from motor and social dimensions
- Results: motion-sensing games significantly improved gross motor skills and overall social abilities
- Reduced stereotyped behaviors
- Only optimized visual-motor integration; limited effect on fine motor skills like grasping
- Confirmed AR motion-sensing as effective rehabilitation intervention method
- Future: optimize game content to strengthen fine motor training
Paper 8: Research on Rehabilitation Space Design Strategies for Autistic Children Based on Five-Sense Healing Concept
Source: View Paper
Key Points:
- Based on five-sense healing theory
- Addresses homogeneous rehabilitation spaces lacking local culture and emotional design
- Integrates traditional shadow puppetry intangible cultural heritage elements into space design
- Implements spatial strategies across five sensory dimensions: visual, auditory, tactile, olfactory, gustatory
- Visual healing: low-saturation cool-tone shadow puppetry colors
- Auditory-tactile linkage: shadow puppetry tactile modules linked with sound effects
- Olfactory environment: aromatic plants + seasonal spices
- Gustatory healing: interactive food education spaces
- Forms rehabilitation space design combining therapeutic function with traditional culture
Future Development Directions
Based on our research, future improvements may include:
- Intelligent development: AI-driven personalized adaptation
- Personalization: Adjust parameters based on individual child profiles
- Cost control: Balance functionality with affordability
- Privacy protection: Secure handling of physiological data
- Avoid over-dependence: Ensure technology complements rather than replaces human interaction
- Enhanced fine motor training: Address limitations identified in Paper 7
- Multi-module integration: Learn from Paper 4's integrated design approach
Hardware Interface Connections
The following table shows the pin connections between Arduino and all hardware modules:
1. MFRC522 RFID Module
SS(SDA) → D4
RST → D8
SCK → D13
MOSI → D11
MISO → D12
VCC → Breadboard 5V positive rail
GND → Breadboard common negative rail
2. HC-SR04 Ultrasonic Sensor
Trig → D9
Echo → D10
VCC → Breadboard 5V positive rail
GND → Breadboard common negative rail
3. WS2812 LED Strip (Two Strips)
LED Strip 1:
DIN signal pin → D6
VCC → Breadboard 5V positive rail (same as Strip 1)
GND → Breadboard common negative rail (must share ground)
LED Strip 2:
DIN signal pin → D7
VCC → Breadboard 5V positive rail (same as Strip 1)
GND → Breadboard common negative rail
Important Notes:
- All GND connections must be connected to the same common negative rail for proper grounding
- Both LED strips share the same 5V power supply from the breadboard
- Ensure all connections are secure before powering on the system
Blue LED Control Code
The following Arduino code controls the blue LED strips with RFID card switching and ultrasonic sensor triggering:
#include <Adafruit_NeoPixel.h>
#include <MFRC522.h>
#include <SPI.h>
#define LED1_PIN 6
#define LED2_PIN 7
#define LED_NUM 10
Adafruit_NeoPixel strip1(LED_NUM, LED1_PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2(LED_NUM, LED2_PIN, NEO_GRB + NEO_KHZ800);
const uint8_t BRIGHT = 40; // Increase brightness for better visibility
uint32_t softBlue = strip1.Color(0, 0, 80);
// Ultrasonic trigger distance changed to 5cm
#define TRIG 9
#define ECHO 10
int finishDis = 5;
// NFC pins
#define SS_PIN 4
#define RST_PIN 8
MFRC522 mfrc(SS_PIN, RST_PIN);
int currentTask = 0; // 0=standby 1=LED strip 1 2=LED strip 2
bool taskFinish = false;
unsigned long waterTimer = 0;
const uint16_t waterDelay = 180;
int idx1 = 0;
int idx2 = 0;
void setup() {
Serial.begin(9600);
strip1.begin();
strip2.begin();
strip1.setBrightness(BRIGHT);
strip2.setBrightness(BRIGHT);
strip1.clear(); strip2.clear();
strip1.show(); strip2.show();
pinMode(TRIG, OUTPUT);
pinMode(ECHO, INPUT);
SPI.begin();
mfrc.PCD_Init();
Serial.println("=== Board 1 startup complete ===");
}
float getDistanceCM() {
digitalWrite(TRIG, LOW);
delayMicroseconds(2);
digitalWrite(TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG, LOW);
unsigned long time = pulseIn(ECHO, HIGH);
return time * 0.034 / 2.0;
}
void loop() {
unsigned long now = millis();
float dis = getDistanceCM();
Serial.print("Current distance: ");
Serial.print(dis);
Serial.println(" cm");
// NFC card swipe to switch tasks
if (mfrc.PICC_IsNewCardPresent() && mfrc.PICC_ReadCardSerial()) {
if (currentTask == 0) {
currentTask = 1;
taskFinish = false;
idx1 = 0;
strip1.clear(); strip2.clear();
strip1.show(); strip2.show();
Serial.println("→ First group blue flowing light started");
} else if (currentTask == 1 && taskFinish) {
currentTask = 2;
taskFinish = false;
idx2 = 0;
strip1.clear(); strip1.show();
Serial.println("→ Switch to second group blue flowing light");
} else if (currentTask == 2 && taskFinish) {
currentTask = 0;
taskFinish = false;
strip1.clear(); strip2.clear();
strip1.show(); strip2.show();
Serial.println("→ All reset to standby");
}
mfrc.PICC_HaltA();
}
// First LED strip flowing effect
if (currentTask == 1) {
if (!taskFinish) {
if (now - waterTimer > waterDelay) {
waterTimer = now;
strip1.clear();
for (int i = 0; i <= idx1; i++) {
strip1.setPixelColor(i, softBlue);
}
strip1.show();
idx1++;
if (idx1 >= LED_NUM) idx1 = 0;
}
// ≤5cm triggers constant light
if (dis <= finishDis) {
taskFinish = true;
strip1.fill(softBlue);
strip1.show();
Serial.println("★ First sand table completed, blue light constant on");
}
}
}
// Second LED strip flowing effect
if (currentTask == 2) {
if (!taskFinish) {
if (now - waterTimer > waterDelay) {
waterTimer = now;
strip2.clear();
for (int i = 0; i <= idx2; i++) {
strip2.setPixelColor(i, softBlue);
}
strip2.show();
idx2++;
if (idx2 >= LED_NUM) idx2 = 0;
}
if (dis <= finishDis) {
taskFinish = true;
strip2.fill(softBlue);
strip2.show();
Serial.println("★ Second sand table completed, blue light constant on");
}
}
}
delay(100);
}
Code Features:
- RFID Card Switching: Swipe card to switch between standby, first LED strip, second LED strip, and reset
- Flowing Light Effect: Blue LEDs light up sequentially with 180ms delay
- Ultrasonic Trigger: When object is within 5cm, LED strip turns to constant blue light
- Task Management: Three states - standby (0), first strip (1), second strip (2)
- Serial Monitoring: Real-time distance and status output for debugging
Green LED Control Code
The following Arduino code controls the green LED strips with RFID card switching and ultrasonic sensor triggering (Board 2):
#include <Adafruit_NeoPixel.h>
#include <MFRC522.h>
#include <SPI.h>
#define LED1_PIN 6
#define LED2_PIN 7
#define LED_NUM 30
Adafruit_NeoPixel strip1(LED_NUM, LED1_PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2(LED_NUM, LED2_PIN, NEO_GRB + NEO_KHZ800);
const uint8_t BRIGHT = 40;
uint32_t softGreen = strip1.Color(0, 80, 0);
// Ultrasonic trigger distance changed to 5cm
#define TRIG 9
#define ECHO 10
int finishDis = 5;
// NFC pins
#define SS_PIN 4
#define RST_PIN 8
MFRC522 mfrc(SS_PIN, RST_PIN);
int currentTask = 0; // 0=standby 1=LED strip 1 2=LED strip 2
bool taskFinish = false;
unsigned long waterTimer = 0;
const uint16_t waterDelay = 180;
int idx1 = 0;
int idx2 = 0;
void setup() {
Serial.begin(9600);
strip1.begin();
strip2.begin();
strip1.setBrightness(BRIGHT);
strip2.setBrightness(BRIGHT);
strip1.clear(); strip2.clear();
strip1.show(); strip2.show();
pinMode(TRIG, OUTPUT);
pinMode(ECHO, INPUT);
SPI.begin();
mfrc.PCD_Init();
Serial.println("=== Board 2 startup complete ===");
}
float getDistanceCM() {
digitalWrite(TRIG, LOW);
delayMicroseconds(2);
digitalWrite(TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG, LOW);
unsigned long time = pulseIn(ECHO, HIGH);
return time * 0.034 / 2.0;
}
void loop() {
unsigned long now = millis();
float dis = getDistanceCM();
Serial.print("Current distance: ");
Serial.print(dis);
Serial.println(" cm");
// NFC card swipe to switch tasks
if (mfrc.PICC_IsNewCardPresent() && mfrc.PICC_ReadCardSerial()) {
if (currentTask == 0) {
currentTask = 1;
taskFinish = false;
idx1 = 0;
strip1.clear(); strip2.clear();
strip1.show(); strip2.show();
Serial.println("→ First group green flowing light started");
} else if (currentTask == 1 && taskFinish) {
currentTask = 2;
taskFinish = false;
idx2 = 0;
strip1.clear(); strip1.show();
Serial.println("→ Switch to second group green flowing light");
} else if (currentTask == 2 && taskFinish) {
currentTask = 0;
taskFinish = false;
strip1.clear(); strip2.clear();
strip1.show(); strip2.show();
Serial.println("→ All reset to standby");
}
mfrc.PICC_HaltA();
}
// First LED strip flowing effect
if (currentTask == 1) {
if (!taskFinish) {
if (now - waterTimer > waterDelay) {
waterTimer = now;
strip1.clear();
for (int i = 0; i <= idx1; i++) {
strip1.setPixelColor(i, softGreen);
}
strip1.show();
idx1++;
if (idx1 >= LED_NUM) idx1 = 0;
}
// ≤5cm triggers constant light
if (dis <= finishDis) {
taskFinish = true;
strip1.fill(softGreen);
strip1.show();
Serial.println("★ First sand table completed, green light constant on");
}
}
}
// Second LED strip flowing effect
if (currentTask == 2) {
if (!taskFinish) {
if (now - waterTimer > waterDelay) {
waterTimer = now;
strip2.clear();
for (int i = 0; i <= idx2; i++) {
strip2.setPixelColor(i, softGreen);
}
strip2.show();
idx2++;
if (idx2 >= LED_NUM) idx2 = 0;
}
if (dis <= finishDis) {
taskFinish = true;
strip2.fill(softGreen);
strip2.show();
Serial.println("★ Second sand table completed, green light constant on");
}
}
}
delay(100);
}
Code Features:
- RFID Card Switching: Swipe card to switch between standby, first LED strip, second LED strip, and reset
- Flowing Light Effect: Green LEDs light up sequentially with 180ms delay
- Ultrasonic Trigger: When object is within 5cm, LED strip turns to constant green light
- Extended LED Count: Supports 30 LEDs per strip (compared to 10 in blue version)
- Task Management: Three states - standby (0), first strip (1), second strip (2)
- Serial Monitoring: Real-time distance and status output for debugging
Heart Rate Monitoring Code
The following Arduino code monitors heart rate using an analog sensor and controls LED flashing based on heartbeat detection:
int heartPin = A0;
int ledPin = 3;
int heartValue = 0;
int lastHeartValue = 0;
int change = 0;
bool isFlashing = false; // Whether in flashing state
unsigned long lastFlashTime = 0;
bool ledState = false;
void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
Serial.begin(9600);
lastHeartValue = analogRead(heartPin);
Serial.println("=================================");
Serial.println("❤ Heart rate detection started (flashing mode)");
Serial.println("Heartbeat detected → LED flashing ✨");
Serial.println("Heartbeat lost → LED off ❌");
Serial.println("=================================");
}
void loop() {
heartValue = analogRead(heartPin);
change = abs(heartValue - lastHeartValue);
// ----- Determine if there is a heartbeat signal -----
if (heartValue < 50 || change > 200) {
// ✅ Has signal
if (!isFlashing) {
// Just transitioned from no signal to signal, print once
Serial.print("❤ Heartbeat detected! Value: ");
Serial.print(heartValue);
Serial.println(" → Start flashing ✨");
}
isFlashing = true;
} else {
// ❌ No signal
if (isFlashing) {
// Just transitioned from signal to no signal, print once
Serial.print("⏹ Heartbeat lost, value: ");
Serial.print(heartValue);
Serial.println(" → Turn off ❌");
}
isFlashing = false;
digitalWrite(ledPin, LOW); // Turn off immediately
ledState = false;
}
// ----- If in flashing state, keep flashing -----
if (isFlashing) {
if (millis() - lastFlashTime > 200) { // Switch every 200ms
ledState = !ledState;
digitalWrite(ledPin, ledState ? HIGH : LOW);
lastFlashTime = millis();
}
}
lastHeartValue = heartValue;
delay(300); // Detect every 300ms to avoid flooding serial monitor
}
Code Features:
- Analog Heart Rate Sensor: Reads heart rate data from analog pin A0
- Heartbeat Detection: Detects heartbeat when value < 50 or change > 200
- LED Flashing: LED flashes at 200ms intervals when heartbeat is detected
- Auto Shutoff: LED turns off immediately when heartbeat signal is lost
- Serial Monitoring: Real-time status output with emoji indicators for easy debugging
- Signal Stability: Uses absolute difference to detect significant changes in heart rate
Team Contribution
This final project represents collaborative research and design work by the Jowywlz team. Each member contributed to literature review, conceptual design, and technical planning.