Digital controller for a Refrigerator? - Page 1
Forum section: electronics / projects

author: Erwin Ried
author_rank: Regular Contributor
timestamp: August 03, 2013, 10:23:15 pm
content: Hi,I have a small "frigo-bar" that hosts mainly bottles/cans of pepsi and ham/cheese. Last week it started to buzz all day even in the lowest temperature setting, leaving the wonderful cola too iced to enjoyAfter checking the thermistor (and destroying a small capsule that contained gas tried to enclose it again; ambient temperature expanded too much the metallic blob) I tried to find the same version (says 02C in the case) without success in my town. This is not a freezer (to use the -15C ones, and it is not a normal refrigerator, to use the 05C ones, and the ranges of these spares don't reach either this range) so I am starting to think that this can be replaced with an Attiny, relay and a thermocouple.I have good experience with the reliability of the tiny, 1 year ago I asked here several things to make a AC timer for a towel dryer, and the timer still works wonderfully:So, since I can trust the Attiny for electrical appliances: I am thinking:1) Cheap 5V cellphone adapter, but... I am not sure if this is safe:2) 2x 7 segments display (-9 to 19 ºC) with 2 pushbuttons3) SSR or mechanical relay (mechanical relay it is better because it does not get hot as an SSR?)4) Not sure about the formulas yet. I measured the efficiency of the cooler system (unexpectedly the temperature rises the first minutes, probably because the cooling liquid was resting):And when it rest:Complete data for the graphs is here:http://cl.ly/QccSClearly exponential -> logarithmic curvesAny hint to optimize the behaviour of the controller?Ambient temperature for the tests was low (winter+outcast):

author: ignator
author_rank: Regular Contributor
timestamp: August 04, 2013, 03:29:26 am
content: I assume this is what is known as a "dorm room" refrigerator. And it has a compressor with an induction motor. I looked up what your power is in Chile, 50Hz, 220V for low volt single phase.You can make your own thermostat, or you could purchase a simple one off eBay, like thishttp://www.ebay.com/itm/All-Purpose-Temperature-Controller-STC-1000-Thermostat-Aquarium-NTC-sensor-220V-/251312628190?pt=LH_DefaultDomain_0&hash=item3a836661deMy search was ("STC1000", "STC 1000") (220v, 230v, 240v)There are others that have PID control, but I purchased one, that was impossible to use, as the instructions were incomplete (not fully translated). The above one is very easy to use. It also has a built in delay timer for use with refrigeration so the power stays off for a programmable number of minutes so the pressure in the system can equalize and the motor can start with no load.A refrigerator, does not need any sort of PID control, just a bang-bang (on or off) controller.The only issue with the above thermostat, is it has a relay that most likely can not be used directly to switch power to your compressor motor. It does say 10amp@250V, but it does not have a motor rating power stated, it may work with out problems. If not, either a larger relay with contacts that support the motor current, or a solid state relay should be used.You indicated that the PTC of your existing released gas when you opened it. Was there a copper tube connecting it to the electrical switch? I'm guessing this had a saturated refrigerant type working fluid.Also did you mean "highest" temperature setting (versus lowest), as it never shut off, causing the temperature to drop below freezing of your cola. The release of this working fluid would result in the thermostat never shutting the compressor off.Lots of nice lab work and measurements. Good luck.

author: echen1024
author_rank: Super Contributor
timestamp: August 04, 2013, 03:41:56 am
content: Using a mains-class relay + and ATMega microcontroller + a DHT22 temperature sensor for intelligent temperature control. it's probably also possible to upgrade to the raspberry pi for Humidity control (add humidifier) and control over the Internet.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: August 04, 2013, 05:54:49 am
content: Quote from: ignator on August 04, 2013, 03:29:26 amHi, thanks. Yes you are right about the fluid/gas but that happened after I disassembled the refrigerator part (it was not working properly anyway). This is the thing that released the gas:The STC1000 makes me question myself about if is really necessary to go for the AVR full homemade device solution or just trust these off the shelf solutions. The next step I am thinking to do is to extract 3 math relations (1: initial heat increase due cool down, 2: cool down, 3: motor off) using ambient temperature as a variable, to find a way to minimize the powered on time (in excel solver?).Quote from: ignator on August 04, 2013, 03:29:26 am1) How did you calibrated the delay timer? (it is needed for a refrigerator too?)2) This motor is very small, back label says 70W, including the 15W lamp, so the motor should be very small. I like the SSR but they produce heat, so if I don't want to modify a lot the internals (I am thinking on reuse the same case that hosts the lamp bulb) it may probably affect the efficiency (and add more consumption?)Quote from: echen1024 on August 04, 2013, 03:41:56 amCorrect, I am thinking on the atmega+dht22 (not sure about the possible humidity/reliability issue).I think using an RPI would be overkill, a good feature of this small cola refrigerator is that uses very little power over the year in energy (around $100 USD), 1 raspberry uses 3.6 to 4.1W as per my calculations with a meter (not including any wireless thing, no overclocking):Having 4.1W*24*30*12= 36 kW (in chilean pesos is around $13.5 USD extra, so I am really not sure if that really worths to monitor 9-18 liters of pepsibut for a bigger container would be awesome to get realtime feedback, and additional features like passive mode if you are not around the house, or temperature based on weather, etc)

