Wednesday, July 23, 2014

Arduino, XBee, and a Freezer Defroster

I have an upright freezer.  Living a ways from town and the climate make this necessary.  I load a cooler in the car, go to the store get my frozen goods and some ice, pack the food in the cooler with the ice and come home.  When it's over 114F outside, you have to take some special precautions to keep the food from becoming a puddle in the back of the car.

A while back I discusssed how my freezer uses power; it's relatively efficient except for one item, the defroster <link>.  A freezer's defroster is a combination of a timer, a heater, and a thermostat to monitor the temperature of the evaporator.  What bothered me was the timing of the defrost cycle.  Every 11 hours or so, it would defrost, and this meant that the heater would be on during peak usage period.  Since I pay a lot for peak usage it would be nice to have better control of the timing of the defrost cycle.  So, an examination of the defrost circuitry showed a clear opportunity for an accurate timer and a simple SPDT relay as a replacement for the conventional method.

So, since I had a couple of arduinos that weren't doing anything, I got one of these:
This shield has both the relays and the XBee socket I wanted to use, perfect.  I have a few XBees that I picked up, so I configured one and plugged it in.  A little code later I was reading my house clock transmissions and setting off a timer every 12 hours.  I chose 08:15 and 20:15, times that are outside the peak period, now all I had to do was wire it in and test it.  Here's an image of the schematic of the circuitry:


I circled the defrost timer to make it obvious.  Notice that it simply switches between the compressor circuitry and the defrost heating assembly.  This makes it simple to wire into the circuitry, so I took out the timer and used the plug that went to it to wire into the relay of the arduino shield.  It was ready to test, and I hooked up a wall wart power supply and plugged the arduino into the same power monitor that I use on the freezer.  It worked like a charm.  Now my freezer goes into a defrost cycle at the programmed times and runs for 30 minutes.  I checked the evaporator pretty often to make sure it was running the heater long enough and everything seems fine.

While I was programming the device I threw in some code to allow me to set off the defrost cycle any time I want to as well as having it report through the XBee the status of the defroster.  This leaves a clear opportunity for installing a temperature sensor, compressor sensor, door sensor, etc.  Over time I may well do some of these things.  I could go nuts and use the arduino to control the entire freezer; these appliances are relatively simple devices and a little arduino and some relays could take over the entire operation.  I'm not sure there's any real point to that since it works well already, but I may get bored some hot summer day.

A temperature sensor would be pretty nice though.  I could send the temp to my house controller <link> and set up a piece of code to check for the temperature getting too high.  A too-high situation could easily send me mail or light up an LED somewhere to alert me to a problem.  Or both.   

Here's a chart of my freezer power usage over a 24 hour period:


The freezer is the black line.  Notice the two humps, one at 08:15 and the other at 20:15?  That's the increased power usage from the heating units (one on the evaporator and the other on the drain tube).  Now I have this power using mode scheduled for the lower rate periods.  With the new LED lights I installed in the freezer to replace the incandescent ones, this device is getting cheaper to run all the time.

Before you tell me that the wall wart and arduino probably use 5 watts continuously, remember my goal was to move the higher usage away from peak billing periods.  I'd rather have 5 watts continuous than 400 watts for thirty minutes during peak.  Peak usage is really expensive in my area.

No, it's not a major savings, but every little bit helps.  Heck, I'll probably get back the money I spent on the shield and arduino in ... what ... 10 years or so.

