Intelligent Trash Bin Powered by Arduino UNO

Arduino 05-06-26
18 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- Arduino program

 

Objective of the project

The objective of this project is to design and build an intelligent trash bin that opens and closes its lid automatically without physical contact.

The system uses an Arduino UNO, an HC-SR04 ultrasonic sensor, and an SG90 servo motor to improve hygiene and make waste disposal more convenient.

Operation (Functioning)

The HC-SR04 ultrasonic sensor is installed on the top of the trash bin to detect the presence of a hand or an object approaching the lid. The sensor continuously measures the distance between the bin and nearby objects.

When an object is detected within a predefined distance, the Arduino UNO processes the sensor data and sends a control signal to the SG90 servo motor. The servo motor then rotates to open the lid automatically.

After a short delay, allowing the user to dispose of the waste, the Arduino UNO commands the servo motor to return to its initial position, closing the lid. The process is repeated each time an object is detected near the sensor.

This automatic operation makes the trash bin more hygienic, practical, and user-friendly by eliminating the need to touch the lid.

 

Required Components

1. Arduino UNO

Arduino Uno

The Arduino UNO is the main control unit of the intelligent trash bin. It receives distance measurements from the HC-SR04 ultrasonic sensor, processes the data, and sends commands to the SG90 servomotor to open or close the lid.

2. HC-SR04 sensor

HC-SR04

The HC-SR04 is used to detect the presence of a hand or an object near the trash bin. It emits ultrasonic waves and measures the time taken for the echo to return, allowing it to calculate the distance between the sensor and the detected object.

3. Servo motor

The SG90 servomotor is responsible for moving the trash bin lid. It receives control signals from the Arduino UNO and rotates to a specific angle to open the lid. After a short delay, it returns to its original position to close the lid.

4. Jumper Wires

Jumper wires

Jumper wires are used to establish electrical connections between the Arduino UNO board, the HC-SR04 sensor and the servo motor.

 

Circuit Connections of system

 

1- Connection of HC-SR04 sensor to Arduino UNO

HC-SR04 sensor Arduino UNO
VCC 3V
GND GND
Trig D4
Echo D3

 

2- Connection of servo motor to Arduino UNO

Servo motor Arduino UNO
red wire (+) 5V
Brown wire (-) GND
Yellow wire (S) D2

Arduino program

This Arduino program controls an intelligent trash bin using an HC-SR04 ultrasonic sensor and an SG90 servomotor.

You must install this library : Ultrasonicfor HC-SR04 sensor

 

Explanation of the program

At startup, the Arduino UNO initializes serial communication and sets the servomotor to the closed position (0°). The ultrasonic sensor continuously measures the distance between the trash bin and any nearby object.

When a hand or an object is detected at a distance of less than 3 cm, the Arduino UNO sends a command to the SG90 servomotor to rotate to 90°, automatically opening the lid of the trash bin. The lid remains open for 3 seconds to allow the user to dispose of waste.

If no object is detected within the specified distance, the servomotor returns to 0°, keeping the lid closed. The process is repeated continuously, allowing the trash bin to operate automatically without physical contact.

This program provides a simple and hygienic solution for automatic waste disposal by combining distance detection and servo motor control.

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

Pictures of the articles

Robotic site created by Mohamed Ali Haj Salah - Teacher info