Behold the BinDayCator!

By Darren Tarbard. Posted

A rainbow of wheelie bins is a common sight on our streets now. Recycling continues to grow in importance, with councils issuing multiple colour-coded bins for us to separate our refuse. Councils can’t collect every bin every week, and so they are collected on a rota, one or two each week.
Like most people, I used the usual ‘algorithm’ of just seeing what the neighbours put out. It works, but there have been times where a couple of people put out the wrong bins, and the rest of the street followed.

Crowdsourcing data is great, but it isn’t always accurate, and in the dark of winter, it’s hard to make out colours. You might even totally forget, and end up chasing the bin lorry in your pyjamas at 7 am.

The correct thing to do, of course, is to visit the council website to find out what bin is due, providing you remember to, but I’d been toying with the idea of making something to remind me for a while. Just before Christmas, I forgot to put out the cardboard and paper bin and, as more cardboard accrued, it sat in a corner, taunting me over the holiday period.

The obvious choice would be a program which sent me an email or notification on my phone, but it’s easy to miss yet another notification in the constant flow, and I had a more novel idea. The idea of a bin-shaped lamp intrigued me; it would check the council’s data and change to the colour of the due bin, pulsing on the correct day. In a world where information, alerts, and indicators have been absorbed into all-conquering touchscreens, I thought it would be a pleasant change.

When I have a new idea, I first try to prove the concept is sound. I start with the least-known or most difficult feature first and try the simplest prototype. Using this approach, you can find out quickly whether something is feasible or not rather than spending a lot of time on up-front design only to discover it won’t work later on. I often make things out of cardboard or other scrap so that I can quickly try ideas.

For this project, the aspect I needed to explore was how good it would actually look. In my head, I had an image of a bin glowing a nice evenly-lit colour, but would this translate to reality, or would it just look like a few LEDs inside a box? Luckily for me, there was already a bin model on Thingiverse – it wasn’t the right size or appearance for what I wanted, but good enough to test with. I printed it using white PLA, which was perfect for diffusing while still allowing a lot of light to transmit through. I soldered up a strand of NeoPixels and breadboarded it up to an Arduino to try out. Success, of sorts – the PLA produced just the right kind of glow, but to produce multiple colours, I would require more than just a hollow bin shape.

I used Blender to start constructing my own wheelie bin from scratch; now I could tailor it to exactly the right dimensions, include a port for the USB connector, and include a light baffle structure to help shape the lighting. Iteration was the name of the game now, printing multiple versions until I was happy with how the electronics would fit inside, and perfecting the lighting and finish.

Designing our notifier

Printing a single bin in its entirety at good quality took seven hours, which is a long time to wait to get feedback. So, one technique I used was to only print part of the bin, depending on which aspect I was changing. For example, I might just print the bottom quarter because it’s enough to check for electronics fit. Like everyone who does 3D printing, I had my fair share of print failures, but I tried to make use of failed prints too by patching them up and using them to test while the next version printed.

If only we knew when to take these bins out

Since this project would need WiFi connectivity, I switched from an Uno to an ESP8266-based Wemos D1 Mini. These boards are small, powerful, include WiFi, and are relatively cheap. Their main downside is a limited amount of GPIO, but for this project, I only needed one pin. A bonus feature of having WiFi is you can reprogram them over the network using the Arduino OTA library – handy when your prototype lives in the kitchen next to the bins, and far away from your PC.

I’d posted pictures of my device on social media, and it had really struck a chord – being shared widely, prompting much discussion on the subject. People really liked the idea and the issue resonated with them on some level, even if it was just the novelty factor. A government department and media outlets were interested too, and wanted demonstration units, so now my focus was on producing a more high-quality finish and a web interface for demonstrating. Layer lines can be an interesting texture, but I wanted a smooth finish because when it glows, you can see every line. Every other imperfection stood out clearly, too. You can say goodbye to that seven-hour print because of a single cat hair sandwiched between layers during printing. Support structures also left imperfections on the print.

A prototype in progress