author: SeanB
author_rank: Super Contributor
timestamp: August 04, 2013, 06:41:18 am
content: Simpler is to order online a Ranco K50-P1118 thermostat which has a range of +2 to 12.5C, or a K50-P1127 which is similar. Both are meant for bottle coolers or small fridges, and are cheap, should be under $5 each.

author: hedgewallace
author_rank: Contributor
timestamp: August 04, 2013, 08:23:51 am
content: I have heaps of experience fixing fridges, and faulty thermostats is a common problem.I would just put a new thermostat in, but there is no fun with just an original thermostat!Costs and power consumption of the digital controller would be the biggest thing to look out for.Adding a digital controller to a fridge could be very handy. You could program it to make it colder around the time you would drink pepsi (2-10pm), and warmer around the time you wouldn't normally drink pepsi (2-10am) to save power. (I'm not sure whether the atmega can log the time though)

author: ignator
author_rank: Regular Contributor
timestamp: August 04, 2013, 01:08:37 pm
content: Quote from: Erwin Ried on August 04, 2013, 05:54:49 amLooks like a small diameter tube, with I'm guessing a hydrocarbon liquid, that contracts on temp drop, which acts against a diaphragm,that acts against a mechanical mechanism, that throws the electric power contact.There's probably an overcenter spring to give it a snap action (this prevents arching of the electric contact, and provides hysteresis). There should have been an adjustment screw set by the factory, with some glop to set it's original adjustment.For a real small refrigerator, there is no need for the complexities to mess with a PID thermostat for power saving. If you want power saving, you want to have so much insulation that the heat gain (which you can never stop) from the environment is reduced, but how big do you want the refrigerator in your room.A long time ago, back in school I took a class on solving differential equations, the professor had us calculate the power consumption of a hot water heater. The hot water is held at full temperature all the time (it actually cycles between the cutin and cutout setting of the thermostat, which was modeled). And yes if you put a timer on it, so it comes up to temp. before your morning shower, you could save money. But at the cost you may not have hot water when wanted.Quote from: Erwin Ried on August 04, 2013, 05:54:49 am1) The delay timer is not needed, but when a mechanical compressor that is driven by an induction motor, which has very low starting torque, and if the thermostat just turns the compressor off, if you try to restart again within a few seconds, by changing the thermostat setting colder, (a power cycle while it's still running will do the same thing), a locked rotor power surge will occur.On the compressor and in series with the common electric terminal is a thermal overload switch, that does 2 things, if the compressor runs too hot, it removes power, if the compressor is stalled, the locked rotor amps, will trip this thermal device. So what the STC1000 does, if you cycle power, or change the thermostat setting it inserts a programmable time delay before it tries to restart the compressor. The calibration of this delay time is really how long the system takes for it to equalize the pressure between high pressure and low pressure side of the compressor. I'm guessing that the high to low pressure metering device is what is known as a capillary tube. This is nothing but a very small diameter (inside dimension), and calibrated length (figured out during design development), that restricts the flow of liquid refrigerant from the high side (condenser) to the low side where it boils and absorbs heat (the evaporator). And 1-3 minutes is typical for pressure equalization.2) At 70 watts motor power, the 10 amp switch of the STC1000 probably is good enough (this is a resistive load rating). As this is a China seller, they don't understand this an additional rating (HP or watts inductive load) which is on the relay assembly, but must not be in the vendors specification sheet, which the seller copied into their eBay auction.The simplest solution is what what hedgewallace and SeanB have indicated, just replace with same or equivalent thermostat. The last time I tried to fix a room window air conditioner, they wanted $130 for this. So I found a surplus thermostat I mounted externally. It should have been less then $25, but I could not find one anywhere for cheap.Sorry for all the run-on sentences, and poor grammar.

