Project tutorial
AutoSteri

AutoSteri © CC BY-NC-SA

AutoSteri is a small and compact automatic UV sterilization system that uses a PIR to detect a human and cleans when they leave.

  • 3,347 views
  • 2 comments
  • 16 respects

Components and supplies

Ard nano
Arduino Nano R3
any Arduino will work
×1
13285 01
PIR Motion Sensor (generic)
×1
09590 01
LED (generic)
(High power UVc LED for example https://www.aliexpress.com/item/4001039503363.html?spm=a2g0s.9042311.0.0.66434c4dVrFIlX )
×1
Fairchild semiconductor pn2222abu. image
General Purpose Transistor NPN
(can be replaced with a relay or dc motor driver)
×1
12002 04
Breadboard (generic)
Can use a breadboard or the custom PCB provided
×1
5.5mm jack screw terminal
×1
11026 02
Jumper wires (generic)
×1
Mfr 25frf52 100r sml
Resistor 100 ohm
×1

Necessary tools and machines

3drag
3D Printer (generic)
Optional

Apps and online services

About this project

The Basics:

The system uses a PIR sensor to detect the presence of a person and then after it detects the person leaving turns on a UVc LED for 15 minutes to disinfect the area where the person was.

Applications:

  • Sterilize package deliveries
  • Sterilize elevators
  • Sterilize hallways
  • Sterilize offices
  • etc.

The Electronics Build (without PCB):

Take your Arduino and place it on the centerline of your breadboard.

Connect your power source connector, e.g. 5.5mm jack, to the VIN and GND pins of the Arduino.

Then connect the PIR sensor with the 5V pin to the 5V pin on the Arduino and the GND to GND and the data line to a digital pin, e.g. pin 2.

After that take your transistor or motor driver or relay and connect the triggering pin to a digital pin, e.g. pin 3. If you use a relay remember to place a resistor in series with the triggering line before going to ground. If you use a Motor driver hook up the driver according to the manufactures instructions and connect the triggering pin to the digital pin.

If using the transistor or relay connect one side to VIN and the other to the positive side of your LED. Then connect the other side of the LED to GND.Don't forget a resistor if your led requires on at the supplied voltage (probably 12v).

If using a Motor driver connect the led to the motor pins with the correct polarity. Don't forget a resistor if your led requires on at the supplied voltage (probably 12v).

The Electronics Build (with PCB):

With the PCB the build will be exactly the same but simply solder all of your components on to the board in their indicated locations.

For the PCB one needs to use an Arduino NANO, 1-4x 3535 SMD LED, or connect to the 2 pins for other LEDs, an NPN transistor that can handle the current of your led, a generic PIR sensor, and a through-hole 5.5mm power jack.

The Case Build (without PCB):

If you do not have the PCB you can either print the Tall case which can fit a tiny breadboard inside or you can make your own case out of any box. Just cut a hole in the top for the LED and PIR and one in the side for power.

The Case Build (with PCB):

If building with the PCB print the slim case and place the assembled PCB inside and screw or glue it down. Then attach the top case using 2 screws.

The Code:

int ledPin = 3;                // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
bool needclean = false;
long cleanstart = 0;
long safetytimer = 0;
long safetydelay = 100000;// 100 seconds
//long safetydelay = 5000;// 5 seconds for debug
long cleanlength = 900000*3+safetydelay; // 5 minutes
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input
Serial.begin(9600);
// Serial.println(cleanlength);
}
void loop() {
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, LOW); // turn LED OFF
needclean = false;
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
}
else {
//digitalWrite(ledPin, HIGH); // turn LED ON
needclean = true;
if (pirState == HIGH) {
// we have just turned of
Serial.println("Motion ended!");
safetytimer = millis();
cleanstart = millis();
// We only want to print on the output change, not state
pirState = LOW;
}
}
if (millis() - safetytimer >= safetydelay) {
if (needclean == true) {
if (millis() - cleanstart >= cleanlength) {
digitalWrite(ledPin, HIGH);
needclean = false;
}
else {
digitalWrite(ledPin, HIGH);
Serial.println("cleaning : ");
Serial.print((cleanlength - (millis() - cleanstart))/1000);
Serial.println();
delay(10);
}
}
}
}

Code

Arduino codeArduino
int ledPin = 3;                // choose the pin for the LED
int inputPin = 2;               // choose the input pin (for PIR sensor)
int pirState = LOW;             // we start, assuming no motion detected
int val = 0;                    // variable for reading the pin status
bool needclean = false;
long cleanstart = 0;
long safetytimer = 0;
long safetydelay = 100000;// 100 seconds
//long safetydelay = 5000;// 5 seconds for debug
long cleanlength = 900000*3+safetydelay; // 5 minutes
void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare sensor as input

  Serial.begin(9600);
 //  Serial.println(cleanlength);
}

void loop() {
  val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, LOW);  // turn LED OFF
    needclean = false;
    if (pirState == LOW) {
      // we have just turned on
      Serial.println("Motion detected!");
      // We only want to print on the output change, not state
      pirState = HIGH;
    }
  } else {
    //digitalWrite(ledPin, HIGH); // turn LED ON
    needclean = true;
    if (pirState == HIGH) {
      // we have just turned of
      Serial.println("Motion ended!");
      safetytimer =  millis();
      cleanstart = millis();
      // We only want to print on the output change, not state
      pirState = LOW;
    }
  }
  if (millis() - safetytimer >= safetydelay) {
    if (needclean == true) {
      if (millis() - cleanstart >= cleanlength) {
        digitalWrite(ledPin, HIGH);
        needclean = false;
      }
      else {
        digitalWrite(ledPin, HIGH);
        Serial.println("cleaning : ");
        Serial.print((cleanlength - (millis() - cleanstart))/1000);
        Serial.println();
        delay(10);
      }
    }
  }
}

Custom parts and enclosures

Bottom With PCB
Bottom Without PCB
Arduino Code
uv_pir_J8JFhW82w0.ino
Gerber PCB files
autosteri_uIf5nuModF.zip

Schematics

PCB Schematic
Screen shot 2020 06 11 at 1 55 16 am uyvheqddmd
PCB Diagram 1
Screen shot 2020 06 11 at 1 55 38 am 3lyrqwcsdi
PCB Diagram 2
Screen shot 2020 06 11 at 1 55 29 am qeliklgutz

Comments

Similar projects you might like

SERENA: Alarm Control Panel

Project tutorial by Michael Marinis

  • 9,242 views
  • 2 comments
  • 20 respects

Night Light Assistant

Project showcase by Gabriele Fugazzi

  • 6,388 views
  • 9 comments
  • 25 respects

This Device Will Never Get You Heat Stroke

Project tutorial by Hemesh Chadalavada

  • 4,445 views
  • 3 comments
  • 15 respects

PIR Sensor Tutorial - With Or Out Arduino

by Tarantula3

  • 16,637 views
  • 6 comments
  • 35 respects

Health Kit: Humidity and Temperature Control

Project tutorial by Diana Khalipina

  • 11,260 views
  • 2 comments
  • 51 respects
Add projectSign up / Login