Beer fridge to thermal chamber tweak - Page 1
Forum section: electronics / beginners

author: kingbean
author_rank: Contributor
timestamp: July 15, 2013, 08:51:39 am
content: Hi everybody,Im new here and to such an electronics project, but I necessarily need this for my pets, so I do what it takes.I watched this videohttp://youtu.be/AI0Q6-h3EGUEEVblog #101 - Hacking your own Peltier LAB Thermal Chamber,where I see you guys hacked this Thermal chamber.Well I had a chance to get the same one, that is to say, there is really lots of models around, different brands, butits all made by one Chinese company and the outside design haven't changed for long.Unlike in the case in video, I did not end up with thermal chamber, but with mini fridge. The difference being forthermal chamber you can set any temperature between 2 -60 degrees centigrade and it will try to keep it byeither cooling or heating automatically. In the case of mini fridge you can set 2-16 degrees for cooling or 50-60 degreesfor heating. This is very disappointing for me, since I need it for eggs and larvae to keep more or less 25 degreesall year around.I would like to tweak it somehow to become same kind of thermal chamber that can keep set temperature andautomatically switch from heating to cooling and back if outside temperature changes.I have two ideas how to do it:1) to reprogram the control chip in my fridge (get new one or something)2) put the electronics out and use arduino boardDid anybody tried to do such things? Can you tell me if you have experience or idea how todo 1-choice? Anybody knows how to reprogram included control chip? (see attached photo)Or is there some other 3rd solution to this?Im trying to do this easy, reliable, relatively cheap and as fast as possible.Thank you for any ideas and suggestions.

author: Paul Price
author_rank: Super Contributor
timestamp: July 15, 2013, 09:36:31 am
content: It ain't no bid deal to program some chip you know something about, if you know something about programming. I would remove the old MCU and put in a new, with your own program.There are only two things to control, heating or cooling and a fan and there is the digital display. Piece of cake to any experienced programmer.The thing uses a Peltier junction to cool and heating and this is just a matter of wasting electrons. Either way the fan runs and so does the display. There are many chips out that can measure temperature and deliver to a MCU a digital result, so having accurate feedback necessary to control what's going on is not a problem.I see relays on the board, which means the existing controller is not doing anything sophisticated towards implementing a control scheme. It is definitely a slam-bang type of controller to get the job done with a too hell with too much precision attitude.The question is, whatcha know about programming a MCU to do anything?There are limits to how easy this project is:The first is your willingness of who much time are willing to devote to this project, to pay your dues to learn how to hack it, to learn a little about programming and get the job done. After a little MCU programming experience you won't find this project overwhelming.It will certainly be easier to heat the chamber than cooling it.The second limit might be how many dead insects your conscience can handle in the course of project development.It is easy with a little programming error here and there to change your insect luxury motel into a Nazi death chamber.The third limit might be the precision of the temperature you wish to attain. It is in fact difficult to globally within a cheapo icebox achieve an precise isothermal result if you want to create an ideal adiabatic chamber without filling the volume to be cooled or heated with oil within the confines of Dewar insulation, but you might get sloppily close with a lot less effort.I would certainly like to screw with it to get it to work. I really like hacking into things. Do you wannna find someone else to do the job? I would like to do this kinda thing if I could pay the rent.The last limit might be the refrigeration method, the Peltier Junction, which works best only when there is a wide difference between the ambient and the chamber it is imprisoned in and asked to cool. Like a rock star, and fans or not, it can get hot under the cooler.If you are just hot and cold about solving a problem like this, it might be a very good idea is to buy at least one extra box like this so your worms might some chance in this ugly violent world while you are hacking away to meet the challenge of perfecting this project.