author: SeanB
author_rank: Super Contributor
timestamp: August 04, 2013, 01:29:50 pm
content: I buy them regularly. The genuine article is often $20 from the agents, who simply provide a $3 cheap thermostat in their own box ( or not, just put a sticker on the white box over the original part number) while a genuine Ranco is around $5, so I buy those. They often come with a universal kit, new spade terminals and covers along with a new knob and scales.

author: ignator
author_rank: Regular Contributor
timestamp: August 04, 2013, 02:24:05 pm
content: Quote from: SeanB on August 04, 2013, 01:29:50 pmHere in the states, the local HVAC supply vendors sell for way more. Understand there's so much regulation, tax, lawyers, that all add to any business overhead. Don't worry, the whole world will soon be on the same page. O_o.For a small refrigerator I can find this:http://www.ebay.com/itm/1PCS-220V-16A-Thermostat-Knob-Refrigerator-Temperature-Switch-Controller-Probe-/321139476823?pt=LH_DefaultDomain_0&hash=item4ac5678957$9 from China, and it's missing the motor inductive watt rating, 16amps does not give me the LRA rating (locked rotor amps), or inductive HP rating. But I would guess that it will work for the OP's "frigo-bar".New dorm size refrigerators are very cheap, I know waldomart has them for $64. Especially now that's it back to school time.I'm currently working on getting rid of the window ACs in the shop, and replacing them with mini-split systems, inverter design, to drive the compressors. As electric power is only more expensive, and the SEER rating is now important. And these are $600+ for 9000BTU size.

author: SeanB
author_rank: Super Contributor
timestamp: August 04, 2013, 02:40:34 pm
content: No need for expensive very unreliable inverters, the regular rotary units have had impressive gains in efficiency over the years. Buy a good name unit and you will have both a lower cost of running and a lower power bill. Cheap units are $300 here for a 9000BTU One Hung Low Mystery manufacturer unit, and a good 12000BTU is $700 from Carrier. The 12000BTU has a lower power consumption than the 9000BTU one by about 15% despite the higher rating. As well needs piping added, while the cheapie comes with a premade 5m pipe and cable kit. The difference is in thicker copper, extra coils and a better compressor.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: August 05, 2013, 12:29:11 am
content: Quote from: ignator on August 04, 2013, 01:08:37 pmYeah hedgewallace and SeanB suggestions are the simplest solution, but I was really never happy with the stability of the original thermostat, also shipment time here is usually 45 days, so I will look for a replacement to order tonight but in any case I have time to try to fix it in a DIY way.What is missing to develop the pid controller for the attiny (first simulated) is to understand the first phenomen, I can match the cooling process in my graph to this exponential solution:But what is happening in the first slope? (when the temperature rises the first 30 mins?) should I consider that part of the cooling process? More data-collection is needed? (motor off time as one variable now)

author: ignator
author_rank: Regular Contributor
timestamp: August 05, 2013, 08:35:20 am
content: Quote from: Erwin Ried on August 05, 2013, 12:29:11 amAre you making your temperature measurement directly to the evaporator surface, or to the air temp somewhere remote to the evaporator, or on a item like can of cola? I'm believing your measuring the evaporator temp. But really what is wanted is long term data from the warmest part of the refrigerator, when it's fully loaded with lot's of items, as these all stabilize the thermal mass long term, and provide the longest off time of the compressor. All a thermostat is doing is performing off on about a set point, and provide hysteresis, so you don't end up with short cycling of the compressor. Yes you could use a fancy control system, to overshoot the setpoint, if the intent is to cool the newly added warm items at the fastest rate. As items in or near the evaporator are cooled first, and the time it takes to remove heat from the further items from the evaporator, is dependent on how stuffed your frige is.But where a PID control is really used is where you can modulate some apsect of the control. Here you have a compressor that runs at a fixed speed from your 50Hz mains. You can't control the power into your system. And the real heat transfer rate is dependent on the temperature of the condenser. And this is a function of the room temp (and that's just a coil on the back of your unit, depending on mostly convective heat transfer, unless you put a fan on it), and the size of the condenser. You can only change the room temp. unless your going to make major changes to your system. I'm trying to get you to see that a PID controller is for systems where you can control or "throttle" some aspect of your system. In this case it would be heat removal rate. And that is "fixed" by your existing system. You can improve on the system control, but you need to have some sort of mass measuring algorithm, and it needs to know when you add items and how much specific heat needs to be removed. Your end goal was to reduce power consumption. But your stuck with your current system of too small a condenser, and non speed controllable compressor. And as I said before, more insulation is the most important system aspect to reduced power consumption so you make the off time very long, and the on time is to remove new heat load energy.The only easy solution is for a temperature switch, that you can control the cutin, and cutout temperature. This give you full control of the hysteresis, which is fixed in these mechanical thermostats.

