George Kartsonas
Published © Apache-2.0

UVC Disinfectant Light System for Baggage & Parcels

During this pandemic one of the many industries that has been affected is the transportation of goods, its time to make packages safe again.

BeginnerFull instructions provided1 hour561
UVC Disinfectant Light System for Baggage & Parcels

Things used in this project

Hardware components

4-CHANNEL RELAY CONTROLLER FOR I2C
ControlEverything.com 4-CHANNEL RELAY CONTROLLER FOR I2C
×1
UVC Light Bulb
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
The Things Uno
The Things Industries The Things Uno
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

The Things Uno HC-SRO4 Wiring Diagram

Code

Distance Measurement Code

Arduino
#define trigPin 2
#define echoPin 3

long duration;
int distance;
int relay = 13;

void setup() {
 
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(relay, OUTPUT);
  
  Serial.begin(9600);
}
void loop() {
  
  digitalWrite(trigPin, LOW);
  delayMicroseconds(5);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  
  distance = duration * 0.034 / 2;
 
  if (distance <= 10)
  {
    digitalWrite(relay,HIGH);
  }
  else if (distance >= 10)
  {
    digitalWrite(relay,LOW);
  }
  
  delay(50);
}

Credits

George Kartsonas

George Kartsonas

19 projects • 46 followers

Comments