Have you ever wondered how does an IoT-enabled smart bin works? If not then this blog post will show you exactly how to build one for yourself and you can use it too.
These days, there is a huge impetus on smart city initiatives across the world. One of the popular use cases of Smart City is the concept of Smart Bin. As we all know, efficient waste management is a growing challenge in urban areas. Hence, this Smart Bin concept has also drawn a lot of attention as part of automating the public infrastructure across cities.
A smart bin is a regular trash can, equipped with a sensor. Thus, such sensored trash cans can measure the level of trash contained in them and report that to the users.
How is this concept of smart bin useful to us? If you think of waste management and the level of coordination required for efficiently managing a public waste management system, then a smart bin can lead to.
And finally, it will lead to a cost reduction/per bin for the waste collection agency.
In this post, we are going to show you a model setup of a sensored trash can system that is built atop the IBM Bluemix services. IBM Blumix cloud provides the middleware tools that can power IoT devices and applications. For this setup, we are going to use the IBM IoT Foundation services.
The setup presented in this blog post is a prototype system. If you are looking for a real product or technology around smart trash can or a smart waste bin then refer to our partner’s products page on smart cities.
As per the above block diagram, the main components of this system are
The hardware device that needs to be fitted inside the trash can consists of the following
Raspberry Pi 3 is the popular single board computer, which has many GPIO pins to connect sensors peripheral devices. It has in-built WiFi via which we can connect to the Internet.
To sense the trash level within the trash can, we have used an ultrasonic sensor. You can get more info about the ultrasonic sensor(HC-SR04) here
The below schematic diagram shows how to connect the raspberry pi and the ultrasonic sensor.
To demonstrate this smart bin concept, we will be taking help of the following web services from IBM Bluemix and Twilio. Follow the links below to create your account and setup these services.
The software source code for this model trash can is available on GitHub.
There are two components of the software
Refer the README file for step by step instruction on setting up the IBM IOT Foundation (IBMIoTF) service to handle data forwarding between the trash can and mobile app. IBMIoTF uses the industry-standard MQTT protocol to connect devices and applications. MQTT is designed for the efficient exchange of data to-and-from devices in real-time.
To ensure that the client application at Raspberry Pi 3 and the TrashCanApp mobile app can sync up with the IBMIoTF service, we have to make some changes in the code before launching/building the programs. Refer the “Python Script Configuration” and “Mobile App Configuration” sections of the README file.
If you have followed along until this stage, then we are ready to demonstrate this trash can.
Although we can test the level of trash can using any obstacle placed at a distance from the ultrasonic sensor, we want to get close to real. So here is a small model trash can made out of an ordinary container.
You can see the sensor mounted at the center with its two probes sticking out. Here is a look from the inside.
All services running and all things powered up. Let’s see a demo.
As you can see in the video demonstration, we are using crumpled paper as trash. As we keep filling the container with the trash, the level goes up, and it is indicated in the mobile app as well.
At the bottom part of the video, you can see the sensor values getting updated in the IBMIoTF service web console. As we keep filling trash, the value decreases, which indicates the distance between sensor-probe and the trash level. Check out the source code of Python client application to see how the Raspberry Pi3 controls the sensor to get this distance reading.
We hope you enjoyed this demonstration. In the coming weeks, we will present few more variants of this demo which addresses some real-world problems and solution that can be specifically applicable to this use case or IoT in general. Stay tuned and feel free to comment in case you have any queries.
Shyam is the Creator-in-Chief at RadioStudio. He is a technology buff and is passionate about bringing forth emerging technologies to showcase their true potential to the world. Shyam guides the team at RadioStudio, a bunch of technoholiks, to imagine, conceptualize and build ideas around emerging trends in information and communication technologies.
How To Leverage Machine Learning in Retail Stores for Automated Stock Replenishment
Worrying About Rising Energy Bills? Realtime IoT Energy Management Is At Your Disposal
Model IoT Application For Tracking Kitchen Inventory
Microservice in action : Build a weather enabled chat
Build a real-time recommendation engine with IBM Bluemix and PubNub – Part 2