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!