Smart Drawer

Published Aug 02, 2024
 1 hours to build
 Beginner

It is a smart drawer in which if you move towards the sensor the drawer will open automatically and if you move away from the sensor the drawer will close automatically.

display image

Components Used

SG90 micro servo Motor
DFRobot Accessories 9g micro servo (1.6kg)
1
Ultrasonic Module HC-SR04
Ultrasonic module HC-SR04 is generally used for finding distance value and obstacle detection. It can operate in the range 2cm-400cm.
1
Arduino Uno R3
1
Description

Step1: Cardboard cutout

To make this first u have to make a cardboard hollow cube box attach two screw on left side and two screw on right.

 

Step2: 

put a cardboard piece on it this structure will look like a drawer.

Then attach a servo on the back side with a tape or glue it.

Step3: Circuit Connection

I have used ultrasonic sensor for sensing, when we put our hand near to it, it senses the close distance and opens the drawer.

Schematic

As per the circuit connect a ultrasonic sensor and upload coding in the arduino .

 

Step4: Code

#include <Servo.h>
Servo my1;
int trigPin=11;
int echoPin= 9;
long duration, cm, inches;
void setup()
{
  my1.attach(8);
  Serial.begin(9600);
  pinMode(trigPin,OUTPUT);
  pinMode(echoPin,INPUT);
}
void loop()
{
  digitalWrite(trigPin,LOW);
  delayMicroseconds(1);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(1);
  digitalWrite(trigPin,LOW);
  pinMode(echoPin,INPUT);
  duration=pulseIn(echoPin,HIGH);
  cm=(duration/2)/29.1;
  inches=(duration/2)/74;
  Serial.print(inches);
  Serial.print("in");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  delay(1000);
  my1.write(0);
  if (cm<20){
    my1.write(90);
  }
  if (cm>20){
    my1.write(0);
  }
}  

 

Video

here is the implementation steps:

Codes

Downloads

smart drawer Download
components Download
smart drawer code Download
circuit Download

Institute / Organization

City Montessori School Gomti Nagar 1 Uttar Pradesh Lucknow
Comments
Ad