Peltier cell controller

Hi all,
I’ll start by saying that I’m not an expert in electronics. For this reason I reproduced the circuit graphically in my figure, instead of using standard symbols, to avoid mistakes in my interpretation.
In my last project I have to control a Peltier cell in order to change temperature from a PC and using scripts from Python in the range 250-380 K.
The use of an Arduino and PID libraries to control the temperature is not problem, neither is the serial communication, I already did that several times.
My main issue here is the hardware and the fact that I have to switch the current in order to either cooling or heating the cell.

For this project I assembled a simple H-bridge circuit using:

  • a 20 V/4 A rated Peltier (water cooled from on one side);
  • two IRF520
  • a DC power supply (0-30 V, 0-5 A);
  • a 4 channels opto-isolated DC Elegoo relay switch
  • a MAX31855 thermocouple

The idea is to control the temperature with one IRF520 for the cooling and the other one for the heating. These are controlled by pin ~9 and ~10 while reading the temperature. Relays (see picture) form two separated circuits (one for the cooling, one for the heating). The code allows only one of the two circuits to be closed/open.
When I work on one circuit (e.g. cooling) the Temp control is accurate, the voltage on the display remains constant to the set value (usually 12 or 15 V), and the current flows according to the PID power output.
Problems start when I have to switch the current above the switching threshold (arbitrarily set to 296 K): a sudden drop in the voltage occurs (note: the 2 circuits are NEVER operating at the same time - I also set a short break during which no current is flowing in the entire circuit) and the current reach the max value allowed (which I decided to cut at 2 A for safety). After few seconds the voltage increases again to the set value and the current reduces but in the meantime the Peltier has overshooted the setpoint by 5-10 °C.
Yes, I’m quite sure this is a hardware problem since even bypassing the PID and forcing low output values doesn’t change the outcome.
Yes, I know that there might be other ways of doing the same circuit (even using only 2 relays), and I also know that PWM is not the most efficient way for controlling a Peltier, but I don’t have the time and experience to work with something more complicated than that.
I’m just trying to understand if I’m doing something wrong in the assembly of the IRF’s and the H-bridge.
Any help is really appreciated!

thank you,
Matt

The IRF520 is not a logic level MOSFET and cannot be fully switched on by 5V.

I can't make sense of the diagram.

Please post a hand drawn circuit diagram with proper symbols, pins and parts labeled, and the code, using code tags.

Thanks for your reply,
As mentioned in my post, Electronics is really not my field, so the attached schematics is probably wrong (the IRF’s here are represented by simple transistors). I hope the other updated figure (with drawing) is more clear. The code is attached too since it was too long.

many thanks,
Matt

PeltierControl_Final.ino (10.8 KB)

You left hand MOSFET is drawn upside down. The source must go the negative supply always for an n-channel
MOSFET.

IRF520's don't work from 5V, they also have too much on-resistance for 4A loads.

Go for MOSFETs rated at 40V or so, 0.02 ohms on resistance or less, and logic-level.

Just use the four relays. You don't need the MOSFETS, and the ones you chose won't work anyway.

Be careful with the order in which you switch the relays so that the power supply is not shorted to ground.

jremington:
Just use the four relays. You don't need the MOSFETS, and the ones you chose won't work anyway.

Be careful with the order in which you switch the relays so that the power supply is not shorted to ground.

Thank you,
How am I supposed to adjust the temperature without the transistors? I don't want to use the Peltier as an ON/OFF device (for that I would probably use SSR's but I would lose in efficiency).

MarkT:
You left hand MOSFET is drawn upside down. The source must go the negative supply always for an n-channel
MOSFET.

IRF520's don't work from 5V, they also have too much on-resistance for 4A loads.

Go for MOSFETs rated at 40V or so, 0.02 ohms on resistance or less, and logic-level.

Thanks for noticing that. As I feared, my schematics are wrong. Please, refer to the drawing which is how the circuit actually looks in reality. I'm powering the IRF520 driver modules (not the MOSFET directly) by 12-15 V DC and I have cut the current from the power supply to a maximum of 2 Amps to avoid overheating. Are you suggesting that above 5 V the IRF520 are not working well?

MatMat86:
Thanks for noticing that. As I feared, my schematics are wrong. Please, refer to the drawing which is how the circuit actually looks in reality. I'm powering the IRF520 driver modules (not the MOSFET directly) by 12-15 V DC and I have cut the current from the power supply to a maximum of 2 Amps to avoid overheating. Are you suggesting that above 5 V the IRF520 are not working well?

What happens to the voltage when you cut the current to a maximum of 2 amps? Remember the Peltier is a series of diodes, each with a voltage requirement to begin conducting current.

Paul

The IRF520 requires about 10V between gate and source to be fully turned on.

Four independent sets of relay contacts give bidirectional on/off control of the Peltier device, which is all you need for a simple temperature controller.

jremington:
The IRF520 requires about 10V between gate and source to be fully turned on.

Four independent sets of relay contacts give bidirectional on/off control of the Peltier device, which is all you need for a simple temperature controller.

Thank you,
so, if I well understood the main problem here is the IRF520 that is not suited for the low +5V of the Arduino, any suggested replacements? I’m not using the ON/OFF system (as I already did for another high-T cell with a filament) since here I need high stability and accuracy at low temperature (study of phase transitions in membranes).

Use a logic level MOSFET, with the lowest Rds(on) (at, say 4V gate to source) you can find. There are many.

I already said what you need:
"Go for MOSFETs rated at 40V or so, 0.02 ohms on resistance or less, and logic-level."