Electronic – arduino – How to set a positive and negative current from arduino

arduinocurrent

I'm designing a PID temperature controller for a laser diode with arduino. The laser gives me the value of its temperature, which I compare with my reference and then, through the controller implemented in arduino, I'll obtain the proper output values in volts.

The way the laser increases or decreases the temperature is by a peltier cell. So applying a current through this cell it will change it (to the correct value if the PID is set-up properly).

The thing is that the current has to be positive or negative, depending on if we want to heat the laser up or cool it down. I don't know how could I get those currents from the voltage values obtained in arduino.

Best Answer

Use something known as a H bridge. That's basically two positive only outputs. You connect the device between them. Let's say each output can drive between 0 and 10 V. The voltage between the two outputs can then vary ±10 V.

This only works if both sides of the device to be powered can float relative to ground. However, that is probably the case for your Peltier. Check the datasheet of the laser module to make sure both lines can float arbitrarily relative to the other connections.

A Peltier is one device that should NOT be run with pulses. However, pulses are the easiest and most efficient way for the power drive system to work. The solution is to add some filtering between the raw H bridge outputs and the Peltier. These would usually take the form of a series inductor followed by a capacitor to ground on each of the two outputs. Another way to look at this is that you're making a switching power supply to run the Peltier from.

I go into more details on driving Peltiers at https://electronics.stackexchange.com/a/28637/4512 and https://electronics.stackexchange.com/a/118543/4512.

Related Topic