PID controlled Peltier cooling system to control fermentation

Hello,

I’ve been playing around with the Arduino for about two months now and it’s been a lot of fun learning how to use it. I’m new to programming and electronics, and I started with the idea of using the Arduino to PID control Peltier cooling plates with a thermistor so that I could precisely control beer fermentation temperature. Eventually I want to add WiFi networking and data monitoring, but I’m not there yet!

As I’ve been working with it and testing Peltier plates and MOSFETs, the project has grown, with LC filters, MOSFET drivers, and such. Now, I think it will consists of 3 Peltiers affixed to water blocks on both sides, with a pump circulating hot exhaust though a PC fan cooling radiator on one side, and cooled liquid pumped through stainless steel coils on the other side.

I am working on the schematic so that I can have this made into a PCB, and I was wondering if the community had any advice on the circuit in case I was missing something. The whole thing is really just pieced together for information I found on the Internet, so any help would be appreciated!

R1, R2, and R3 are the Peltier plates. They are TEC1-12715, rated as 15A each.

The MOSFETs are IRFB3207.

The MOSFET driver is MCP1407.

Values for the capacitors and resistors are stuff I found other people suggesting.

Thank you!

I had an idea for a project using a peltier a while back. Passed on my idea when I realized how inefficient peltier devices are. That and the fact they don't cool things down all that well. A modified refrigerator or freezer would probably be way better in the long run. Just my observations.

I tested out the 3 Peltiers by hooking them up to a 50A power source along with cooling and heating pumps attached.

It was able to take 5 gallons of water in a plastic bucket from 80 F to 34 F in about 10 or so hours. This was without any insulation to the bucket, and I would think that if it were insulated it would probably be able to do it much quicker. I also measured the hot side of the Peltier, and when the cold side was 34F it was 115F, convert that to C and it still has some temperature differential left in it’s cooling power.

Either way that amount of cooling is more than what I would be pushing it to do for maintaining a fermenting bucket of beer at 60F in my apartment on a hot day. Plus it will be much smaller and less noisy than a modified air conditioner.

I attached a photo of the test setup.

Your Peltier cooler is relatively slow to effect a change in temperature. Your thermistor is slow to react to changes in temperature. Why do you think you need PID in your system?

I decided to go with this setup because I don't have space in my apartment for a modified refrigerator. I don't mind the extra work in making this setup, and I'm interested in learning EE and programming.

Fermentation is an exothermic reaction and can be analogous to a project where a car driving uphill needs to go at a set speed. I'm using PID because it made the most sense to me when I read what PID is used for. PID uses an Input to find a power Output that matches a Setpoint value, ideally without over or undershoot. This avoids hysteresis. Also there are many breweries that use PID to control temperature.

I'm pretty sure the Peltier will degrade if on/off hysteresis is used, due to thermal cycling. So a program that uses regulated output would be ideal.

Though next I came along the issue that PWM is itself also an ON/OFF state, and lowers the efficiency of Peltiers because even at high frequency while they are in the ON state they are fighting the heat dissipation from the OFF cycle. So I found schematics describing a Buck converter, or LC filter (I'm not sure which I'm using), that will smooth out the PWM signal and make proportional linear voltage/current.

That's kind of where I'm at right now in the schematic above, I was hoping someone here could tell me if the schematic above would work with PWM on the Arduino to power the MOSFET driver, and then the Peltiers, which would then have smooth current via the Buck/LC filter.

The thermistor seems to respond fairly quickly to temperature, much quicker than the Peltier will cool, which is fine. I've tested out the thermistor end of my setup, I'm not quite happy with it, but it's getting there. At first the temperature reading was very variable, moving +/- up to 1F constantly. Since then, I've added capacitors and an inductor to the Arduino power source (which is the same as the Peltiers). The temperature remains fairly constant now, +/- 0.1F. Although it's still a couple degrees off, so it's consistent but not accurate. I think this is because I bought some 10K thermistors off Amazon without a data sheet. I have some better thermistors that I haven't hooked up yet.

numbfx: The temperature remains fairly constant now, +/- 0.1F. Although it's still a couple degrees off, so it's consistent but not accurate. I think this is because I bought some 10K thermistors off Amazon without a data sheet. I have some better thermistors that I haven't hooked up yet.

Calibration is always needed when using a single thermistor. Can be easily done in your code.

a cheap second hand freezer?

  • A small one is as big as what you have setup there.
  • faster response
  • a lot less powerhungry saving you $$$

I'm pretty sure the Peltier will degrade if on/off hysteresis is used, due to thermal cycling. So a program that uses regulated output would be ideal.

