Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Temperature control circuit for a complete beginner...

Status
Not open for further replies.

Agent57

New Member
Hi folks,

I have no electronics experience but I'm hoping that someone can point me in the right direction here.

My problem is that I have a cabinet in which I need to maintain a reasonably constant temperature, between about 25 and 30 degrees Celsius. I've been searching the web for a ready made solution without any luck and then came up with the following crazy idea.

My plan is to use a peltier, sandwiched between two heat sinks. One of the heat sinks will be fitted into a casing so that a couple of fans can vent either warm or cold air into the cabinet whenever the internal temperature goes either side of the desired range. The other heat sink would be kept external with another fan attached to regulate the unit's temperature on the outside of the cabinet.

I've no idea whether this will actually do the job, but I don't have any better ideas at the moment, and where I'm really struggling right now is the design of the control circuit.

So, I've been looking into building a circuit using a thermistor, with a couple of potentiometers to adjust the min/max temperature limits, such that if the cabinet gets too warm the peltier will be powered with +/- set in one direction to cool the air flowing in, or if it drops too low then the polarity on the peltier power supply should be reversed so that the airflow is then being heated.

Looking on the web I found a page with these images that show a simple example of how to use a transistor to switch on an LED for when a light sensor is activated or alternatively when it is deactivated.

View attachment 66487

From these I've been trying to figure out how to modify this layout with the light sensor replaced by my thermistor but both options merged into a single circuit and, where the LED is, that would become the relevant hot or cold power supply feed for the peltier.

If anyone knows of a ready made unit I can use then I'd happily go for that. Otherwise I would very much appreciate someone (with a lot of patience) walking me through how to go about making some sort of progress on this project.

Thanks.
 
Last edited:
It should work if the cabinet is not to large and is somewhat insulated.
What you need is an H-Bridge to reverse the polarity to the peliter and a window comparitor to set it to hot, cold or off.
I'm going on vacation so I hesitate to start on it, but maybe this idea will get you or some others going.
 
@tronitech - Thankyou for the link. Although the page you posted wasn't exactly what I was looking for, it did lead me to **broken link removed** on the same site which has inspired me to create an initial simple layout using Falstad's Circuit Simulator applet which has helped massively in my basic understanding.

I still need to figure out how to extend the design to drive both a heating and a cooling circuit, but it feels like I've made some good progress.


@ronv - Thank you as well for the advice on H-Bridge and Window Comparitor. I have no idea as yet what they are but at least I now have some good search terms to assist in my learning.
 
any help or not BUT

I just finished a BEER COOLER THERMOSTAT that uses an LCD, PIC and DS18B20 sensor.
Sensor is accurate to 1/2 celius.
The pic program can be programmed to most any temperature.
It has a pot for desired temp & defrost temp.
Could be configured for your app every easy.
If interested I could fabricate a board and program the pic.
 
Hi MrDEB, I've just had a look at your Beer Cooler project thread, looks great! I see that you got the board finished just a couple of days ago, so do you have the cooler up and running and how's it doing?

Thank you for the generous offer of helping out with the construction of a unit suitable for my project. The only problems I see with that are that I am in the UK and my current status as an unemployed Software Engineer means that money is rather tight, and I wouldn't want to put you to that sort of hassle without being able to compensate you for your effort.

As I am a programmer, I was seriously tempted to go down a similar path as you. Although I have no experience of coding on a chip, I'm sure I could figure it out. What was putting me off most though was that I have none of the tools that would be necessary, and thought it would probably end up becoming far more expensive than I'd like for what may well be my one and only experimental home built electronics project.
 
Okay, I think I've managed to get my head around how to layout the circuit I need and running the circuit simulation it appears to do what I want. P1 is the control for setting the minimum temperature to trigger the heater circuit and P2 kicks in the cooler. TH1 is meant to be the thermistor but the simulation applet doesn't provide that as a component.

I'd very much appreciate some feedback on the circuit as I don't have much of a clue whether I'm heading in the right direction or not. The actual values for the components shown in the diagram are still kind of a mystery to me. How do I go about working out what resistors, capacitors and everything else will make this thing work in reality?