18 comments:

  1. Hi.

    Although this post in particular doesn't have much in common with my situation / installation, I always find your posts quite interesting.
    Thanks for sharing your findings, experiences!

    ReplyDelete
  2. If you take over all refrigerators, freezers and so on you could reduce the time their compressors overlapp =)

    Always fun and interesting to read about your projects

    ReplyDelete
    Replies
    1. You know, I thought about that way back when I was first starting to look at controlling power and then forgot about it. You're absolutely right ! The problem now is that the devices overlap a lot. The house freezer runs the compressor for very long periods to freeze water and recover from new food items being added. If it got control, it would cut the fridge out for a long time.

      I'm going to take a long look at this and see if I can actually do something like this, but for now I'm at a loss on how to keep one device from causing the others to go too long between cycles.

      Delete
  3. May I suggest an improvement to your defroster? How about measuring how much frost has built up and only defrost then? Fabricate a sensor that uses capacitance to measure the frost. http://www.appliancemagazine.com/editorial.php?article=2019

    Another method that might work is to monitor the temperature in the freezer. I graph mine and it looks kind of like a sawtooth wave form as the compressor comes off and on. As frost builds up, the cycle time becomes longer.

    Best Regards,
    Chris

    ReplyDelete
    Replies
    1. Not a bad idea Chris, but it would take a lot of research to get it right using capacitance. It probably would be a fun project, but I'd be afraid that something would go wrong and I'd lose a freezer full of meat. The temperature idea is actually pretty compelling. I could put a temperature sensor inside and measure that over time to get a feel for when it needs to defrost, and I'd at least have the temperature to monitor the health of the freezer.

      Now if I can just figure out how to get a wire into the freezer from where the arduino is....

      Delete
  4. Hi, sorry for digging out old topic but I wanted to ask about your experiences - is everything ok with the project? I am currently trying to replace broken defrost timer with arduino + relays but I am bit worried about relay shield being able to handle fridge loads. While original timer aims for 8A max load and relays are marked as 10A I am not sure about relay shield circutry. Is your solution working fine longer term? Thanks for the info in advance

    ReplyDelete
    Replies
    1. I've had exactly zero problems with this setup. It's been working continuously now for quite a while and reecovers nicely from power failures and such.

      Two things that you can do to ease worry. First, get a good wall wart to power it. I've had several of the wall warts fail in various applications, and a good one will last forever. Second, if you have two relays, fire them both and parallel the relays to share the load between them. This way, if you do lose a relay, you have another one to take up the load.

      I didn't parallel the relays, I just though that I'd switch over to the other one if the first failed. It never failed.

      A source of time is the problem you may have to overcome. I have a house clock that provides time for all my devices, If you don't want to go that route, think about a real time clock of some kind to keep the timing for you.

      Delete
    2. Thank you for the info - I am a bit less worried now :) I will give it a try today or tomorrow

      Delete
    3. Be sure to come back here and let me know how it goes. I love hearing about folk trying thing like this.

      Delete
  5. :) Well I did a test run: got three devices to switch (compressor, fan and heater) and gave each of them one minute of power. While compressor and fan were easy to notice I was not able to feel the heat - I will give it more time tomorrow (I was thinking about using wattage meter for debugging but I do not have it yet).
    I have put hot glue on all high voltage contacts. Shield still looks pristine :)

    ReplyDelete
    Replies
    1. Depending on your country, take a look at a product called Rescue Tape. I discovered this stuff a few years back and love it. It's uncured silicon and will only bond to itself. That means you can wrap a connector or wire and not worry about having a mess later. To get it off, just cut it with a sharp knife and peel it right off. Water proof after it sets up and stays forever.

      The problem is that the brand name stuff is expensive at around 1.5 dollars a foot. I get another brand 'F4' and it's much cheaper. I keep this stuff out in the garage and use it all the time for various projects.

      Beats the mess of hot glue by a long ways.

      Delete
    2. Thanks, I will check that. I am from Poland. I have found tesa's one here reasonably priced
      http://www.tesa.com/consumer/adhesive_tapes/repairing_specialities/tesa_extra_power_extreme_repair,c.html

      Delete
  6. Now I got problem: I have powered arduino from a point where defrost timer' motor was powered; it looks like it is behind thermostat so 6h25m cycle is for 6 hours of active compressor, not absolute 6h period and my board is being turned off with the compressor; i need to rethink it...

    ReplyDelete
  7. Best would be to have an input telling me that the thermostat is on... capacitive coupling?
    http://forum.arduino.cc/index.php?topic=167616.0

    ReplyDelete
    Replies
    1. I just plugged the wall wart right into the wall to power the arduino; that's one reason why time was important to me. Also, the whole point for me was to control when the defrost cycle happened.

      Delete
    2. Yes, I have simplified it: I changed power source to constant one and cycle from 6h 30m to 12h 30m

      Delete
    3. I got small failure: my relay shield is based on i2c i/o extended and initial output command was quietly failing so my fridge was running with both compressor and heater turn on unintentionally
      Now, after finding and fixing the cause all is working fine for couple of days now :)

      Delete