Close

Design Introduction

A project log for Bin Monitored

Has your bin been blown over in the wind? Did the delivery person leave a parcel in it? These and more questions answered with Bin Monitored

stephen-harrisonStephen Harrison 09/13/2018 at 02:190 Comments

There are plenty of bin monitor projects around, however none of them really matched my requirements, so I decided to make my own, this log hopefully gives an insight to my thinking.

Schematic:

Distance sensor:

Most bin monitoring projects I've seen use ultrasonic sensors to sense how full the bin is. I don't really like these because my bin gets washed once a month and those sensors need an opening for the sound waves to travel through which will result in water ingress to the sensor and the whole system. 

I decided to use the VL53L1 Time of Flight sensor, that uses an Infra Red laser to sense up-to 4 meters in distance, this can be placed behind something (IR) transparent which would allow the system to be sealed (although at this time I've not tested this, however I plan to use something like acrylic as the enclosure cover so it should be OK and I'm not bothered by accuracy, just an approximate relative change).

The down side is my general rubbish (black) wheelie bin has the rubbish in black bags in it, these may not reflect IR well enough for the sensor. However I'm mainly interested in monitoring my recycling (blue) wheelie bin which contains loose recycling (cardboard, bottles, cans, tubs etc.), and I'm sure I could switch to different bags for the general rubbish.

Lid Lift Sensor:

My blue bin is used for recycling so it's generally clean on the inside, this makes it a good place for delivery people to leave parcels, not all do, but if I'm expecting a parcel and I've gone out I leave a note to get the delivery left in my blue bin rather than disturbing my neighbours, or missing the delivery and this works well for me.

Whilst I'm not too bothered about knowing when the parcel arrives, it would be very easy for the delivery person to leave a parcel in one of my bins and forget to put a note through the door to tell me, this could easily result in my parcel getting put out for rubbish collection by mistake. With the lid lift sensor I can get a notification if the lid has been lifted which hopefully means I've got a parcel waiting for me!

Alternatively it may also mean that my neighbour is using my bin for their rubbish, given we have limited space in our bins this could be very frustrating so this also would prove useful.

