{"id":2202,"date":"2014-07-13T20:35:36","date_gmt":"2014-07-14T03:35:36","guid":{"rendered":"http:\/\/www.little.org\/blog\/?p=2202"},"modified":"2014-07-13T20:35:36","modified_gmt":"2014-07-14T03:35:36","slug":"tweeting-dryer-now-with-washer-too","status":"publish","type":"post","link":"https:\/\/www.little.org\/blog\/2014\/07\/13\/tweeting-dryer-now-with-washer-too\/","title":{"rendered":"Tweeting dryer, now with washer too"},"content":{"rendered":"<p>Hallelujah! Today I finally finished adding washer monitoring functionality to the tweeting dryer setup I built earlier (see: <a href=\"http:\/\/www.little.org\/blog\/2013\/04\/21\/getting-started-with-arduino\/\">Getting started with Arduino<\/a>). Say hello to Gus!<\/p>\n<p><a href=\"http:\/\/www.little.org\/blog\/wp-content\/uploads\/2014\/10\/WP_20140714_08_32_49_Pro.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2204\" src=\"http:\/\/www.little.org\/blog\/wp-content\/uploads\/2014\/10\/WP_20140714_08_32_49_Pro-227x300.jpg\" alt=\"A picture of a washing machine\" width=\"227\" height=\"300\" \/><\/a><\/p>\n<p>My implementation was built up from the excellent work by Thomas Taylor for his article in Make, <a href=\"http:\/\/makezine.com\/projects\/make-34\/the-dryer-messenger\/\">The Dryer Messenger<\/a>. It provided a great starting point for this project but I wanted a bit more&#8230; I wanted to have my washer tweet and I wanted the washer\/dryer quotes to be pulled from the web. Should be simple enough, right? I was thinking that after I added an additional connection to the hardware configuration that it should be as easy as duplicating the dryer code and renaming some functions. However, nothing is never that easy. My optimistic guess was that I&#8217;d add 100 lines of code\u00a0and in the end it was more like 300. It was\u00a0a fantastic learning experience.<\/p>\n<p>A quick overview of my upgrades:<\/p>\n<ul>\n<li>Added code to automatically pick a baseline for the current draw of each device.<br \/>\nThe original example\u00a0required you to\u00a0play with\u00a0the values a bit to\u00a0define\u00a0the &#8220;off&#8221; value for the\u00a0dryer. I added a loop to take the state of both washer and dryer at startup and set the baseline values automatically.<\/li>\n<li>Made it so both devices would pull a random string from a MySQL database.<br \/>\nBy moving the strings of the Arduino and\u00a0onto the interwebs I made it so I can go to the web any time I feel like adding a new pithy quote.\u00a0Before, if you wanted to add a new string you needed to change the code in a couple places,\u00a0recompile and\u00a0re-upload to the hardware.<\/li>\n<li>Various changes to make the code ready to monitor two devices.<br \/>\nThere were some minor changes I needed to make to the main loop (move the status LEDs into washer or dryer specific functions) and fix the &#8220;takeCurrentMeasurement&#8221; function (it had the dryer pin hardcoded as A0).<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>I&#8217;ll share out my code, an updated circuit design as well as a quick write up on how I&#8217;m pulling random strings from the web. Right now, however, I need to go do a load of laundry.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hallelujah! Today I finally finished adding washer monitoring functionality to the tweeting dryer setup I built earlier (see: Getting started with Arduino). Say hello to Gus! My implementation was built up from the excellent work by Thomas Taylor for his article in Make, The Dryer Messenger. It provided a great starting point for this project\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4,16],"tags":[47],"class_list":["post-2202","post","type-post","status-publish","format-standard","hentry","category-idle","category-tech","tag-arduino"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/posts\/2202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/comments?post=2202"}],"version-history":[{"count":0,"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/posts\/2202\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/media?parent=2202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/categories?post=2202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.little.org\/blog\/wp-json\/wp\/v2\/tags?post=2202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}