author: ignator
author_rank: Regular Contributor
timestamp: August 05, 2013, 02:53:57 pm
content: Quote from: SeanB on August 04, 2013, 02:40:34 pmI don't want to hijack Erwin Ried's thread, but here a Carrier MVQ012 is $1400 (1 ton). It's 13 SEER (which for the life of me is an obfuscation of COP), if they would publish tables of outdoor conditions and indoor conditions, and energy moved, and energy consumed, you could make decisions based on real data.I understand the biggest improvements in AC occurred when they oversize the condenser. Here where I live, it's hot and humid. So you can remove the sensible heat from your space, but still be left with humidity latent heat that requires either under sizing the AC unit so it runs 100% duty cycle, or you use inverter technology to keep the evaporator from freezing, and reduce indoor humidity to less then 50%.And I understand they still have not perfected the use of power electronics in the worst possible environment. I have looked at two vendors so far, Mitsubishi and Turbo air. I've seen the PWB in the Mitsubishi, does anyone use conformal coatings for humidity? And they will only have an improvement if they properly wash the circuit assemblies to remove any halide salts left from soldering and flux removal processes.SeanB: did you ever do a tear down to determine where the failure was in any inverter system? From looking at your weather conditions, dry in most parts of the country except for west shores. But that's internet, and not personal observation. I'm guessing PWB board arching via SIR breakdown processes.Sorry the following is a rant:I just retired from a company that did not understand this. The factory was remote to engineering, and they would make process changes in the name of "green". Frustrating, as they would revise existing process drawings, which were called out in the BOM for the assemblies. So engineering never knew they made any changes until field failures occurred. I retired early over the last moron process change of using water based conformal coating. They had some Chem E that did some SIR (surface insulation resistance) tests, but with no design of experiment. And would not publish the report, because it failed. But since that came out of advanced technology department, and there was "incentive pay" for green, money drove a real dumb outcome. They never did a test after subjecting the coated test board to humidity, and while having a DC voltage bias applied. The soldered assemblies had halide ions, as well the conformal coat had ions that allowed ECM (electrochemical migration) to occur. Dendrites formed all over the board, and with voltages as low as 1.2VDC bias, causing leakage currents, and failure of any assembly that used this. And again, production revised the process spec. that called out the acrylic conformal coat, to use the water based product.This product was avionics, and condensing humidity is a real world condition.I have searched for any reviews of any brand mini split, and have not found any reliability information. And name brand alone does not guarantee a quality product, as everyone is value engineering expensive materials out of their residential systems. And now with the higher pressures of R410A, leaks are occurring. Trane systems and Goodman both have this problem. Also understand a brand unit you have delivered to you, most likely was not built in the same factory as here. I know this because I worked for The Trane Company in 1976-77, as a lab tech in heat transfer and fans. There I saw roof top units built locally, Germany and France. I have to say that anything shipped over vs locally built was not built to the same drawings, where spot welds were supposed to be, they MIG welded. And they mitered the corners instead of overlapping. And I saw residential units built as prototypes that did not survive a short trip in a semi-truck trailer. The evaporator coils were found to shear of the spot welds and sitting on top of the fan unit. It was a fun job, I did learn how to design for experiment with how lab test data is taken and measured.The best I've been able to find is on youtube, with HVAC techs. but their main complaint is hacks that have no clue how the refrigeration thermodynamic cycle works. Mostly in the southern states, which do not have regulations the same as northern states. As regulations are local, even the licensing of contractors. The only thing universal is the EPA608 certification, (fluoro/cloro carbon release) as federal involvement.If anyone has any experience with minisplits or split systems that use inverters to drive the compressor, I'm interested in hearing about your experience with reliability.