Your program does not use a regulated output. Instead, it uses rapid PWM or on/off switching, which is known to degrade Peltier devices more rapidly than "on/off hysteresis".

Bringamosa: Calibration is always needed when using a single thermistor. Can be easily done in your code.

a cheap second hand freezer?

  • A small one is as big as what you have setup there.
  • faster response
  • a lot less powerhungry saving you $$$

I'm currently using the Adafruit thermistor code, what would you recommend I do to calibrate? I'm using a 10K resistor and following their setup, I measured the fixed resistor using a DMM, I also put a 47uF electrolytic cap in parallel with the resistor between 3.3V and and A0. This seems to help with noise as well, though I'm not sure if it's a cause of the off-calibration.

My next step with the thermistor is to try to hook up the more accurate thermistor I have and use code that involves the 3 point Steinhart equation and see if that improves the accuracy.

Regarding cost to run, max power draw is 12V 45A DC. That's about 4.5A at 110V AC, equivalent to a small fridge, and less than a modified air conditioner unit. I don't expect the device to work at max power, because at max power it drove an uninsulated beer carboy down to 34F and held it stable in a 70F room. So I don't think there will be a much of a $$$ difference power-wise (or at least a difference that will cause me to abandon this project).

I also think this would have a faster cooling response because the Peltier is cooling liquid which is circulating through the beer wort, as opposed to cooling air around the vessel. Also, because fermentation is exothermic, cooling the air around the vessel can lead to internal temperature differences, making air cooling less effective or accurate.

jremington: Your program does not use a regulated output. Instead, it uses rapid PWM or on/off switching, which is known to degrade Peltier devices more rapidly than "on/off hysteresis".

That's why I am posting the schematic, I am looking for advice on turning the PWM signal into a regulated output. I think I have achieved this across all 3 Peltiers, and it should work at PWM frequencies above 10kHz. Any input on the schematic of the power driver above would be appreciated. I plan on turning it into a PCB, and I'm currently reading up on how to use Eagle CAD.

I think I have achieved this across all 3 Peltiers, and it should work at PWM frequencies above 10kHz.

What is the basis for your confidence in that circuit?

Here is what I get with a quick and dirty LTSpice simulation, modeling the voltage source as a 25kHz square wave, the Peltier as a 1 Ohm resistor, and since no model seems to be available for the DSS60-0045B, a different Schottky diode. The trace is the instantaneous current through the load resistor.

Note: a “regulated” output would be constant current or constant voltage, and would include current or voltage sensors and active components in the feedback/control pathway.

Well then I guess the current isn't regulated, but what about some close approximation without current or voltage sensors? How can this be improved? Increasing the frequency?

I made a model of the circuit on falstad.com which was the basis of my confidence.

I recommend LTSpice, which is optimized for switching circuits. It is free.

Though, your graph is changing at 4ms, shouldn't 25kHz be 0.04ms?

The pulse generator outputs 100 periods at 40 us per period and stops, at 4 ms. The ringing of the LC circuit is evident at start and end.

I don’t know what is in that generic NMOS model.

Here is what I get for the current through the inductor, using the same 1 Ohm resistor and a MOSFET with similar Rds(on) as the one you specified. It shows similar ringing.

If the Peltier device draws 15A at 12V steady state, then its equivalent resistance is 0.8 Ohms.

Very strange, I substituted the generic MOSFET with the one I am using, and I still am getting different results than yours.

EDIT: Nevermind, I see the difference is because of the diode I’m using. I will test this out and see if I can come up with a solution.

Although, if a regular diode as opposed to a Schottky got rid of the ringing, shouldn't I just use that?

It looks like regardless of the diode the configuration would create ringing. The best solution I found to reduce ringing and not need excessive inductors (1mH) is to increase the frequency. If I increase the frequency to 1MHz, reduce capacitance to 4.7uF, then there’s no ringing at all duty cycles.

It is only a model, and the Peltier element is not being modeled correctly in any case. You need a good scope to tell how well the circuit is actually performing.

It is quite instructive to examine the currents through the various elements; far higher than you might suspect, due to the underdamped resonance.

Thanks for the help, I will look at individual components and make sure they aren't doing anything erratic. Once I get a test circuit up I'll use an oscilloscope to see if it works similarly.

Though at 1 MHz I see that the resolution of PWM from the Arduino becomes limited or not really possible. I am thinking that adding a DAC, then using that to control a 1 MHz PWM generator going to the MOSFET driver may be the next move.

Did you work it out? I had a similar question about a Peltier cooling unit and couldn’t figure it out which lead me to this post in hope of finding a solution.