Introduction

Keeping track of the recycling schedule apparently is hard.  I must have missed the card-board pick-up so many times in a row, we could have easily build a sizable carboard-fortress. As I am obviously not entirely up to the task, I needed a little helper to save the planet - meet BinPal.

I started by researching the web for bin reminders and stumbled upon a Google calendar reminder project by Andreas Spieß.  (https://m.youtube.com/watch?v=sm1-l5-z3ag)

Although I liked the way he used Google calendar to keep track of the pick-up times, I thought it was lacking in a few ways which I could improve upon.

What I ended up with is an extremely simple design that just comprises of 4 components:

All component are either recycled (battery from dead camera), outdated (discontinued HX1230 display) or surplus from other project. So I rather give tham a new life than throwing them out eventually.

As I am using the backlight of the LCD for notification there are no extra components needed. 

The case is built from a few piece of laser-cut plywood but it could be built from mostly any material - only one cut-out for the display is needed. The capacitive touch buttons work reliably through a few millimetres of anything (apart from metal). 

So how does it work?

The basic operation of BinPal is to connect to Google App Script every morning to check if there is a new task to be done and show it on the display. If there is a new task one of the 4 corresponding icon is highlighted (bio, paper, plastics, trash). 

The user has the ability to select any icon (banana button) and delete the active reminder (bin button). If the reminder has not been deleted by 8pm, the backlight of the display starts to blink to draw even more attention to the open task.

Although this sounds rather simple, It required some trickery to pull off.

Get the tasks from Google:

Ideally one would like to pull the calendar directly from Google calendar but this proves to be rather difficult with ESP32. Instead we use a short Google App script that checks the Calendar for new recycling duties and provides the information via a REST API. This work-around also has the advantage that we can synchronize the time simultaneously without using an additional NTP service.

Sleeping beauty:

To be able to run a few weeks on battery at a time, the ESP32 needs to sleep as much as possible. However, the maximum sleep duration of the ESP32 is just over an hour so we need to make sure that if we wake up, we go right back to sleep again until it is time to fetch the calendar again. Additionally, the user might wake up the device in order to delete a notification or to check the battery monitor. All this combined makes it rather difficult to keep accurate time throughout the day. The solution for me was to heavily utilize the ULP processor of the ESP32 for time keeping as it can perform simple operations while the ESP32 is asleep. I use the ULP for blinking the LCD backlight and counting the seconds during sleep. 

Although the ULP is supposed to run at 8MHz, the corresponding oscillator appears to be not that accurate. I therefore chose to calibrate the delay-loop within my ULP code at start-up to get a rather accurate one second count.

Battery monitoring:

To check the charging state of the battery and how much power we are using over time I added a simple battery monitoring screen that can be accessed by pressing both buttons at once. It adds one data point every 24 hours whereas the sketch randomizes all data on boot. So the picture shows about 14 pixels = 2 weeks of battery data.