This project builds a smart timer controller for UV helmet sanitizers, automating the sanitization cycle and providing visual feedback throughout the process. The system uses an Arduino Uno to trigger the helmet's built-in UV lamp via relay control, display countdown information on an LCD screen, and indicate sanitization status with dual RGB LEDs.
This guide provides a complete wiring diagram, parts list, and step-by-step assembly instructions starting with the display and button, then progressively adding relay control and RGB indicators. The included firmware handles button debouncing, relay pulse timing, and a three-minute sanitization countdown with color-coded status feedback so users know exactly when their helmet is ready.
Wiring diagram

Gather all the parts
Assemble it in 5 steps
1. Wire the display and Start button
With USB unplugged, connect the 5 V I2C LCD VCC to 5V, GND to GND, SDA to A4 (data), and SCL to A5 (clock). Wire the button between D2 and GND. Use a backpack set to address 0x27 and adjust its contrast screw if the text is hard to see.
2. Wire and test the relay by itself
Use a 5 V active-high relay module, not a bare 3 V relay. Connect VCC to 5V, GND to GND, and IN to D7. Fit the 10 kΩ resistor between IN and GND so the relay stays off during reset. Leave the sanitizer disconnected and check with a continuity meter that COM and NO close only briefly on a button press, not on reset or while holding the button down.
3. Connect only the external Start terminals
Unplug both devices. If the manual approves an isolated, normally open relay contact, wire COM and NO across the two documented Start terminals. Do not join either terminal to Arduino power or ground. Verify the configured pulse duration against the manual before connecting.
- Never open the UV unit or switch lamp or mains wiring. The original lid interlock and cycle controller must remain independent of the Uno.
4. Add the RGB Start indicator
With USB unplugged and the UV unit disconnected, connect the common cathode to GND. Connect R to D4, G to D5, and B to D6, each through its own 330 Ω resistor. Check the LED pin diagram before wiring. Deploy and press Start to check that the violet light turns off after the 3-minute countdown. This light does not indicate UV operation.
5. Add the second RGB indicator
Unplug USB and keep the sanitizer disconnected. Connect the second common-cathode RGB LED's common leg to GND. Connect R to D8, G to D9, and B to D10, each through its own new 330 Ω resistor. Leave the first LED wired as it is. After deploying, press Start and check that both LEDs glow violet during the countdown and turn off together.
Review all connections
1. Connections between "screen" and "Arduino"
2. Connections between "start" and "Arduino"
3. Connections between "relay" and "Arduino"
4. Connections between "pulldown" and "Arduino"
5. Connections between "rgb_R" and "Arduino"
6. Connections between "rgb_G" and "Arduino"
7. Connections between "rgb_B" and "Arduino"
8. Connections between "indicator" and "Arduino"
9. Connections between "rgb2_R" and "Arduino"
10. Connections between "rgb2_G" and "Arduino"
11. Connections between "rgb2_B" and "Arduino"
12. Connections between "indicator2" and "Arduino"
Deploy the firmware
#include <Arduino.h>
#include <Wire.h>
constexpr uint8_t relay=7, button=2, addr=0x27;
// Set to the momentary contact duration documented by the unit maker.
constexpr unsigned long pulseMs=250;
constexpr unsigned long countdownDelayMs=1000; // Wait one second before the LED countdown.
constexpr unsigned long indicatorMs=3UL * 60UL * 1000UL;
constexpr unsigned long doneMs=5000;
constexpr uint8_t rgbRed=4, rgbGreen=5, rgbBlue=6;
constexpr uint8_t rgbRed2=8, rgbGreen2=9, rgbBlue2=10;
// Common PCF8574 backpack: P0=RS, P1=RW, P2=E, P3=backlight.
void port(uint8_t value){Wire.beginTransmission(addr);Wire.write(value);Wire.endTransmission();}
void nibble(uint8_t value){port(value);port(value|4);port(value);delayMicroseconds(50);}
void lcdByte(uint8_t value,bool data=false){
const uint8_t flags=8|uint8_t(data);
nibble((value&0xf0)|flags);nibble((value<<4)|flags);
}
void showRow(uint8_t address,const char *text){
lcdByte(address);
for(uint8_t i=0;i<16;++i)lcdByte(*text ? *text++ : ' ',true);
}
void show(const char *text,const char *second=""){
showRow(0x80,text);
showRow(0xc0,second);
}
void showStartPrompt(){
show("Press the button");
}
void setup(){
digitalWrite(relay,LOW);pinMode(relay,OUTPUT);pinMode(button,INPUT_PULLUP);
const uint8_t rgbPins[]={rgbRed,rgbGreen,rgbBlue,rgbRed2,rgbGreen2,rgbBlue2};
for(uint8_t pin : rgbPins) {
digitalWrite(pin,LOW);pinMode(pin,OUTPUT);
}
Wire.begin();Wire.setWireTimeout(3000,true);
delay(50);
nibble(0x38);delay(5);nibble(0x38);delay(1);nibble(0x38);nibble(0x28);
lcdByte(0x28);lcdByte(0x08);lcdByte(0x01);delay(2);
lcdByte(0x06);lcdByte(0x0c);showStartPrompt();
}
void loop(){
static bool raw=false,stable=false,armed=false,active=false,lit=false,waiting=false,done=false;
static unsigned long changed=0,started=0,countdownStarted=0,doneStarted=0;
static int lastShown=0;
const unsigned long now=millis();
if(active && now-started>=pulseMs){digitalWrite(relay,LOW);active=false;}
const bool pressed=digitalRead(button)==LOW;
if(pressed!=raw){raw=pressed;changed=now;}
if(now-changed>=35){
if(!raw){armed=true;stable=false;}
else if(!stable){
stable=true;
if(armed && !active && !waiting && !lit && !done){
armed=false;started=now;active=true;waiting=true;lit=false;
lastShown=0;
digitalWrite(relay,HIGH);
show("Wait lang boss");
}
}
}
if(waiting && now-started>=countdownDelayMs){
waiting=false;lit=true;countdownStarted=now;
digitalWrite(rgbRed,HIGH);digitalWrite(rgbBlue,HIGH);
digitalWrite(rgbRed2,HIGH);digitalWrite(rgbBlue2,HIGH);
}
if(lit){
const unsigned long elapsed=now-countdownStarted;
if(elapsed>=indicatorMs){
digitalWrite(rgbRed2,LOW);digitalWrite(rgbBlue2,LOW);
digitalWrite(rgbRed,LOW);digitalWrite(rgbBlue,LOW);lit=false;done=true;doneStarted=now;
show("Tapos na boss");
}else{
const int seconds=(indicatorMs-elapsed+999UL)/1000UL;
if(seconds!=lastShown){
lastShown=seconds;
char text[17];
snprintf(text,sizeof(text),"%d:%02d",seconds/60,seconds%60);
show("Launching in",text);
}
}
}
if(done && now-doneStarted>=doneMs){done=false;showStartPrompt();}
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




