Waivio

Recommended Posts

DETAILED EXPLANATION OF HOW TO MAKE AN AUTOMATED WIRELESS SMART SOAP / LIQUID DISPENSER USING ARDUINO | IR PROXIMITY SENSOR | SERVO MOTOR

2 comments

techlhab200.003 years ago3 min read

The need for smart devices is growing rapidly as they make life easier and smarter for their users. I'm @techlhab and today I would be sharing with us how to make is DIY Automated Smart Soap or Liquid Dispenser using Arduino Uno microcontroller, IR Proximity Sensor, and Servo Motor as the major hardware components which don't require to be touched before it dispenses the liquid or soap put in it. Its kinds were highly utilized during the pandemic to prevent the spread of the virus. While the software components are; the Arduino IDE, Embedded C/C++ programming language, and fritzing for circuit design and simulation.

https://files.peakd.com/file/peakd-hive/techlhab/23vsou42YfN2rxpsEJx2whbz7TQvqueZLpXC1bSBvtYYeFvg9KD7Mbes839gKWWyHfsoM.png


HARDWARE COMPONENTS


  • Arduino Uno
  • Servo Motor
  • IR Proximity Sensor

SOFTWARE COMPONENTS


  • Arduino IDE (Integrated Development Environment)
  • Embedded C/C++
  • Fritzing

The Arduino Uno


The Arduino Uno is a popular open-source microcontroller that uses the ATMEGA328P PIC (Programmable Integrated Circuit) chip developed by Arduino.cc. It has 14 digital I/O (Input / Output) pins and 6 analog I/O pins.

In this project, that is the stopwatch, the Arduino Uno microcontroller serves as the brain of the device, with which other components connected to it sends and receives instructions to and from respectively based on the code or instructions programmed to the microcontroller.

https://files.peakd.com/file/peakd-hive/techlhab/244xyyyQn72SM1qWMGVMY2A2KDdotE3DHveszmgXZEFgQiRDdykRBgK5LjT3g3imKaEs5.png


The Servo Motor


It is a micro motor that converts electrical signals to produce rotary effects, with which the speed, angular or linear position, velocity and acceleration can be controlled precisely with a microcontroller like the arduino uno.

In this project or tutorial, the servo motor is used in opening and closing the top lid of the liquid or soap dispenser.

It has 3 pins which are:

  • Vcc
  • Gnd
  • Signal


https://files.peakd.com/file/peakd-hive/techlhab/23rBHxzyoug4Hgio8hSqLQ6mmUWjeHcKJzxoH1ruEKNLr8wPv2ybkXe3zA6iMmrR8BpV4.png


The IR Proximity Sensor Module


The IR (Infrared) Proximity Sensor as an IR transmitter and a IR receiver on it which it uses to detect objects and obstructions in front of it as the IR transmitter keeps on transmitting infrared light and any object obstructs the transmitted light it reflects the light to the IR receiver which is how the sensor is been able to detect or monitor objects and obstacles.

So when the sensor detects objects or obstacles it sends the information to the Arduino Uno which then instructs the servo motor to dispense the liquid or soap in the dispenser.

It also has 3 pins which are:

  • Vcc
  • Gnd
  • Out


https://files.peakd.com/file/peakd-hive/techlhab/23zSNTSZXvcG3QwiEoqVY6fpin2s84J4hoDifD1b7TbFsgwjaKcyh25evyCTREtLTDsjz.png


THE HARDWARE CONNECTIONS


  • Conneting the IR Proximity Sensor to the Arduino Uno
Arduino UnoIR Proximity Sensor
15vVcc
2GndGnd
3D9Output
  • Connecting the Servo Motor to the Arduino Uno
Arduino UnoServo Motor
15vVcc
2GndGnd
3D8Signal

THE WIRING DIAGRAM


https://files.peakd.com/file/peakd-hive/techlhab/242P2Nqkv8CgiFwKLd4ufwgKz2umDgk7gY43Nc2yJzdkHZeU1Xj9n3sZjqk4PC1hP1jxd.png


THE CIRCUIT DIAGRAM


https://files.peakd.com/file/peakd-hive/techlhab/23t8CfKPvxwqdPdsvp5bmr5vHMqqi2rUvWP4HrVFr3y7SyLghjdtSrx5TBAeLqMifH1pL.png


CODE



#include <Servo.h>
Servo myservo; 
int pos;
int Signal = 8;
void setup() 
{
  pinMode(Signal, INPUT);
  myservo.attach(9);  
}
void loop() {
  int buttonState = digitalRead(Signal);
  delay(1); 
if (buttonState == 0)
    {
  for ( ;pos >= 40; pos -= 1) 
   { 
    myservo.write(pos);             
    delay(15);                        
   }
    }
else
    {
  for ( ;pos <= 80; pos += 1) 
  { 
    myservo.write(pos);             
    delay(5);                        
   }
    }
}


Thanks for reading and visiting my blog 🤝. Kindly support this post by reblogging, upvoting, and commenting, it would be highly appreciated.

Images used in this post were all designed by me using frizting, a circuit design and simulation software, and canva.

Posted with STEMGeeks

Comments

Sort byBest
AI
Waivio AI Assistant
How can I help you today?