I chose a MMA8452Q accelerometer, purely because I've used one before and had a few breakout boards for it, it's got a good range (0-2 to 0-8G) acceleration sensing and a couple of interrupts so it can be used to sense a change in acceleration without the micro controller having to run constantly, which is great for a low power solution. (Side note: I sent the PCB design to OSH Park off before ordering these, and it turns out none of the usual suppliers (Farnell, Mouser, etc.) expected to have them to be in stock before the square inch contest deadline - Epic Fail!, fortunately I managed to pick up some from a seller on AliExpress!

Normally the lid being closed would result in a -1G being registered on the Z axis, when the lid is lifted this acceleration should increase (more +ve) and would then move to the the X or Y axis depending on part orientation, then possibly to +1G on the Z axis as the lid is at 180° and again to the X or Y axis if the lid goes all the way back (i.e. this typically happens when  it is being emptied). By sensing the transition from -1G Z to +VE Z and then X or Y acceleration we can tell if the lid has been opened, it should be possible to set the accelerometer to sense the change in acceleration and then register this in the micro-controller.

Bin Down Sensor:

This uses the same accelerometer as the lid lift sensing, again by sensing acceleration in an axis other than the Z axis it can be determined if the bin has fallen over and may be allowing all the contents to get blown down the road in the wind. Notification from the system would allow me to rescue my bin before the street is a mess (I don't always have a direct view of my bin, so the obvious, look out of the window solution isn't always practical).

Environmental Sensing:

I didn't have a special need to add this, however I figured why not, and I actually pushed out the boat and fitted a BME680 which is a fairly expensive sensor as it also includes volatile organic compound gas sensing, allowing air quality to be assessed, along with temperature, humidity and pressure.

My wheelie bins live outside so having an environmental sensor in the bin that is at the same environmental conditions as the outside effectively gives an outdoor (weather) sensor which is shielded from direct sunlight and rain which makes it rather nice, even if not used in relation to the actual bin!

The down side of this is that the enclosure does require air movement to allow for sensing of humidity, VOCs and pressure. With a sealed system the temperature would still be interesting, and the humidity sensors would be able to warn of moisture ingress that could shorten the life of the system.

I decided to have small holes in the enclosure to allow air movement and to place them so any ingress of water during cleaning couldn't directly get to the PCB (and to conformal coat the PCB to further reduce the risk of damage from moisture). The danger of a sealed system is that once moisture gets in it has no way to get out, so this design would allow the system to breath and not trap moisture in it. Rather than large holes as needed for ultrasonic sensors this system can use discrete holes (2-3mm in diameter) away from the PCB.

The VOC side of things is purely experimental, my green bin is used for composting recycling (food and garden waste), I thought it might be interesting to see if this sensor would pick up any decomposition from the waste. Also for the recycling and general waste, any VOCs (paint, spray cans etc.) may give of vapours that could be picked up by this, this could be useful to warn if something has been placed in the bin that shouldn't go for recycing (i.e. paint).

Power:

A solar panel may have been an obvious choice for this monitor, however it would be required to be mounted on the bin lid with wires going trough to the inside, however I wanted the Bin Monitored system to be entirely self contained with minimal damage done to the bin, and maybe even easily removable. It would be very easy for a solar panel to get broken when the bin is emptied or if something falls onto it. Hence I decided to go with just a rechargeable battery and to try and make that last as long as possible.

Indicators:

The PCB includes 2 LEDs on the top. I planned to have 1 LED to indicate if it's bin day. When the lid is lifted the micro controller could light this LED if the bin should be put out for collection. This may require some backend cleverness to make this work, and as the system doesn't include a proper real time clock it may yet not work as intended. The second indicator is intended as a general status indicator, flashing if the lid is open and the battery needs replacing, or no WiFi or some other issue, or just as feedback when debugging.

Micro-Controller:

I decided to use an ESP-12 ESP8266 for this, mainly because it's a small device that's easy to solder and includes wireless communications, it is easy to use and can be programmed with a FTDI cable and the Arduino IDE. 

Part of the design was to fit this on a PCB 1 square inch (or less) in size for the Hackaday square inch contest so having a small footprint micro was fairly critical. I've used WiFi for connectivity, however this may not be the most ideal solution and something low power like LoRaWan or Sigfox that doesn't also require a hub would probably be a better solution for this, however for the first version WiFi is good enough and with careful limited usage hopefully wont drain the battery excessively.

EEPROM Storage:

Whilst the ESP-12 includes EEPROM emulated storage on the flash chip this is fairly small and flash can be damaged with lots of writes,. I decided to add an external EEPROM to allow a larger data set to be stored with only occasional transmission (i.e. a full day of 1 minute temperature logs, transmitted once per day to keep the WiFi connection overhead down, but still allowing detailed monitoring).

Backend Service:

Initially I plan to connect this to the Tinamous Internet of Things platform to monitor the system and provide email and sms notifications on interesting events, however I may be slightly biased in my selection of Tinamous (see my profile :) )

Other Uses:

Whilst this is intended as a bin monitor, it could find a variety of other usages. For example:

General environmental sensing:

It's a small self contained internet connected device so could be useful as a general environmental sensor (temperature, humidity, pressure), and as it includes VOC gas sensing could be useful for indoor air quality. The EEPROM could be used to store data through out the day allowing high frequency logging but reducing WiFi activity by sending only when needed (or even if the device is outside of WiFi range with occasional recovery to read the data - i.e. an outside building where WiFi doesn't reach)

Movement sensing:

Using the distance sensor, if somebody walks through or in the beam this could be registered as movement (i.e in a hall way, or stair case, or outside to detect visitors walking up a path), and if placed above the height of pets would reduce false triggers, it could then be tied into a home automation system.

Simple distance measure:

Using the TOF distance sensor this could be connected to a mobile phone and used as a small handheld distance measuring device, or some kind of interactive display that triggers when somebody is close to it.

Discussions