author: Sigmoid
author_rank: Frequent Contributor
timestamp: August 05, 2013, 03:21:33 pm
content: Quote from: ignator on August 04, 2013, 02:24:05 pmI always find it mildly amusing how Americans think that they have the most tax and red tape in the world.Guys, yo do not. I absolutely appreciate how you are trying to cut back on the runaway regulation and taxes, and I'm sure this mindset allows you to, well, still be one of the best places in the world to do business.Just check out Europe. You think 30% tax is too much? Try on 70% for size! Also, ever heard of ROHS?

author: ignator
author_rank: Regular Contributor
timestamp: August 05, 2013, 08:41:00 pm
content: Quote from: Sigmoid on August 05, 2013, 03:21:33 pmSome ideas are good, but ROHS lead free is something that is harming the whole world with tin only electronics (I understand it applies to other heavy metals, and byproduct chemicals). And from my experience with avionics assembly, you now have to worry about tin whiskers, where the current design segregation was 5mm, but you can easy get whiskers that grow more then 10mm. This results in redesign, if safety was dependent on that initial spacing of isolated redundant channels (there was a thread here about Toyota accelerator pedal tin whiskers that caused throttle run away). And instead of long term reliable electronics you get much more failures from the higher tin melting temp, as well thermal stress early life failures. ROHS compliance is not just an EU thing, as it drives all electronic component vendors to have just one part with ROHS compliant parts.Did anyone think of all the hazardous material used to fabricate electronics? So now you have early failure, and more components needing to be made to replace junk.My opinion about ROHS. But there were regulations in place on all of the toxic heavy metals from past failures. Lead to me is fairly inert. If you don't want it buried, them recycle it. And we are learning to use the tin only manufacturing processes, but it does not come free. For avionics ROHS is not required, but you can't buy parts that are not ROHS compliant, and reballing 600-1000 pin BGA parts has additional expenses. When you manufacture things that have to work -55c to +70c you need the soft lead to give some compliance to the solder joint. And reliability requires 2500 temperature swings to qualify a packaging technology for avionics. Tin can not survive this mechanical stress caused by thermal expansion.Yes we complain about taxes just like everyone. And I'm sure the same system costs more anywhere in the EU. In the end it's how many of your hours you have to work to buy something. As you can trade in anything, but it's the human hours it takes to mine it from the ground and reshape the rocks into the thing you want to own. That's what your paying for. If your taxes were taking away your quality of life, then your representatives would change the rates.Sigmond, as your not indicating any country in your profile, I'll assume your from Denmark or Sweden where 70% taxes (55% income max, 25% VAT) and happy people live. I bet you can go to any grocery store, and buy anything you want, and have full infrastructure that all makes your existence jovial.At least we are not living in a place where shortages of everything abounds. Or because of lack of regulations, air quality is unlivable.The states are just a few decades behind the EU in socialism. We will catch up. And we don't have VAT here yet (but the feds are working on it), just local state sales tax. 7% where I live, plus 33% fed income, plus 9% state income (and fuel, tires etc. excise tax). Our local county government has adopted the international building code. But this adds little to a home cost, and provides some baseline quality. And then there's property tax, that's my big unknown for the future of how much rent to stay in the place you own.So all that said, tort law is most likely the biggest difference between the states and anywhere else. Liability claims drive everything up. It's always someone's else fault here, there's no personal responsibility. Unless you also have this same sort of legal system.

author: Erwin Ried
author_rank: Regular Contributor
timestamp: August 06, 2013, 05:18:05 am
content: Quote from: ignator on August 05, 2013, 08:35:20 amThanks for the info ignator. The probe is sticked to one pepsi on top and the refrigerator is almost full (normal state, couple pepsis and some cheese and ham). I think the "dumb" control is just the way it works, I don't like it as a solution, but it is ok. The original "probe" was in the evaporator itself

author: Erwin Ried
author_rank: Regular Contributor
timestamp: August 29, 2013, 12:34:54 am
content: Well, for the moment the solution to my refrigerator is not fully integrated butIt tracks every movement in an SD so I will be able to discover the real efficiency. At least for the moment the Pepsi is getting perfect temperatureThe relay is in a simple outlet box, with a 9V adapter. Relay gets 5V and signal back from the arduino thru a repurposed ethernet jackNo 'real' PID yet, but I don't really know if it worths to research into that (I barely remember the topic from university)