In the code for this Arduino based smart dustbin, two sensors are used for object detection. The first sensor is an ultrasonic sensor, and the second sensor is an IR sensor. When our hand or foot comes within the range of the ultrasonic or IR sensor, it will send a signal to the Arduino. The Arduino will then rotate both servos in opposite directions, causing the dustbin lid to open. Additionally, an indicator LED will light up. I have set the ultrasonic sensor's range to 40cm, but you can modify it according to your needs. As soon as our hand moves away from the sensor, after a 2-second delay, the servos will rotate back, and the lid will close.