Close
0%
0%

Touchless Automatic Dustbin

Using a servo motor, a ultrasonic sensor and RTL8722DM_MINI to build a touchless automatic dustbin

Public Chat
Similar projects worth following
145 views
0 followers
As we are living in a pandemic, developing products with a touchless function will undoubtedly assist to limit contact, as people are concerned about viruses and germs spreading through things we touch on a daily basis.

Ameba RTL8722DM is a low-power dual-band WLAN and Bluetooth Low Energy SoC by Realtek. The RTL8722DM also include memory for Wi-Fi protocol functions and application making it simple for anyone to develop various kind of IoT applications. At the same time it has a wide range of peripheral interfaces. With all these interfaces, it can connect to most of the electronics components like LEDs, temperature and humidity sensors, and so on.

More Resources:

If you need additional technical documents or the source code for this project. Please visit the official websites and join the Facebook group and forum.

  • 1 × RTL8722DM / RTL8722DM_MINI
  • 1 × Servo motor sensor
  • 1 × Ultrasonic sensor sensor

  • 1
    Setup

    Firstly connect up the Servo Motor, Ultrasonic sensor with the AmebaD board.

  • 2
    Programming
    #include <AmebaServo.h>
    
    AmebaServo myservo;
    const int trigger_pin = 12;
    const int echo_pin = 13;
    const int inter_time = 100;
    int time = 0;
    
    void setup() 
    {
      Serial.begin(115200);
      myservo.attach(8,500,2400);
      pinMode(trigger_pin, OUTPUT);
      pinMode(echo_pin,INPUT);
      delay(3000);
    }
    
    void loop() 
    {
      float duration,distance;
      digitalWrite(trigger_pin,HIGH);
      delayMicroseconds(1000);
      digitalWrite(trigger_pin, LOW);
      duration = pulseIn(echo_pin,HIGH);
      distance = (duration/58);
      Serial.print(distance);
      Serial.println(" cm");
      time = time + inter_time;
      delay(inter_time);
      if(distance < 10)
      {
        for(int i = 1500; i>= 1100; i-=25)
        {
          myservo.writeMicroseconds(i);
          Serial.println("2");
          delay(1000);
        }
        delay(1000);
        for(int i=1100; i<=1500; i+=25)
        {
          myservo.writeMicroseconds(i);
          Serial.println("1");
          delay(1000);
        }
        }
      }

     The source code could found in my github: https://github.com/daphwl/Touchless-Automatic-Mini-Dustbin

  • 3
    Final Results

    When you place your hand near the ultrasonic sensor, the dustbin will open and when your hand is away from it, the dustbin would close.

View all 3 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates