Nov 24 2013

Hacking a Heating Pad


My wife and I have a heating pad on our bed. In the winter, we turn it on an hour before we go to bed. When we get into bed, we leave it on until we warm up. But if we fall asleep before we turn it down, we’ll wake up a couple of hours later, overheated. Clearly, we need a technological solution.

A simple store-bought timer that turns the heating pad off would not do. (A heating pad goes under the fitted sheet, as opposed to an electric blanket which goes on top of the bed.) On cold nights, we don’t want to turn it off; we just want to turn it down. The pad has five levels, and my wife likes to turn it down to level one or two. I usually turn my side down to zero or 1.

The heating pad controller has two buttons, Up and Down, and five LEDs that indicate the heating level. Inside, it has a Zilog Z8 microcontroller that turns a triac on and off to regulate the 120V power to the heating coils. The Z8 and the LEDs get 4.7V from a transformerless power supply.

[portfolio_slideshow include=”545,541,542,551,552″ autoplay=”true” pagerpos=”disabled” navpos=disabled timeout=4000 slideheight=320 size=full showdesc=true align=right]

My idea was to build a timer using another microcontroller, a two-digit LED display, and two buttons. The user would set a level, e.g. 2, and a time, e.g. 60 minutes. After 60 minutes, my microcontroller would simulate five presses of the Down button, to ensure the heating pad was at a known setting (off), then simulate 2 presses of the Up button.

The circuit is almost trivial: a microcontroller, a two-digit LED display, two buttons, and two wires going to the heating pad controller’s buttons. I didn’t even use a crystal oscillator; the internal oscillator is accurate enough for running the timer in an application such as this.

So it all seemed pretty simple, but power turned out to be the big problem. It’s ironic that a heating pad rated for 70W would break due to my timer, which used 1/1000th as much power. But I was tapping the Z8’s 4.7V supply and when my LED display came on, the Z8 crashed. Even with my display off, the heating pad controller’s LEDs flickered badly. Apparently, the controller’s transformerless power supply couldn’t provide much spare current.

The crash was easy to fix: I increased the current-limiting resistors on my display. This cut my load from 15mA down to 7mA, with a negligible decrease in the display’s brightness. But the heating pad’s LEDs were still flickering. I needed to reduce power consumption further. I replaced the heating pad’s current-limiting resistor too, making its LEDs a little dimmer but saving 2mA. I slowed down my microcontroller from a ridiculous 8MHz to 2MHz – the minimum I needed to refresh the LED display and avoid flicker. I disabled the microcontroller’s unused peripherals. My timer was down to 4.5mA.

Everything seemed to work, except that I noticed that the heating pad didn’t get as warm when my timer was plugged into the controller. My guess was that I was decreasing the current to the triac’s gate. I changed my code to put the microcontroller into sleep mode when possible. That fixed it.

After I built this, my wife came up with another idea of how to use it. (This illustrates the importance of getting end-user feedback.) Instead of turning the heat down in the middle of the night, use the timer to turn the heat on in the evening. So if my wife and I are going to be out from, say, 5 PM to 11 PM, we set the timer to turn the heating pad to level 5 after 4 hours. By the time we get home, the bed is all warmed up for us. I had to modify the code to allow this: when I thought we were only going to use this for turning the heating pad down at night, I implemented a maximum time of 90 minutes. Now, I needed to go up to 9 hours, and display that on a two-digit display. So for any time more than 90 minutes, it displays 2H, 3H, 4H, etc. And while pressing the button originally incremented the time by 10 minutes, once it gets past 90 minutes, the time now increments by an hour for each button press.


Skip to comment form

  1. Nate

    I love this. I would like to use this to solve a different problem and would like to know what you think.

    Where I live during the winter it can be very cold in the mornings. I find it harder to coax myself out of bed, because I know that once I leave the warmth of my bed I will be very uncomfortable.

    The plan would be to set a timer when I go to bed that would gradually heat up the bed. The goal would be that by the time my alarm goes off I would be almost uncomfortably warm and relieved to jump out of bed.

    1. admin

      Your idea makes me think of the proverbial frog in boiling water. Are you sure you’d get out bed? :-)

      I think your idea might work, but it wouldn’t be very precise. If you need to wake up for work at, say, 6:30, a heating pad might not wake you up until 7 on some days. Also, a timer might not be quite right for you; you probably would want a clock.

  2. Joe

    An excellent excercise in using a limited amount of power from an existing device to add features.

    I notice you mention the pad controller has a transformerless supply, which suggests that the entire circuit is connected to your electricity mains and could be live. In the interests of safety I would choose mains rated connectors for the interconnection such as the Bulgin PX0429/PX0430.

  3. fop

    If the supply of the Z8 is transformerless, don’t you have mains voltage at your circuit ? 120 V AC could be dangerous on a phone jack.

    1. admin

      The voltage at the jack is 4.7V DC. But you’re right that it’s not isolated from the mains by a transformer. It’s not as safe as a power supply with a transformer, but it’s no more dangerous than the heating pad controller itself – and that’s UL approved.

  4. Ted

    So, where’s the Schematic and Code?

  5. Steven

    Isn’t this how Skynet got started, giving humans 2nd degree burns? And can you get your heating pad to play Conway’s Game of Life?

    Seriously, there’s probably little danger, but could a bug in your software or the new options in your UI bypass a safety limit in the original “dumb” heating pad?

Comments have been disabled.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'graphene_scrollable' not found or invalid function name in /home3/rea5245/public_html/wp-includes/plugin.php on line 503