View attachment 66541
 
Last edited:
A KISS approach is to use this circuit **broken link removed** but use a DPDT relay. When the heat is on the N/C relay contacts are closed. When cooling is required then the N/O contacts are closed or visa versa.
 
Also look at using a ULN2803 instead of the transistors you have in your schematic.
 
Hi MrDEB,

Thanks for your comments, they're very much appreciated.

The schematic you linked was actually my starting point. I've expanded on that to allow independent control of the temperature settings for when cooling and heating are switched on as I only need heating if the temp drops bellow about 25°C and cooling if it rises above 30°C. Between that range I'll just have the fans circulating the outside air through my cabinet at whatever the ambient temperature is and the peltier can have a bit of time off.

I've made some adjustments to my circuit design, adding a couple of resistors (R8 & R9) to limit the upper and lower temp settings on either side to prevent any overlap and the risk of powering on both relays simultaneously, which would obviously be bad news! I've also popped in a couple of clamping diodes across the relays to prevent EMF as the relays switch off, which was something I read about somewhere along the way. If there are any other alterations I should do for circuit protection, simplification or whatever else then I'd appreciate any more feedback I can get.

This is the layout as it is right now...
View attachment 66559


As far as specific details about the components go, I have a box of bits with most of what I think I need, but I don't really have much confidence in 'what I think'. If any of these parts are blatantly not suitable for what I'm doing then please let me know.

* The sensor is a 4K7 bead thermistor with a B(°K) of 3977, which gave me the values for R8 & R9
* The OpAmps are LM741 chips
* I have a couple of DPDT relays (N04AW 1A/12Vdc)
* The transistors I already have available are BC108 and BC548. Are either of these good for what I need or should I go and get the ULN2803 as suggested, and what's the difference?
* The peltier I was looking at is **broken link removed** or maybe the 100W version **broken link removed**

The other thing I'm not certain about yet is power supply. I have plenty of old 12Vdc PSUs laying about and was hoping one of them could be recycled. Is there anything I need to be careful of when selecting a suitable unit?

Sorry if these seem like silly questions but thanks again for all the help!
 
Last edited:
The ULN 2803 will handle up to 500ma and no complicated math to compute base resistors etc.
 
Maybe I misunderstand, but isn't that the same as for the BC548?

I tried to lookup ULN2803 on the Maplin's website to see if I could get one at the local branch but it came up blank, so I figure if what I have already will work...?
 
Those relays can only switch 1A max. That won't be enough for heating or cooling.
If the relay coils are rated 12V then you don't need R3, R6.
The 741 output can't swing as high as the supply voltage (12V) so you may have difficulty using it as a high-side driver for a 12V relay.
The 10k resistors at the opamp outputs will restrict the transistor base current too much for driving relays.
 
Thanks for your comments alec_t,

Those relays can only switch 1A max. That won't be enough for heating or cooling.
I had been wondering if that was the case earlier today, when I was looking at the info on the peltier and noticed it draws 6A, so I'm glad you picked me up on that before I asked another silly question! I was looking at these 10A relays, and I'm hoping they're the right ones for the job?

If the relay coils are rated 12V then you don't need R3, R6.
Okay fair enough, R3 & R6 are gone. They sort of crept into the design while I've been playing around on the simulator. Should I go for 12V relays or the 6V version? I'm planning on using an old ATX PSU for running everything, if that makes any difference?

The 741 output can't swing as high as the supply voltage (12V) so you may have difficulty using it as a high-side driver for a 12V relay.
Please keep in mind that you are talking to an idiot as far as electronics goes and my web-based learning program hasn't quite got as far as the detailed workings of a 741. I was initially working from this schematic and had just gone along with the 741 as a safe bet. Can you tell me what I should be doing instead? Alternatively, would the 741 opamps be suitable if I had the 6V relays rather than the 12V?

The 10k resistors at the opamp outputs will restrict the transistor base current too much for driving relays.
There's another example of the design randomly evolving while I've been playing around on the simulator. The schematic I was working from has them as 1K resistors. Is that what I want or are the resistors not really required at all?

