Here is my first "real" Arduino project, hope it can help someone else.
Problem:
We have two garbage vacuum containers (http://www.envacuk.co.uk/products-and-services/our_products/movac-mobile-vacuum-systems) in our basement for our ~80 apartment housing association. See Containers.jpg showing the two containers in our basement.
They are emptied from the street with a vacuum truck which is great, however the containers have a tendency to clog up in the inlet tube due to the garbage bags in the container building up as a pyramid and eventually stopping the entrance. Usually there is still much more volume in the container when this happens, and people just put the garbage on the side resulting in garbage mountain (attracting rats etc). The big problem is that the company emptying the containers does not care about the garbage on the street (of course… their job is only to empty the container in the basement). Sometimes they can not access the outlet due to some car is parked in the wrong place, then however they usually just leave the place without noticing anyone which results in the container clogging up one or two days after.
Now someone has to inform our janitor to urgently come (who normally spend only one day/week at our house). The janitor then has to make sure the containers are first emptied then fill them up with the garbage left on the street which takes allot of time, i.e., money (and risk the creation of a new pyramid).
A better way would be to foresee the blockage and just do something about the pyramid before the inlet is jammed…
Attempted solution:
I have now installed an ultrasonic range finder (HCSR04) to look down the tube and measure the distance down to the pile of garbage. The distance is then uploaded every 15 seccond to Xively via the Ethernet shield (ENC28J60 and yes we happened to have a network in the basement that I could tap into). Will post code as soon as I have had time to tidy it up a bit.
SensorAndCurve.jpg Shows the ultrasonic range finder (HCSR04) mounted with melt-glue looking down into the container inlet tube together with a "typical curve" of distance to the garbage pile.
The system actually shows a weekly trend and I have already been able to notice when the garbage truck hasn't emptied the containers on time.
Now I'm working in a cron-job to send an automated message to the people responsible for emptying if something is looking fishy... (stay tuned for more and code)
The problems solved along the way:
- Figureing out how to get the cheap ethernet shield ENC28J60 to work was a bit of a struggle. Eventually I fond these drivers that did the trick: UIPEthernet.h version 1.50, Read the text at GitHub - ntruchsess/arduino_uip: UIPEthernet: A plugin-replacement of the stock Arduino Ethernet library for ENC28J60 shields and breakout boards. Full support for persistent (streaming) TCP-connections and UDP (Client and Server each), ARP, ICMP, DHCP and DNS. Build around Adam Dunkels uIP Stack. Further developed version can be found on https://github.com/UIPEthernet/UIPEthernet
- First the Arduino stopped sending data to Xively af ter only a few hours. The MAC address was not unique on the network (which just happened to be internet) now it is behind a firewall with DHCP.
- For some unresolved reason the Arduino stopped sending data to Xively after a few days. It worked again after reboot so I have teporarilly put a timer on the Arduino power supply to force a reboot twice a day.