author: kingbean
author_rank: Contributor
timestamp: July 15, 2013, 10:12:09 am
content: Hi, thank you very much for your reply.Please let me rephrase what you are saying. You suggest to put out the old MCU (third picture - black rectangle in the middle) by some other one,which I can program to do what I want. The rest of the electronics could stay the same? If I understand it right, now it has analog resistor basedtemperature sensor, so maybe I have to change that for digital right?I dont know anything about MCU programming, but I have some friends who might help a bit, plus I think I can learn quickly.Now I have ambient temperature 35 and it cools it down to 2 degrees with no problem (after given some time) and says it keeps itin 2-4 degree range. In winter I expect ambient temperature 5 degrees. Nevertheless, I need something between 20-28 with possiblyminimum or small range 2-3 degrees fluctuation.For the time being I dont have any animals there and I will put them after I run tests with empty dirt containers inside. I cool animalsin less sophisticated ways till this is done.I wouldnt really mind somebody else doing it for me, but since I live in Japan and I dont know anyone capable and willing. ;(QuoteI see. I suppose that is why they have two separate settings for cool and heat. Well since my range of temperature is kind of wide,I guess some 5 degree difference (ambient vs desirable) can be put in the chip as restriction. Basically I will monitor the chambereveryday and I need less than 30 hot in summer and more than 20 in winter (when 0-15 is in our apartment)Thanks again and please let me know how do you suggest I proceed.

author: Paul Price
author_rank: Super Contributor
timestamp: July 15, 2013, 10:20:25 am
content: What have you decided on how you are going to accomplish your goal? You need to have some kinda gameplan.I see that the temperature tolerances you are asking for seem to not require nuttin too sophisticated.

author: kingbean
author_rank: Contributor
timestamp: July 15, 2013, 10:22:06 am
content: Well I would like to do it the way you suggest - changing the controller and hacking what is already there.

author: amyk
author_rank: Super Contributor
timestamp: July 15, 2013, 10:24:28 am
content: It doesn't look particularly complex. Start reverse-engineering a schematic of it so you can figure out where to hook in.The MCU is aHoltek OTP 8-bitbut unfortunately its pinout doesn't match any PIC or AVR so you may need to do a bit of rewiring. Another alternative is to do quite a bit more RE and replace it with an HT46F47 flash version, figure out the programming protocol, etc. This way would make your mod look completely stock, but with more effort.Depending on the above, if you're able to read out the old firmware, it might be as simple as changing a few hardcoded constants for the limits and flashing it back on a 'F47... so basically your choice is between writing your own firmware or reverse-engineering the existing one.

author: lapm
author_rank: Frequent Contributor
timestamp: July 15, 2013, 10:26:53 am
content: If you have not done so all ready, draw schematics of current controller circuit in paper. Makes hacking it much more easy later.Also gives you some insight how it works now, before you start modifying it.

author: Paul Price
author_rank: Super Contributor
timestamp: July 15, 2013, 10:34:43 am
content: Reverse engineering is definitely the best approach. You first have to hack into it an discover what each wire to the control board is connected to.An easy way to hack this box is just leave the temperature measurement and display boards circuitry alone but hijack control of the fan and the cooling/heating Peltier junction relays. I would also find the temperature sensor interface and tap into it's output to feed to your microcontroller's A2D input.

author: Paul Price
author_rank: Super Contributor
timestamp: July 15, 2013, 10:52:23 am
content: The built-in temperature sensor and associated circuitry is probably good enough for your needs. You don't need to go to the trouble of replacing it with a digital output unless it is more convenient to do so. Any MCU board you might use will have an A2D converter to convert the analog output of the temperature sensor to some numbers the MCU can crunch to just operate two realys, one to control the fan, the other to control the raw power to the Peltier junction.If you want more precise temperature control, something called pulse-width modulation, could replace slam-bang control with proportional control of the heating/cooling. This kinda control can be achieved with ease. PWM simply turns on an off the power to a controlled device so as to vary the effective power by changing the duty cycle of the applied power. Duty cycle is the ratio of time on to time off and this type of control on/off dithering happens at ultrasonic clock speeds.So, basically you can reduce the whole new control system to just a few hooks into the circuit. You can do everything you want by just hijacking the relay activation circuitry and then by turning on and off the two relays by your MCU circuit, and just use the built in temperature control analog output for feedback all the while leaving the display circuitry alone. This type of hack can be the ideal approach to tackle the problem because it is a most simple approach to control the box and might be just all you need to do what you want.

author: kingbean
author_rank: Contributor
timestamp: July 15, 2013, 12:58:20 pm
content: Thanks for all the answers. I get on it. I talked with my friend and now it seems the biggest problem for usto get the ht46f47 and holtek e-writerpro kit with e-socket, so we can program the MCU. Any advice whereone can get these things? Seems it wont be available in Amazon or similar kind of store.

author: Paul Price
author_rank: Super Contributor
timestamp: July 15, 2013, 08:31:27 pm
content: Forget about the HT46147 chip and use any other chip you like, you either pull the existing chip and go to all the trouble of trying to find the exact replacement and trying to rewrite the code to for everything, include the display and switch interface and temperature control. You are probably not up to that task with your programming experience.why not just leave the HT MCU in the circuit to monitor the temperature and show it on the display and hijack the relay control circuits and take the power for temperature control away from the HT chip to and use any MCU of your choice to make your idea work?

author: C
author_rank: Super Contributor
timestamp: July 16, 2013, 01:49:12 am
content: QuoteIf the same outfit makes both, The difference may just be a jumper change next to the MPUC

author: Paul Price
author_rank: Super Contributor
timestamp: July 16, 2013, 03:42:27 am
content: Look at the picture, no jumpers next to the MCU I can see.If I was the guy making the board it would just so much more easy for me just to program the MCU with a software switch to make a really cool switch-a-roo of intended operation.

author: C
author_rank: Super Contributor
timestamp: July 16, 2013, 05:33:55 am
content: Quote from: Paul Price on July 16, 2013, 03:42:27 amWhich you did not doJ7 & J9 are easy to see.4 close to MPU and one by K4These could just connecting traces on the other side, but any one of these could switch temp rangesEdit Might not be a bad idea to contact the company and ask.C

author: kingbean
author_rank: Contributor
timestamp: July 16, 2013, 08:15:31 am
content: I was considering contacting the maker, but its a factory for power supplies that makes 10 mil of them per year and thesefridges they make for lots of other brands. Also some of these cost 100 bucks, but the incubators sell around 400, so I'mafraid they would not like to give away their schematics. :-(QuoteWould there be a way to find out what they do?I supposed the easiest way for such a company would be to have different sets of software in the chipand all the same hardware.QuoteOk, well I guess I misunderstood what you wrote previously.QuoteIn theory how does this work? Current MCU decides the ranges and what it sends to relay, so I would cut of the signal for relayfrom current MCU and give the new MCU also temperature data and how it should behave. But how do I make it to have the fullrange of selectable temperatures (2-60) ?Do you have any suggestions for the new MCU? I could get the one that is there, but the writer kit is like 100USD, so that is notworth it. I know about this arduino boards, but I guess thats maybe too fancy (or not?) for this task. So what MCU could do thejob and can be programmed easily, without expensive writer?Thanks

author: amyk
author_rank: Super Contributor
timestamp: July 16, 2013, 08:51:08 am
content: Quote from: kingbean on July 15, 2013, 12:58:20 pmYou don't necessarily need their official programmer; I haven't found the programming specification on their site, just their software, but all that means is you'll need to do (possibly quite a bit) more reverse-engineering. Asking Holtek might be worth a try too.I doubt those jumpers are for option configuration, they look more like routing on a single-layer board.If you want to change the MCU (keep in mind it will NOT be pin-compatible) you could go for an AVR or a PIC. Fortunately the specifications for those are more readily available, but it does mean you'll need to rewrite all of the firmware.

author: C
author_rank: Super Contributor
timestamp: July 16, 2013, 09:10:00 am
content: board maker name and address are on the board. they could do different software for different models or common software and have a jumper that switches from F to C and second jumper for full temperature range or like you have.They might tell you the jumper if they use jumpers.QuoteI agree, but worth a closer lookI would suggest tracing from both sides of the switches back to the MPU. The display;s digit traces could go the the switches for a multiplexed switch input to mpu. The jumper could be an added or removed part or even a resistor change.A good reverse engineering of that mpu board could give you the hint. To save pins they digital or analog mux the switches if they can. Will need this to swap processors also.High quality large printed pictures of the back of mpu board could make this easer.C

author: kingbean
author_rank: Contributor
timestamp: July 16, 2013, 09:37:55 am
content: Here is high resolution picture of front and back of that board.

author: C
author_rank: Super Contributor
timestamp: July 16, 2013, 10:51:48 am
content: Just a quick look,jumpers look like trace routing for the single-layer board.I also did not see any of the other ways I know to switch software via hardware.Looks like different software for different models.C

author: Paul Price
author_rank: Super Contributor
timestamp: July 16, 2013, 03:38:44 pm
content: Kingben, you say, "In theory how does this work? Current MCU decides the ranges and what it sends to relay, so I would cut of the signal for relayfrom current MCU and give the new MCU also temperature data and how it should behave. But how do I make it to have the fullrange of selectable temperatures (2-60) ?Do you have any suggestions for the new MCU? I could get the one that is there, but the writer kit is like 100USD, so that is notworth it. I know about this arduino boards, but I guess thats maybe too fancy (or not?) for this task. So what MCU could do thejob and can be programmed easily, without expensive writer?"You get the temperatures you want by tuning on the cooling Peltier junction and fan until the desired cooling temperature is reached. To heat instead of cool, you reverse the polarity of the current to the Peltier. This operation only takes taking control of the fan and Peltier junction relays.A tiny and cheap 20-pin Ardruino board will do the trick and can be put together even on a small project board and you only need to solder in a few wires to the original circuit. The inexpensive MCU comes with software IDE and all you need is to connect it to your USB port to program the thing.I can clearly see two 4.7K resistors near each relay driver transistor that connect to the driver transistor base connection. You simply cut the trace at the point into the resistor from the HT MCU and re-route these to your Arduino or ATMEL chip or PICC chip you decide to control with.If you want to calibrate the output of the temperature sensor built into the fridge, simple record the readings you see on the display and relate them to the output voltages you measure with a DVM on the original board.You can also buy a precision temperature measuring IC to feed into your MCU, but that could be quite a bit more expensive, but chips of varying precision, accuracy and price are readily available.What can likely be easy to achieve is a result that the original HT MCU will not even realize that you have hijacked control of those two relays that control the whole heating-cooling Peltier junction power and fan control. You can also easily hijack the button switches output to feed into your own MCU as control signals,

author: kingbean
author_rank: Contributor
timestamp: July 18, 2013, 10:49:08 am
content: Thanks for your reply. I see I did not make myself clear. I understand the way peltier works (as you explain it).I see your suggestion, but what I dont still get is the following.When I press "up temperature button" then signal goes to HT MCU and that one adds 2 degrees to current settempreture if less then 16 or it will go to 50 degrees. If I put the arduino where you propose, I can control whatthe relay will do, but cannot see set temperature 25 (for example) on display right? display will still be showing only2-16 and 50-60, and HT MCU will be sending signal within this ranges, which I can modify by the arduino like 10 means 25and switch to cool or heat depending on ambient temp, right?

author: amyk
author_rank: Super Contributor
timestamp: July 18, 2013, 11:16:13 am
content: Either you RE the existing system and alter the firmware, or replace the MCU completely and write your own. You'll need to interface the display and everything else.

author: Paul Price
author_rank: Super Contributor
timestamp: July 18, 2013, 11:49:49 am
content: Is it that the display doesn't show the temperature in the box, but only always shows two different readings?

author: kingbean
author_rank: Contributor
timestamp: July 18, 2013, 11:58:36 am
content: when you press button to change it show the set temperature and then after 2 sec shows the actual temperature

author: madires
author_rank: Super Contributor
timestamp: July 18, 2013, 12:06:10 pm
content: Quote from: Paul Price on July 15, 2013, 10:52:23 amIn that case he has to design a drop-in replacement with a MOSFET H bridge for the peltier element. Since he likes to set the temperature within 2-3 degrees Celsius around room temperature I think the H bridge is the better solution anyway.

author: kingbean
author_rank: Contributor
timestamp: July 18, 2013, 12:15:21 pm
content: I got it, I will disconnect up/down buttons and temperature sensor from the HT MCU and on where it originally was receiving the data from temp sensor, I will send data I want him to display from my MCU, that should work right?

author: Paul Price
author_rank: Super Contributor
timestamp: July 18, 2013, 11:12:18 pm
content: You don't have to disconnect the temperature sensor or any other button inputs to the HT MCU. You let the HT MCU still think it is controlling the temperature so you can see the temperature from the readout without any wiring for the display and extra programming work.You only disconnect the HT MCU control wires to the relays control Peltier Junction and the Fans. The HT MCU probably won't even know you've taken control of these relays.You can also let the HT MCU have input from the temperature Sensor and the front panel switches, but you add wires to these switches to the new MCU so you can also use them to use as switch signals with your new MCU design.The joke is on the HT MCU. It will probably not notice it has lost control of the heating and cooling and the f ans..

author: madires
author_rank: Super Contributor
timestamp: July 19, 2013, 12:39:56 pm
content: Quote from: Paul Price on July 18, 2013, 11:12:18 pmI wouldn't do that without reverse engineering the circuit to ensure that paralleling the inputs doesn't cause any problems. In unclear situations you would also have to reverse engineer the firmware. In some of my MCU based designs I use I/O pins to power sensors, change (voltage divider) resistors and reverse the voltage divider to increase resolution for a specific range of resistance. If you would just parallel another MCU you could create short circuits and would never get any valid measurements.

author: Paul Price
author_rank: Super Contributor
timestamp: July 20, 2013, 01:41:35 pm
content: I disagree...you are making the easy complicated.You don't parallel the MCU's, The two MCU's function together but are completely segregated except for the new MCU snooping at the switch contacts to get control input.It is not necessary at all to spend any more time reverse engineering. You are imagining functions of the old MCU upon these switches that would be extremely uncommon and so highly unlikely to encounter in a simple cheap fridge circuit controller like this.Besides, a simple look with a scope or a test, of course, would show any problems of the new MCU in controlling the operation using the existing switches. It would reveal any problems and a very quick fix..if necessary, just cut any wires going from the old HT MCU to the switches.The new MCU would have full control of the heating/cooling and fans and the only function of the old MCU would be to display temperature..and the old MCU can do nothing to change this.The old push button switches do no more than function as on/off switches fed only toinputsof the old HT MCU.

author: madires
author_rank: Super Contributor
timestamp: July 20, 2013, 04:13:30 pm
content: Quote from: Paul Price on July 20, 2013, 01:41:35 pmThe last words from the bomb squad's expert: "it's the red wire in 99.9% of all cases"

author: Paul Price
author_rank: Super Contributor
timestamp: July 20, 2013, 06:18:13 pm
content: This is a simple fridge controller, not a bomb. It can easily and safely be tested to verify correct operation.

author: amyk
author_rank: Super Contributor
timestamp: July 21, 2013, 11:07:49 am
content: Quote from: madires on July 19, 2013, 12:39:56 pmAlso the possibility that there could be more "intelligence" in the MCU than you think; e.g. detection for temperature-out-of-range, so instead of displaying the temperature you might just get "E". There's also the issue that if the temperature sensor is only designed for the two ranges, and internally there is a calibration table for mapping values to temperature, it might not work for anything outside of the design range. Or a safety timer of some sort. You need to investigate more.

author: Paul Price
author_rank: Super Contributor
timestamp: July 21, 2013, 11:24:48 am
content: This is a simple fridge controller, not a bomb. It can easily and safely be tested to verify correct operation.The testing tool, a thermometer.

author: kingbean
author_rank: Contributor
timestamp: July 22, 2013, 10:36:34 am
content: Thanks for all the replies.Well we started some reverse engineering, measuring and programming with arduino. For now the goal is to connect the back board witharduino and let it control those two relay drivers depending on the inside temperature.Good thing is that if MCU is not connected, the whole thing works in cooling mode, so no trouble there.Now I have some problem to get proper reading from the NTC to the arduino. When I set up direct connection arduino, NTC and 10k restistor,I was able to use the formula in herehttp://www.instructables.com/id/Build-yourself-a-clock-and-thermometer/step3/Create-the-sketch-or-arduino/and I got results which seemed to be like 2 degrees off compared to thermometer I put inside. I realize, they are at bit different place, butI also had the whole thing off for few hours to measure the room ambient temperature and still it was 2 degrees off.The guy in link above gives a link for wiki where the formula should be explained, but I dont see there the same formula heused plus for these formulas some parameters are needed. Can I somehow find out those parameters for my NTC?I dont see any name or such on it.Next is measuring the NTC outcome on the way do display. Here I found out there is 1k and 10k res on the way, as well ascapacitator. How do I calculate these in the formula? Reading in arduino was then 14 degrees off. If the behavior was linearI dont mind and offset it by 14, but it will not be linear right?One more extra question. There are two relays, each switch between ground and 12 V for peltier. To these the peltieris connected as well as two fans. These fans are on manual switch to get 5 or 12V. But how come if polarity changesfans dont mind that?

author: amyk
author_rank: Super Contributor
timestamp: July 22, 2013, 11:02:31 am
content: 2 degrees might be within tolerance for a thermistor, but 14 is definitely not.There's likely a calibration table in the MCU for this.