I don't really know what any of the resistor values should realistically be or how to go about trying to figure them out mathematically. The components, and their specifications, that I have at present are just from trial & many errors.
 
Personally I'd go for 12V as its coil current is less; but I'd drive it low-side like this

View attachment 66600

Okay, now I get the significance of what you said previously about not using the 741 as a 'high-side' driver. It hadn't clicked that it made any difference which side of the transistor I place the relay :eek:


After a bit more playing about with my simulation, does this make more sense now?

View attachment 66604

I don't have it added on my schematic yet, but just wondering what the significance (and suggested value) is for R2 on the layout you posted?
 
Last edited:
That's looking more like it. I meant to mention that DPDT (aka DPCO) relays would be needed for reversing the Peltier polarity, but I see you've now incorporated them. What are the P1, P2 values?
R2 is to help turn off the transistor, because most op-amps can't pull their output right down to ground. I'd suggest ~ 10k. R1 should be such that the transistor base current is ~ 1/10 of the collector (coil) current (that's the usual rule-of-thumb for bipolar switching transistors).
BTW, I'm a great fan of re-purposing. Using an old ATX supply looks a good bet if its output suits the Peltier device (of which I have no practical experience).
 
Cheers Alec,

I'm glad you brought up the point about DPDT relays there! The 1A relays I had already are DPDT but the others I linked earlier are only single pole, which I'd missed at the time.

The values I have on my P1 and P2 are 5K and 2K5. I actually need to adjust my schematic to match these and reduce my R9 value to 1.7kΩ. My thinking here is that my thermistor is rated 4K7 at 25°C with a B(°K) of 3977, so a resistance range of 4.7kΩ - 9.7kΩ on the P1/R3 side equates to a low temperature setting from 25°C down to about 10°C. On the P2/R9 side, with a resistance range of 1.7kΩ - 4.2kΩ, I'll have a high temperature setting from 50°C down to 27°C. I don't need such a wide range on P2 and could go get myself a 1K pot but as I already have the 2.5K amongst my box of assorted bits, and I'll be the only one that adjusts it, I figure that'll do.

Thanks for explaining the R1 & R2 values, I'll update my design to take these into account.

/edit
Updated simulation and schematic

View attachment 66611

The R6 & R8 value of 1.5kΩ is based on a **broken link removed** that has a 160Ω coil resistance, giving an Ic of 75mA and Ib of 7.5mA. Hopefully I've got that right :)
 
Last edited:
If your thermistor resistor is only 4k7 I think R7 needs to be reduced to a similar value, otherwise the opamp inputs are working very close to +12V. Again, not all opamps can manage that. It would be better if the inputs were ~ half the + rail voltage (that's the norm). That will mean re-calculating R1, R4.
A smoothing cap across R7 would help to guard against interference.
Also, you may need a bit of positive-feedback around each opamp to prevent jitter arising from any interference on the inputs.
BTW, the 741 is a very oudated IC. There are many better (lower offset, lower quiescent current, lower noise etc) ones available nowadays. Whatever you end up using, make sure it is specified as rail-to-rail output.
 
Thanks again for your excellent support Alec!

I've been hacking my circuit in an attempt to implement your suggestions and through some experimentation on my simulation I now have the following schematic

View attachment 66640

Based on various web pages I found, I've added positive feedback loops on the opamps with a heavy resistor and diode on each.

To reduce the opamp input voltages I've adjusted the values on R7, R3 and R9, and also added R14. In the simulation I've balanced these to switch the heating circuit on below 23°C and turn it off again above 25°C with P1 set at it's highest, while the cooler circuit switches on above 32°C and goes off below 25°C with P2 set at it's lowest. I may do a bit more fine tuning but that's already pretty close to the specs I need.

I've dropped in the 1μF capacitor around R7 but I don't have a clue whether that's appropriate? Would you mind clarifying for me what the interference is that I'm trying to smooth out here and where it comes from? I'm also wondering if I'll need to do the same around R14?

On the use of 741 opamps as a comparitor, I get what you're saying about there being better options but I'm on a very tight budget so I'd prefer to minimise additional cost unless these chips are likely to give me problems?
 
Status
Not open for further replies.

Latest threads

Back
Top