Peltier Cooling and Heating with Arduino

Cooling with Peltier

I used a Peltier fan heat sink unit sold by Adafruit for this work. Small plate connected to this Peltier unit cools to a really low temperature of -7 deg C almost instantly due to its small size. I used Arduino UNO with N-channel MOSFET to control the Peltier unit. Program and Arduino circuit used came from this work on garagelab.com.

N-Chnnel MOSFET
Peltier with fan heat sink unit

Heating and Cooling a Peltier

I was working with a friend to explore option of simultaneous heating and cooling for neonatal care in India (http://www.palav.org/). I could not find easily an option for simultaneous heating and cooling with Peltier. There are many posts for cooling control. Several people mentioned using H bridge for reversing currents on Arduino forums. Still it was difficult to find which one will work with Peltier unit that I have. This is just an attempt to know that it is possible to use H bridge for this purposes. It gives precise control over temperature required with both heating and cooling. Ultimately I found it is possible but costly option for amount of heating and cooling required.

For simultaneous heating and cooling H-bridge is needed. I used Pololu simple high power motor controller for this work and used sample program from Pololu with Arduino. Software serial library is also needed with this, which is available on Arduino website. Change input to setMotorSpeed from -3200 to 3200 to control the cooling and heating respectively. This works great for the Peltier fan heat sink unit.

Connecting Pololu is easy with image from the H-bridge user guide.

Connect Arduino digital pin 4 to Simple Motor Controller RX and Arduino GND to Simple Motor Controller GND.

#include 
#define rxPin 3  // pin 3 connects to smcSerial TX  
#define txPin 4  // pin 4 connects to smcSerial RX
SoftwareSerial smcSerial = SoftwareSerial(rxPin, txPin);
 
// required to allow motors to move
// must be called when controller restarts and after any error
void exitSafeStart()
{
  smcSerial.write(0x83);
}
 
// speed should be a number from -3200 to 3200
void setMotorSpeed(int speed)
{
  if (speed < 0)   
{     
smcSerial.write(0x86);  // motor reverse command     
speed = -speed;  // make speed positive   
}   
  else   
{     
smcSerial.write(0x85);  // motor forward command   
} 
  
smcSerial.write(speed & 0x1F);   
smcSerial.write(speed >> 5);
}
 
void setup()
{
  // initialize software serial object with baud rate of 19.2 kbps
  smcSerial.begin(19200);
 
 // the Simple Motor Controller must be running for at least 1 ms
 // before we try to send serial data, so we delay here for 5 ms
 delay(5);
 
 // if the Simple Motor Controller has automatic baud detection
 // enabled, we first need to send it the byte 0xAA (170 in decimal)
 // so that it can learn the baud rate

 smcSerial.write(0xAA);  // send baud-indicator byte
 
 // next we need to send the Exit Safe Start command, which
 // clears the safe-start violation and lets the motor run
 exitSafeStart();  // clear the safe-start violation and let the motor run
}
 
void loop()
{
 setMotorSpeed(-2800);  // full-speed forward
 delay(10000);
 // setMotorSpeed(3200);  // full-speed reverse 
 // delay(1000);
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s