iaarzoo40
Published © MIT

Smart Shop Dispenser-Bot

I created a smart shop dispenser-Bot that will guide you to wash your hands for minimum 20 seconds.

AdvancedFull instructions provided55
Smart Shop Dispenser-Bot

Things used in this project

Hardware components

Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Cable Management Tool, Cable Tie Removal Tool with Cutter
Cable Management Tool, Cable Tie Removal Tool with Cutter
×1
Soldering iron
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Amazon Web Services Ultrasonic sensor HC-SR04
You need two arduino for it .
Amazon Web Services Arduino UNO
You need two ultrasonic for it .
Amazon Web Services Servo Motor
You need two servo motor for it .
Amazon Web Services MP3 player
Amazon Web Services Tactile Switch
Amazon Web Services Electric Wire

Story

Read more

Schematics

Ultrasonic 1

How to attach ultrasonic senser,servo motor and led with the arduino board .

Ultra sonic 2

how to attach ultrasoniuc,servo with arduino for press the tactile switch

Code

Ultrasonic 1

C/C++
This code is use for ultrasonic 1 to press the Handwash
                                                                         //AARZOO ISLAM'S PROGRAMING
                                                                         
//this sketch is for smart shop dispenser to press the handwash with servo motor and glow the light....

#include <Servo.h> 
  
#define trigPin 7
 
#define echoPin 5

#define ledPin 13

Servo servo;

int sound = 250; 
 
void setup() { 
 
Serial.begin (9600); 
 
pinMode(trigPin, OUTPUT);
 
pinMode(echoPin, INPUT); 

pinMode(ledPin, OUTPUT);

servo.attach(8); 
  
} 
 
void loop() { 
 
long duration, distance; 

 
digitalWrite(trigPin, LOW); 
 
delayMicroseconds(2); 
 
digitalWrite(trigPin, HIGH); 
 
delayMicroseconds(10); 
 
digitalWrite(trigPin, LOW); 
 
duration = pulseIn(echoPin, HIGH); 
 
distance = (duration/2) / 29.1; 
 
if (distance < 13) { 
 
Serial.println("the distance is less than 20"); 
 
servo.write(180);   //Servo ta kota ta khurbe  ( MP 100 )    created by Aarzoo

digitalWrite(ledPin, HIGH);

} 
 
else { 
 
servo.write(0);

digitalWrite(ledPin, LOW);

} 
 
if (distance > 60 || distance <= 0){   //object ta koto dure ale servo ta active hobe
 
Serial.println("The distance is more than 60");

}  
 
else { 
 
Serial.print(distance); 
 
Serial.println(" cm"); 

} 
 
delay(1000);    //Servo ta kotokhon por active hobe
 
} 

Ultra sonic 2

C/C++
This code is use for ultrasonic 2 to use for press the tactile switch for activate the MP3 player
                                                                        //AARZOO ISLAM'S PROGRAMMING
 
 #include <Servo.h>   //servo library
Servo servo;
int trigPin = 7;    
int echoPin = 5;   
int servoPin = 10;
int led= 13;
long duration, dist, average;   
long aver[3];   //array for average

void setup() {       
   Serial.begin(9600);
   servo.attach(servoPin);  
   pinMode(trigPin, OUTPUT);   
   pinMode(echoPin, INPUT);  
   servo.write(0);         //close cap on power on
   delay(100);
   servo.detach(); 
} 

void measure() {  
digitalWrite(10,HIGH);
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(15);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
dist = (duration/2) / 29.1;    //obtain distance
} 
void loop() { 
 for (int i=0;i<=2;i++) {   //average distance
   measure();               
  aver[i]=dist;            
   delay(10);     //delay between measurements    //servo ta koto khon por activate hobe...   // created by AARZOO ISLAM
 }
dist=(aver[0]+aver[1]+aver[2])/3;    

if ( dist<10) { //Distace ta koto hobe
servo.attach(servoPin);
delay(1);
servo.write(0);  
delay(33700);   
servo.write(150);    
delay(2000);  
servo.detach(); 
}
Serial.print(dist);
}

Credits

iaarzoo40

iaarzoo40

0 projects • 0 followers

Comments

Add projectSign up / Login