So, I spent a while trying a range of supports, from standard Cura supports to the organic-looking, tree-like supports that Meshmixer could produce. I tried vapour smoothing to remove layer lines, a technique normally used with ABS, but not so much with PLA. ABS can be smoothed using commonly available acetone, but PLA doesn’t react to it, and so I went through a number of increasingly uncommon (and unpleasant) chemicals. The best solvent I found was called dichloromethane – it was difficult to work with and hard to store since it has a tendency to slowly leak through or melt most bottles. I still wasn’t happy with the result and gave up on vapour smoothing entirely for this project. My experiments weren’t a waste of time because I learned a lot, including that this particular solvent was useful for gluing parts together by melting them slightly – a technique called ‘solvent welding’.

I settled on old-fashioned wet sanding to be the best approach. Nobody likes sanding, but it worked well here, using increasingly fine grits to polish it and then coating the surface with matt varnish.

Sanding the indicator smooth

The council publishes which bins are due for collection on its website, but the page was designed for people, not software, to read. If you view source on most webpages, you will see it is a sea of hard-to-read HTML –writing code to deal with this is challenging. Luckily this problem has already been solved using a technique called ‘screen scraping’ which allows a computer to read information usually designed for humans to read. Using a screen-scraping library will filter out unneeded data and let you extract just the bit you want.

Despite the ESP8266 being a fairly fast microcontroller, it would still struggle under the pressure of downloading and parsing large webpages. I already had a Node-RED server running all the time, so it made sense for me to use that because a faster CPU would make development smoother. If I’d wanted to do it all on the same device then a Raspberry Pi Zero could have controlled the NeoPixels and done the screen scraping on one device, but it would make my enclosure larger, and it would be harder to hide the electronics.

Node-RED is a programming tool for wiring together hardware and services – it has a nice graphical interface that lets you drag and drop nodes. Nodes are building blocks with certain functionality, and you create logic by connecting them. I checked through the node types it had, and I was in luck – it had two nodes with the features I wanted. One node, the HTTP Request node, could retrieve the webpage, and the HTML node would do the screen scraping based on a selector I gave it. I configured it with the council’s webpage URL and started looking for the correct selector. Selectors use CSS (Cascading Style Sheets) syntax to specify which part of the page to extract. Modern browsers make this easy to find with their developer tools – you can click on a part of a webpage, and it will tell you what the selector is for on that area of the page. Armed with this selector, I plugged it into the HTML node, attached a debug node so I could see the result, and deployed the flow. This worked great, and it delivered me the contents of that part of the page. The council use a descriptive heading for the bins and not the colours, so I added a JavaScript node which converts the name to a colour.

Node-RED does the heavy lifting of the data collection

I coded the BinDayCator device to connect to Node-RED using the HttpClient library, which would read the previously stored colours and return them to the device. A JSON library is then used to process this string back into an array and set the NeoPixels to the appropriate colours. Having a constant ambient indicator had advantages I hadn’t expected; it helped me to plan ahead. For example, if it was garden waste that week, I could prioritise gardening since I knew it was due to be collected.

My post was shared widely, and people asked if they could buy one. I’d only made it for myself, but it seemed unappreciative to ignore people’s interest. The cost of setting up manufacturing was significant as I would need to have moulds made for production runs, and I also needed a critical mass to make the server-side code worth creating. I would need to create a BinDayCator server on the internet that could process councils’ webpages, all of which had different formats. I launched a Kickstarter as soon as I could to prove the demand for this product. If I had enough customers, it could work. Unfortunately, the Kickstarter failed to meet its goal, but I did learn an awful lot. I’d never created a Kickstarter before, and that was almost an entire project in itself. Councils and companies were interested in providing BinDayCators for their users, but none have yet wanted a big enough rollout for the critical mass needed for manufacturing. Big organisations have a lot of inertia because they have a lot of factors to consider, something makers are not encumbered with. We can just imagine it, make it, and use it.

From HackSpace magazine store

Subscribe

Subscribe to our newsletter