Smart dustbin projects for kids


This project deals with a very common problem faced by our society daily. The problem with opening the dustbins, with the help of these Automatic Dustbins you don’t have to touch the dustbins you just have to go near the dustbins the dustbins will get open by themselves after sensing you near them.

In this project we have used a PIR Sensor and a Servo Motor here the sensor senses the person near it and tells the motor to rotate and open the dustbin so that the user can throw the waste in the dustbin without touching it.

Hardware required 

  1. Arduino Uno R3
  2. PIR Sensor
  3. Micro Servo Motor
  4. BreadBoard
  5. Jumper Wires

Schematic Diagram

Fig 1.  Circuit Diagram

Arduino Code :

#include <Servo.h>
Servo myservo;                                       // create servo object to control a servo
int pos = 0;                                                   // variable to store the servo position
int inputPin = 12;                                   // choose the input pin (for PIR sensor)
int pirState = LOW;                           // we start, assuming no motion detected
int val = 0;                                                    // variable for reading the pin status
void setup() {
  myservo.attach(4);          // attaches the servo on pin 4 to the servo object
  pinMode(inputPin, INPUT);  

void loop() {
  val = digitalRead(inputPin);                                                  // read input value
  if (val == HIGH) {                                                      // check if the input is HIGH
    if (pirState == LOW) {
      myservo.write(0);                    // tell servo to go to position in variable '0'
      delay(1500);              // waits 1500ms for the servo to reach the position
      pirState = HIGH;
else {
    if (pirState == HIGH){
        myservo.write(180);         // tell servo to go to position in variable '180'
        pirState = LOW;


  1. Connections should be done properly.
  2. Arduino is case Sensitive so code accordingly.
  3. Give different colors to the wires.

Do you have questions regarding our STEM program?

Contact us anytime.

Take your first step into the magical world of coding for kids


More Posts

Send Us A Message

Coding For kids

Our courses which are tailored for grades 1 to 12, and our hands-on curriculum seamlessly integrates, preparing students for challenges and inspiring the next generation.


If you are a school searching for a cutting-edge makerspace solution that goes beyond conventional education, look no further. Partner with Makers’ Muse to unlock a world of innovation and transformative learning experiences for your students. 

Coding Toys

Discover a revolutionary coding journey for students with our cutting-edge educational toys. Partner with us to unlock innovative learning experiences that transcend traditional education.

Leave a Reply