Skip to content
ThinkNMake — Don't just think. Make it.
IntermediateAges 8–16 3 h 50 min

Smart Dustbin

smart dustbin will open automatically when human approaches near

Project kit

$16.49

6 parts in one box

Unlocks the code, wiring and step-by-step guide.

Or get the kit

$42.29

ThinkNMake Maker Kit · 6 projects

Smart Dustbin

Objective

To create a touchless dustbin that automatically opens when a person approaches.

How it works

The ultrasonic sensor measures distance. When a hand comes within a preset range, Arduino commands the servo motor to open the lid. After a few seconds, the lid closes automatically.

Components you'll need

ComponentQtyAvailabilityPrice
HC-SR04 Ultrasonic Sensor×1In stock$1.19
SG90 Micro Servo×1In stock$1.39
Arduino UNO R3 (compatible)×1In stock$5.19
Breadboard medium×1In stock$0.99
Jumper Wire Set (120 pcs)×1In stock$2.99
4×AA Battery Holder with Switch×1In stock$0.59
Bought one by one$12.34

All of these come in ThinkNMake Maker Kit.

Circuit & connections

The full wiring diagram and pin-by-pin connections.

Already bought it? Log in

Code

The complete, tested sketch (53 lines), ready to upload.

Already bought it? Log in

Step-by-step instructions

7 illustrated steps:

  1. 1Step 1
  2. 2Step 2
  3. 3Step 3
  4. 4Step 4
  5. 5Step 5
  6. 6Step 6
  7. 7Step 7
Already bought it? Log in

Troubleshooting

Fixes for the problems makers hit most often on this build.

Already bought it? Log in