Author Topic: Oak controlled electric blanket  (Read 5428 times)

weaslyd

  • Newbie
  • *
  • Posts: 3
Oak controlled electric blanket
« on: March 25, 2016, 10:54:23 am »
For a few years now, I've had the idea of automating our electric blanket. I know it's sheer laziness, but making a special trip upstairs to preheat the blanket before bed was a pain, so we rarely bothered - and therefore got into a cold bed every night. So this winter, I did a quick search and came up with this: https://www.youtube.com/watch?v=IHw4C3RNDEQ.

Fortunately for me, I have the exact model blanket controller used in the video. So after a few rewinds, and with a few quick probes with the multimeter, I had a handle on how his project wiring worked. Next step was deciding on hardware. Once again, fortune smiled upon me. That very day, I got a Kickstarter email saying Oak shipments were on the way. I initially set out to reuse as much of the GitHub code from the SparkFun project as possible, but soon realized that wouldn't be much help. In the example, Joel used a $60 WiFly shield for not only communication with the board, but also to host the site. I had no intention of spending this kind of money on my project, given that I had 3 Oaks inbound that had cost a fraction of that price. So while I awaited delivery, I set out to learn some JavaScript, and to refresh my HTML knowledge which had grown dusty over the past decade due to lack of use. By the time my Oaks arrived, I had duplicated the basic web interface from the original project, and uploaded the html to my Qnap NAS. I now had the challenge of learning the Oak and the Particle cloud.

So I hacked together an Arduino sketch, using Particle.variable and Particle.function to communicate between my web page and the Oak. My initial efforts resulted in this: https://youtu.be/LEZktW5mcHk. It was functional, but I was not happy with the slow response time, or the misaligned layout. I also thought I'd prefer more precise control of the temperature than just "high, med, low" allowed. Soooo, I set out to learn something about AJAX. This took a few days of tinkering, but with that and a bit of work in Gimp https://www.gimp.org/downloads/, I got my project to where it is now: https://youtu.be/qfa6g26kdUs (thanks to my Droid Turbo 2 for the auto soundtrack - it made me laugh, so I kept it in the video). I have also duplicated this for the blanket controller that warms the other half of our king bed. The wife loves it!   :D

And now of course, spring has come to New England, and the electric blanket will be put away for winter. Guess I'll be back soon to post the status of my web controlled window mount air conditioners.  ;)

PS: I'll attach my Arduino sketch, html code, and JavaScript file to this post in case it's of use or interest to anyone. If you review it and see improvements or better ways to accomplish anything, please let me know. I have a BS in Comp Sci, but have been in sales management for the past 10 years, and only write code when a project/hobby demands it. Also, if anyone intends to do this themselves, I can upload my controller images.
« Last Edit: March 25, 2016, 11:03:20 am by weaslyd »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Oak controlled electric blanket
« Reply #1 on: March 25, 2016, 10:34:04 pm »
Awesome project - thanks for sharing it!

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Oak controlled electric blanket
« Reply #2 on: March 25, 2016, 10:50:46 pm »
Nice work, Thanks for sharing all the parts of a complete working solution!