Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to make a smart dustbin using Arduino?

By Ayush Jain September 3, 2024

Smart technology refers to devices and systems that use advanced computing, connectivity, and data analytics to enhance functionality and efficiency. Devices such as smartphones, watches, and appliances connect to the Internet and one another via the Internet of Things (IoT), allowing for real-time data exchange and remote control.

One innovative application of this technology is creating a smart dustbin. In this electronics project, we’ll design this dustbin using Arduino and an ultrasonic sensor to simplify waste disposal while contributing to a cleaner world.

How it works

The smart dustbin uses an ultrasonic sensor to detect the presence of an object (in this case, trash) within a certain range. If detected, the sensor triggers a mechanism, which opens the dustbin’s lid, allowing a user to dispose of the trash. This includes an element of automation, reducing the need for contact with the dustbin—for a cleaner way to discard trash.

Figure 1. Prototype of smart dustbin using Arduino and the ultrasonic sensor HC-SR04.

Materials

  1. Arduino Uno
  2. Ultrasonic sensor (HC-SR04)
  3. Servo motor
  4. Jumper wires
  5. Power source (e.g., 9-V battery or a USB cable)
  6. Dustbin with a lid

Step-by-step instructions

1. Setting up the hardware
Let’s start with the connections to the Arduino board. 

Connect:

  • The ultrasonic sensor’s VCC pin with Arduino’s 5V pin
  • The ultrasonic sensor’s GND pin with Arduino’s GND pin 
  • The ultrasonic sensor’s echo pin with Arduino’s digital pin 5
  • The ultrasonic sensor’s Trig pin with Arduino’s digital pin 5
  • The servo motor with Arduino via the signal wire to digital pin 7, VCC to 3V3, and GND to GND
  • The battery’s positive to the VIN and its negative to the GND

Figure 2. The circuit diagram.

Writing the code

The code involves reading data from the ultrasonic sensor and controlling the servo motor based on that data. Below is a simple example of the code to get you started.

Testing

Upload the code to Arduino and power it up. Ensure the ultrasonic sensor is properly positioned inside the dustbin and facing outwards. Throw an object (trash) within the detection range of the dustbin’s sensor. The dustbin’s lid should open automatically for trash disposal.

Conclusion

Building a smart dustbin using Arduino and an ultrasonic sensor is a useful project that combines electronics, programming, and practicality. This project can also be customized by adding features such as Bluetooth connectivity and voice commands or by integrating it into a larger home automation system.

Videos

https://www.engineersgarage.com/wp-content/uploads/2024/07/GIF1.mp4
https://www.engineersgarage.com/wp-content/uploads/2024/07/GIF2.mp4

You may also like:


  • How to set-up and build a project using Arduino IoT…
  • low power design
    How to optimize Arduino for low power design

  • How to design pick-and-place robot using Arduino

  • How to design a weighing scale using Arduino

  • How to design an automatic streetlight system using Arduino

  • How to build an app-controlled alarm mat

  • How to design an IoT-based smart alarm

Filed Under: Circuit Design, Video
Tagged With: Arduino, circuitdesign, dustbin, hc-sr04, internetofthings, IoT, smartdevices, smarthome, ultrasonicsensor, videos
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe