Cempasuchil Night Light
This project is inspired by Día de los Muertos. A celebration originating in Mexico where people go cemeteries to honor the lives of those they love that have passed. People create ofrendas (altars) made out of cempasúchil (marigold). The whole cemetery is filled with them as they are an important part of this holiday. They are known as flower of the dead, which are supposed to bring the dead's spirits back to their loved ones. This year was hard for me as I lost my beloved dog, when I wasn't home. Many people, especially younger generations, may have suffered the same with not being home when their loved ones passed, so to keep traditions alive I decided to design a Cempasúchil night light. I wanted to create a small interactive object that keeps the tradition present in everyday life, also since not everyone is able to build altars.
The design is built with four modes:
Mode 1 - Breathing Glow
Mode 2 - Sound Reactive (pulses brighter to music)
Mode 3 - Steady Marigold Light
Mode 4- Sleep Mode (dim light)
I originally wanted mode 2 to be beat reactive, however it didn't work as i first attempted with MAX4466 microphone and then KY-037 Microphone Sound Sensor.
Supplies
Arduino Uno R3 (, Jumper Wires, USB Power)- https://www.coupang.com/vp/products/6557049479?itemId=14662391525&vendorItemId=92619313043&q=%EC%95%84%EB%91%90%EC%9D%B4%EB%85%B8%20R3&searchId=f56a639012323277&sourceType=search&itemsCount=60&searchRank=1&rank=1
RGB LED - https://www.coupang.com/vp/products/1132906817?itemId=2101597658&vendorItemId=70100437984&src=1042503&spec=70304777&addtag=400&ctag=1132906817&lptag=I2101597658V70100437984A356499998R&itime=20260607191311&pageType=PRODUCT&pageValue=1132906817&wPcid=17591092720430911087698&wRef=www.google.com&wTime=20260607191311&redirect=landing&AdNodeId=356499998&gclid=Cj0KCQjwrZTRBhDSARIsAHidYfdCAdWKDlfXU7a1JOHtYwPyia8mCE6SCyk6_JEMTDQT1otnivJ3yNYaAjC3EALw_wcB&mcid=c2c3d6e77ce743eabb581f2b1509b1ae&campaignid=&adgroupid=
Touch Sensor TTP223 - https://www.coupang.com/vp/products/9149977067?itemId=26941418122&vendorItemId=93910582673&src=1042503&spec=10304025&addtag=400&ctag=9149977067&lptag=9149977067-26941418122&itime=20260607190943&pageType=PRODUCT&pageValue=9149977067&wPcid=17591092720430911087698&wRef=www.google.com&wTime=20260607190943&redirect=landing&gclid=Cj0KCQjwrZTRBhDSARIsAHidYfdv6JwHtzoawnDRhr9Quc1f4V7rmDWCj59X382cEeP8MJg85rkbTkIaAniaEALw_wcB&mcid=dcc324283c3749e4b62852a2d4d48259&campaignid=22815108882&adgroupid=
KY-037 Microphone Sound Sensor - https://www.coupang.com/vp/products/7177934106?itemId=18097755213&vendorItemId=4267330706&q=%EC%95%84%EB%91%90%EC%9D%B4%EB%85%B8+%EB%A7%88%EC%9D%B4%ED%81%AC+%EB%AA%A8%EB%93%88&searchId=9e736cfa4179839&sourceType=search&itemsCount=36&searchRank=1&rank=1&traceId=mqepge3f
Project Goal
The goal was to design and build an interactive marigold-inspired night light that combines:
- 3D printing
- Arduino programming
- Sensor integration
- User interaction
The night lamp was designed to resemble a blooming marigold flower while providing ambient lighting and interactive features.
Electronics Planning & Wiring Assembly
Touch Sensor
Interaction:
- Touch once → next mode
- Cycle through four modes
LDR Sensor
Function:
- Lamp remains off in bright conditions
- Lamp activates in darkness
MAX4466 Microphone
Function:
- Lamp reacts to music beats
- Returns to steady glow when no music is detected
Connections
RGB LED:
- Red → D9
- Green → D10
- Blue → D11
Touch Sensor:
- OUT → D2
- VCC → +rail
- GND → GND
MAX4466:
- OUT → A1
- VCC → +rail
- GND → GND
LDR:
- One leg → 5V
- Other leg → A0
- 10kΩ resistor from A0 → GND (-rail)
Programming & Testing
Multiple arduino codes were used to test.
Full Arduino Code:
// ================= PIN SETUP =================
const int R = 9;
const int G = 10;
const int B = 11;
const int micPin = A1;
const int touchPin = 2;
// ================= MODE CONTROL =================
int mode = 0;
bool lastTouchState = LOW;
unsigned long lastTouchTime = 0;
// ================= BREATHING =================
int breath = 10;
int dir = 1;
// ================= SETUP =================
void setup() {
pinMode(R, OUTPUT);
pinMode(G, OUTPUT);
pinMode(B, OUTPUT);
pinMode(touchPin, INPUT);
Serial.begin(9600);
}
// ================= LOOP =================
void loop() {
bool touchState = digitalRead(touchPin);
if (touchState == HIGH &&
lastTouchState == LOW &&
millis() - lastTouchTime > 300) {
mode++;
if (mode > 3)
mode = 0;
lastTouchTime = millis();
Serial.print("Mode: ");
Serial.println(mode);
}
lastTouchState = touchState;
switch (mode) {
case 0:
breathingMode();
break;
case 1:
musicMode();
break;
case 2:
constantMode();
break;
case 3:
sleepMode();
break;
}
}
// ================= MODE 1 =================
// Breathing Marigold Glow
void breathingMode() {
breath += dir;
if (breath >= 255)
dir = -1;
if (breath <= 10)
dir = 1;
analogWrite(R, breath);
analogWrite(G, breath * 0.24);
analogWrite(B, 0);
delay(15);
}
// ================= MODE 2 =================
// Sound Reactive Marigold
void musicMode() {
int minVal = 1023;
int maxVal = 0;
for (int i = 0; i < 200; i++) {
int sample = analogRead(micPin);
if (sample < minVal)
minVal = sample;
if (sample > maxVal)
maxVal = sample;
}
int level = maxVal - minVal;
Serial.print("Level = ");
Serial.println(level);
// Quiet = dim glow
// Music = brighter glow
int brightness = map(level, 1, 6, 20, 255);
brightness = constrain(brightness, 20, 255);
analogWrite(R, brightness);
analogWrite(G, brightness * 0.24);
analogWrite(B, 0);
delay(20);
}
// ================= MODE 3 =================
// Constant Marigold
void constantMode() {
analogWrite(R, 255);
analogWrite(G, 60);
analogWrite(B, 0);
}
// ================= MODE 4 =================
// Sleep Mode
void sleepMode() {
analogWrite(R, 15);
analogWrite(G, 4);
analogWrite(B, 0);
}
3D Modeling Design
The lamp was divided into two main parts.
Part 1: Flower Shell
Purpose:
- Diffuse light
- Create the marigold appearance
Design Features:
- Hollow interior
- LED chamber
- Hidden sensor locations
- Wire routing path
Dimensions:
Diameter: 120 mm
Height: 60 mm
Part 2: Base
Purpose:
- Store electronics
Design Features:
- Hollow interior
- Arduino compartment
- USB power opening
Dimensions:
- Diameter: 90 mm
- Height: 40 mm