Oscar Yturralde
Published

Automatic Alcohol dispenser

In order to prevent the spread of the virus, I made this dispenser, so people can disinfect without manipulating it. It works 9 cm away

BeginnerWork in progress2 hours856
Automatic Alcohol dispenser

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Arduino Nano R3
Arduino Nano R3
×1
5MP IR-sensitive Autofocus Camera Module
UDOO 5MP IR-sensitive Autofocus Camera Module
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Alcohol Dispenser Code

Code

Alcohol Dispenser Code

Arduino
No preview (download only).

Alcohol Dispenser Code

Arduino
#include <Servo.h>
Servo servoizq;
Servo servoder;
int sensor1 = 12;
int sensor2 = 10;
  void setup ()
{
    Serial.begin(9600);
    pinMode (sensor1, INPUT);
    pinMode (sensor2, INPUT);
    servoder.attach (9);
    servoizq.attach(8); 
    servoder.write(90); 
    servoizq.write(90);  
}  
  void loop ()
{
    int value = 0;
    int value2 = 0;
    value = digitalRead (sensor1);
    value2 = digitalRead (sensor2);
    
    if (value == 0 || value2 == 0 )
    { 
      servoder.write(0);
      servoizq.write(180);
      Serial.println("Si muestra actividad el dispensador");
      
    }
   if (value == 1 && value2 == 1)
   {
      servoder.write(90);
      servoizq.write(90);
      Serial.println("No muestra actividad el dispensador");
    } 
  delay(1000);
}

Credits

Oscar Yturralde

Oscar Yturralde

1 project • 1 follower

Comments