Pegun
Published © GPL3+

Automatic spray sterilizer

The automatic spary sterillizer can automatic spray & disinfection when the ultrasonic moudle inductes the objects around 1.5 meters.

IntermediateProtip10 hours6
Automatic spray sterilizer

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Rotary Solenoid, 2 in-lb
Rotary Solenoid, 2 in-lb
×1
Grove - Relay
Seeed Grove - Relay
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

Automatic sterilizer

Schematics

Automatic sterilizer schematic

what is How to connect and how to control

Code

Automatic sterilizer

C/C++
This is a code of Automatic sterilizer, running on Arduino Uno. Once any object approaches the sterilizer, the device will control the relay and sterilizer solenoid valve,
#include <SR04.h>
#include <SoftwareSerial.h>
//#include <Servo.h>
#define EN 2
long dis1;
int val = 0;
SR04 sr04 = SR04(12, 13);//eco tri

void setup() {
  pinMode(EN, OUTPUT);
  Serial.begin(9600);
  while (!Serial) {
    ;
  }
 }

void loop() { // run over and over
  dis1 = sr04.Distance();
  Serial.print(dis1);
  Serial.print("\n");
  if (dis1>= 6&&dis1<=120 ) 
  {
      digitalWrite(EN, HIGH);
      delay(500);
      digitalWrite(EN, LOW);
      delay(100);
      
          }
  if(dis1>120 )
   {
     digitalWrite(EN, LOW);
     delay(10);}
    
}

Credits

Pegun

Pegun

1 project • 0 followers

Comments

Add projectSign up / Login