Trash Sensor
The Trash Sensor project is a connected system that simplifies garbage collection by retro-fitting trash cans with a modular sensor array to alert facilities staff when cans are full.
I worked in tandem with another mechanical engineer to design and fabricate a custom PCB, write firmware, and create housings for the hub and modules.
April 2018
Key Features
PCB Design
The PCB for the Trash Sensor was designed from the ground up using Altium. The board is centered around the SAMW25 MCU, which contains SAMD21G18A microcontroller and ATWINC1500 WiFi module. The board also has 8 MB of external flash memory, a battery management and charging IC, boost and buck converters, and USB to UART IC.
After designing the schematic and laying out the board, we worked with PCB:NG to manufacture 6 of our trash sensor PCBs.
Modular Hub + Sensor System
Because trash cans differ in size and application, we created a modular system architecture to accommodate the different sensing environments of our users. The main hub contains the intelligence and power for the system, while the module ports enable a variety of sensor modules to interface in a plug and play fashion.
We primarily focused on the proximity sensor module, which utilizes an IR proximity sensor to detect how far away the trash is from the lid of the trash can. Moving forward, we envision other modules such as load cells and break-beams to expand the use cases for the trash sensor as well as increase the accuracy of trash detection.
Cloud Connection
The true value of this system is the online dashboard where users can see trash levels in real-time and where they are located on campus. We used IBM Cloud with Node-RED for the front and back end of the dashboard. Because of the low volume of data being passed between our device and the online dashboard, we used MQTT protocol brokered by Cloud MQTT.
We also used Twilio's API to automatically alert the appropriate facilities staff with a text message whenever a trash can is completely full.
Firmware
The firmware for this project was developed in C using Atmel Studio's ASF modules. In addition to the application code for the sensor system, we also created a bootloader to handle over the air firmware updates (OTAFU). Our device routinely checks a server for new firmware images and automatically updates when a new version is available.
Additionally, we created a CLI to help us with testing and debugging throughout the development of the device.
Sensor Demo and Calibration
IR sensors do not scale linearly, so we ran a series of tests to create a best fit curve to accurately convert the ADC readings into distance measurements. Additionally, when the trash level is polled, we perform 10 readings twice a second to reduce false-positives and outliers (such as trash entering the bin as a reading is taking place). The readings are then bubble sorted, high and low outliers are thrown out, and the remaining readings are averaged before being pushed to the cloud via MQTT.
© Julian Mickelson 2021