My tweeting washer and dryer have been running great for a bit now and I’ve done some code cleanup to make it less embarrassing to share. The code attached to the post is designed to use an Arduino Ethernet shield, not the WiFly module from the original example. If you already changed your tweeting dryer to use an Ethernet shield you can probably just download this code and upload it with little-to-no modification.
Download the Arduino code, circuit diagram and PHP files from my Git repo: WasherDryerMessenger
I’ve added a number of things to my code which weren’t in the original. I have, however, put them behind configs so I believe you should be able to use the code without hardware changes.
Here are two relevant configs at the top of the code:
- #define WASHER 0: In the sample code I have tweeting for the washing machine turned off. If you add another current sensor to your hardware you can turn this on to get tweets from your washer too.
- #define WEBMSG 0: This setting enables pulling the pithy tweets from a database on the web. Before enabling this there is some setup required, see: Getting a random string from MySQL for Arduino
If you want to have a tweeting washer as well as dryer, the hardware change you’ll need to make is to duplicate the current sensing circuit already in place for the dryer and add a third LED. In the diagram below left I have recreated the original circuit from Thomas’s Dryer Messenger in breadboard format (click for full size). On the right I show the added washer circuit (note: Ethernet shield not shown for simplicity).
When you finish the modified circuit you can test it by plugging the dryer into the new transformer jack and updating the dryer pin setting in the code. Only after you’ve tested the hardware should you plug in both appliances and turn on the washer tweeting using the WASHER define (see the configuration notes earlier in this post). If you want the same account to tweet both washer and dryer status you can duplicate your dryer OAuth token for the washer on line 103. I elected to have separate handles for my washer and dryer and obtained a second OAuth token from Arduino-tweet.appspot.com.
At this point you should have a tweeting washer and dryer but you’ll notice the tweets are the same every time and rather boring. To add variety back to your tweets you should follow my instructions for enabling the WEBMSG for getting random tweets from a database on the web: Getting a random string from MySQL for Arduino.
Have you added a washer to your setup? Share your washer’s twitter handle in the comments below.
4 replies on “Tweeting washer and dryer for Arduino with Ethernet”
[…] Note: for details and code see my earlier post: Tweeting washer and dryer for Arduino with Ethernet. […]
[…] Note: for details and code see my earlier post: Tweeting washer and dryer for Arduino with Ethernet. […]
Hi there,
I have been using this for a while now, and it works great, but I find I really don’t use Twitter at all so I don’t get the notifications as effectively as I would like. I use Home Assistant and Mosquito MQTT broker, so I have the idea to re-write this a bit so that it updates an MQTT topic, which I would get immediately as a push notification on my phone VIA Zanzito.
Ok, so here’s my potentially dumb question: what does the double less than symbols in the “Serial << F(" statement mean? I understand that they are using flash memory with the F but I cannot for the life of me find anything regarding the <<.
Any simple tips on how to replace Twitter with MQTT? My current plan is just to jump in and break it several hundred times until I stumble into a solution.
Figured it out, so far. I’ve gotten the code to work except for the MQTT, which I think I can attribute to bad formatting on my end.
I also learned that the << is a left shift.