Sunday, November 10, 2013

Tumble Dryer Remote Display - Part IV

Welcome to the final part of the the mini series of postings on my Raspberry Pi project, the tumble dryer remote display. So far there has been the introduction, a posting on the concept and building of the hardware interface, and one part on the software I am using to make the remote display work. So, what is left? Well, as the whole thing can be called a "working prototype" there is plenty of room for change and improvement.

tumble dryer core status LEDsAmongst the possible improvements is the plan to make the HTML output look a little bit more like an actual display. As the program only inserts a given text into the HTML data, depending on the dryer's LEDs' status, it is easy to put the link to an image there instead. While I have no idea yet as for how to display the possible errors, I will prepare five images, based on the one that can bee seen on the right. Instead of the dark bars there will be red ones, depending on the status that has been detected. The code will be changed to insert the link to the appropriate picture. Text will only be used to cover the cases where there is no appropriate image available. I have no idea about the temperature section yet.

Another change I am currently thinking about (and I hesitate to call it a possible improvement, with reason) is to turn the passive, on-request remote display into a more active one. While adding a cell phone to the setup and make the Raspberry Pi send an SMS sure would work, making the remote display "tweet" might turn out to be the feature more likely to be implemented. I came across Python Twitter which could fit in well. As I am using Twitter clients that support notifications, sending a direct message to my Twitter account would be almost like sending an SMS to my cell phone. Amongst other things that would need to be changed, I would have to check if the status has changed since the last run: receiving a DM once per minute would not be exactly helpful, not to mention Twitter API limits. And a direct message sent only once after a status change has been detected could easily be overlooked. After all, this would be more just for the fun of it than anything else, mostly depending on the amount of time that would be needed to add the Python Twitter features. A tweeting tumble dryer - think about it.

Something that could turn out to become an actual improvement would be turning the cron job-triggered program into some kind of "self-contained" demon. While the current solution is a more passive one, as it simply produces/updates a HTML file once per minute, a future version could bring its own web server (using Python's http.server module) and a more "interactive" version of the core script which would only update the data if the page is (re-)loaded. The demon itself would check if the required hardware is available: if so, it would stay in the running state and answer requests, and if not, it would simply die. At the moment this is just a fuzzy idea, but who knows.

A change to the current setup that is almost certain to happen is that I am going to add a DHT22/AM2302 digital temperature and humidity sensor. The DS18S20 available at the moment can only be used to tell the temperature in/around the case of the prototype mounted on the tumble dryer's control panel. Adding a sensor that could be placed somewhere away from the dryer itself would make more sense, or at least it could help judging if the bathroom's window should be opened or closed. As the AM2302 cannot be connected to the 1-Wire bus available, adding this component could be fun. Famous last words, I know. The software needs a little bit of attention of course as there will be one device (with two additional sensor values) that needs to be taken care of. No problems, only solutions.

That pretty much sums it up, at least for the moment of writing this posting.

I hope you enjoyed reading about my tumble dryer remote display. If you have questions or comments, both are welcome! And maybe the small series of postings sparked your imagination what can be done with a Raspberry Pi, a handful of electronic components and a few lines of code. If so, go and create! I would love to hear about your projects!