As we are living in a pandemic, developing products with a touchless function will undoubtedly assist to limit contact.
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.
RTL8722DM/RTL8722DM_MINI
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.
Ameba Official Website: https://www.amebaiot.com/en/
Ameba Facebook Group: https://www.facebook.com/groups/amebaioten
Ameba Forum: https://forum.amebaiot.com/
Setup
Firstly connect up the Servo Motor, Ultrasonic sensor with the AmebaD board.
Source Code
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);
}
}
}
Final Result
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.