The intent of this guide is to be clear and provide comprehensive instruction to help you build and setup your waste watcher. If you would like to suggest any improvements feel free to submit an issue or refer to the Contributing Guide.
- PLA Filament
- ESP32-CAM
- HC-SR04
- Solid Core Wire
- Waste Watcher PCB
- 6 of 12mm M3 Screws
- 6 M3 nuts
- 1 of the 2 Pin Screw Terminal
- 2 of the 1 x 8 Female header pins
- Spare USB cable
- Heat Shrink
- 3D printer (or 3D Printing Service)
- Soldering Iron
- Helpings Hands for Soldering
- Wire Stripper
- Computer
- FTDI Adapter and 4 Female to Female Adapter
- Jumper Cap
If you don't have a 3D printer, you can search up some local 3D printing services in your favorite search browser.
-
Before starting make sure that your bin is compatible with the case. If not, you may need to modify or create different handles. (please share them if you do! 🙂)
-
Refer to the settings below and print the following:
- 2 of the
sensor_mod_handle.stl
- 1 of the
sensor_mod_bottom_assembly.stl
- 1 of the
sensor_mod_top_assembly.stl
- 2 of the
Setting | Value |
---|---|
Layer height (mm) | 0.1 |
Shell thickness (mm) | 0.8 |
Bottom/Top thickness (mm) | 1.5 |
Fill Density (%) | 30 |
Print speed (mm/s) | 50 |
Support type | Everywhere |
Platform adhesion type | None |
You can purchase the PCB from OshPark using this link. Or if you prefer, you can refer to the schematic/KiCad files in the pcb
folder and create your circuit on a prototyping board.
- Let's recycle! ♻ Take your spare USB cable, cut the end, and expose the V+ (usually red) and GND (usually black)
- Solder the components onto the PCB
- 2 Pin Screw Terminal
- 2 of the 1 x 8 Female header pins
- Solder some wires onto the HC-SR04
- Heat shrink to insulate
- Solder the other ends of the wires into the PCB (use the labels to figure out which wire goes where)
- Your circuit is good to go 👍
-
Create an Adafruit IO account
-
Create your feeds for
-
Create a Dashboard for your feeds. Here's an example that I made.
Before getting started, make sure you satisfy these prerequisites below:
- Visual Studio Code
- Platform IO Extension Installed
- Repo Code Downloaded:
- (Option 1) Download repo as zip and extract the contents
- (Option 2)
git clone https://github.com/zotbins/Waste_Watcher_Adafruit_IO.git
- Open the subfolder
waste_watcher_adafruitIO
in Visual Studio Code - Create the file
config.h
in thesrc
folder - Copy the contents of
template-config
into yourconfig.h
file - Change the config settings for the following
ssid
- your wifi namepassword
- this is your wifi passwordmqttClientID
- just a unique id. You can generate one with https://guidgenerator.com/mqttUsername
- this is your AdafruitIO usernamemqttPassword
- this your AdafruitIO key in the form of<username>/feeds/<MQTT by Key>
. The key! Not your account password.mqttFullnessTopic
- the MQTT topic for the fullness feed you createdmqttImageTopic
- the MQTT topic for the image feed you created
- Measure the height of your bin and change
binHeight
value to reflect the height of your particular bin. That way the sensor module can calculate how full your bin is. - Change the other config settings as you see fit
- Put a jumper cap on the ESP32-CAM
IO0
andGND
- Plug in your FTDI Adapter to the ESP32-CAM as shown
- Plug in the FTDI Adapter into your computer
- Click on the PlatformIO icon on the left side panel, then click Upload and Monitor. Wait for this to finish.
- While leaving the ESP32-CAM plugged into the computer, Unplug the Jumper Cap and hit the reset button
- Wait for data to be sent in Adafruit IO
- Fullness data should be sent as
-1
(because there is no HC-SR04 connected yet) - Image should be sent
- Fullness data should be sent as
For troubleshooting the ESP32-CAM checkout this guide: ESP32-CAM Troubleshooting Guide
- Plug your ESP32-CAM into your PCB
- Screw in the USB power wires as shown (do not mix up power and ground!)
- Put the HC-SR04 in and then the ESP32CAM in.
- Screw on the lid with the USB cable coming out of the rectangular hole on top
Here are some actionable ideas from the README file:
Besides just collecting data, here are some ideas that you can implement. Again the goal of this project is to help quantify and promote actionable solutions to reduce waste.
- 🎯 Create a goal to reduce the rate at which you fill up a bin
- 💻 Use the Adafruit IO Integrations (Zapier, IFTTT)
- Send a summary of weekly fullness rate
- Send alerts when bin is full
- 🤖 Use machine learning to identify what items are thrown always
- identify frequently thrown away items then try to reduce that waste (eg. plastic straws are identified frequently in the waste stream, so we can ban the straw or give sustainable alternatives)
- identify which waste items are incorrectly thrown away
- Getting Started with VS Code and PlatformIO IDE for ESP32 and ESP8266 (Windows, Mac OS X, Linux Ubuntu) - A guide to install Visual Studio Code and the PlatformIO Extension by Random Nerd Tutorials
- ESP32-CAM Video Streaming and Face Recognition with Arduino IDE - Great introduction to the ESP32-CAM by Random Nerd Tutorials
- ESP32-CAM Troubleshooting Guide - common problems fixed for the ESP32-CAM by Random Nerd Tutorials