Peltier based Dehumidifier

Hi all. First off sorry if this is in the wrong forum location and please feel free to move it if required.

I am trying to use the Arduino along with a AM2302 humidity sensor to decide when to turn on and off a Peltier unit. With the Peltier on, it will cool an aluminium heatsink to draw water out of the air to reduce the relative humidity of the surrounding air. I am making this to replace an existing controller in my camera dry box which has since stopped working.

I have gotten the Arduino working as I intended it to but I am having problem regulating the power to both the Arduino and the Peltier at the same time. When the Peltier turns "on" the Arduino seems to be starved of power and there is a drop in voltage across the power supply. I need to run both the Peltier and Arduino off one power supply as I cannot have multiple power input into the confined space in the dry box. Can anybody help me and tell me where I went wrong please? The image below is one of the last configuration I have.

Appreciate any help, I am still very new to this.

#include "DHT.h"
#define DHTPIN 9
#define DHTTYPE DHT22
DHT dht22(DHTPIN, DHTTYPE);

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x27
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;
int t;
int Dew;
int h;
int hTarget;
int peltier = 10;
int switchDown = 5;
int switchUp = 6;
int switchBacklight = 11;

boolean switchDownCState = LOW;
boolean switchUpCState = LOW;
boolean switchBacklightCState = LOW;
boolean switchDownLState = LOW;
boolean switchUpLState = LOW;
boolean switchBacklightLState = LOW;
boolean BacklightState = HIGH;

LiquidCrystal_I2C    lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

byte termometru[8] = 
{
    B00100,
    B01010,
    B01010,
    B01110,
    B01110,
    B11111,
    B11111,
    B01110
};

byte picatura[8] = 
{
    B00100,
    B00100,
    B01010,
    B01010,
    B10001,
    B10001,
    B10001,
    B01110,
};

boolean debounce(boolean last, int switchPin)
{
  boolean current = digitalRead(switchPin);
  if (last != current)
  {
    delay(5);
    current = digitalRead(switchPin);
  }
  return current;
}

void setup()
{
  dht22.begin();
 
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
  lcd.setBacklight(HIGH);
  lcd.home (); // go home
  lcd.begin(16, 2);

  lcd.createChar(1,termometru);
  lcd.createChar(2,picatura);

  hTarget = 55;
  pinMode(peltier, OUTPUT);
  pinMode(switchDown, INPUT);
  pinMode(switchUp, INPUT);
  pinMode(switchBacklight, INPUT);
}



void loop()
{
  t = dht22.readTemperature();
  h = dht22.readHumidity();
  Dew = dewPointFast(t, h);

lcd.setCursor(0, 0);
lcd.write(1);
lcd.setCursor(2, 0);
lcd.print(t);
lcd.setCursor(4, 0);
lcd.print((char)0xDF);
lcd.print("C");
lcd.setCursor(7, 0);
lcd.write(2);
lcd.setCursor(9, 0);
lcd.print(h);
lcd.setCursor(11, 0);
lcd.print("%");

if (h > hTarget)
{
  lcd.setCursor(13, 0);
  lcd.print("ON ");
  digitalWrite(peltier, HIGH);
}
else
{ 
  lcd.setCursor(13, 0);
  lcd.print("OFF");
  digitalWrite(peltier, LOW);
}

lcd.setCursor(0, 1);
lcd.print("Set for: ");
lcd.setCursor(9, 1);
lcd.print(hTarget);
lcd.setCursor(11, 1);
lcd.print("%");

  switchDownCState = debounce(switchDownLState, switchDown);
  if (switchDownLState == LOW && switchDownCState == HIGH && hTarget > 25)
  {
    hTarget=hTarget-1;
  }
  switchDownLState = switchDownCState;


  switchUpCState = debounce(switchUpLState, switchUp);
  if (switchUpLState == LOW && switchUpCState == HIGH && hTarget < 90)
  {
    hTarget=hTarget+1;
  }
  switchUpLState = switchUpCState;

  switchBacklightCState = debounce(switchBacklightLState, switchBacklight);
  if (switchBacklightLState == LOW && switchBacklightCState == HIGH)
  {
    if (BacklightState == LOW)
    {
      lcd.setBacklight(HIGH);
      lcd.display();
      BacklightState = HIGH;
      delay(1000);
    }
    if (BacklightState == HIGH && digitalRead(switchBacklight) == HIGH)
    {
      lcd.setBacklight(LOW);
      lcd.noDisplay();
      BacklightState = LOW;
    }    
  }
  switchBacklightLState = switchBacklightCState;
  
}

Dehumidifier 20160726.1330.zip (48.4 KB)

Power supply is too small.
That peltier is rated at 7A @ 4.5 V.
Your power supply is only rated at 3A.

Hi Maurice, thanks for the reply. I actually do not want to run the Peltier at full tilt to minimise power consumption, hence why I am not using a massive power supply.

I actually do not want to run the Peltier at full tilt

The Peltier will attempt to draw the amount of current determined by the power supply voltage and the Peltier internal resistance, which promptly overloads the power supply.

You cannot control the current using PWM. A series resistor can be used to limit the Peltier current, but this just wastes power.

Peltiers are very inefficient in cooling mode having COPs of as low as 0.3 .
Have you calculated the cooling power needed to cool the air below its dew point so that
the water vapor in the air will condense?

For an fascinating read, check out this Peltier, solar powered, self filling water bottle scam on IndieGoGo.

Then see it hilariously debunked by Dave Jones.

Model: TEC1-04905
Rated Voltage: 5V DC
Max. Current: 5A
Max. Temperature Difference: 67 deg C
Max. Voltage: 6.2V
Max. Refrigerating Power: 19.4W

Referencing wikipedia, with my local average air temperature of 30C or so, I need to achieve a surface temperature of 15C to draw water out of the air.

Refering to jremington's comments, my thoughts then is to either:

  1. Run a small resistor to reduce the voltage across the Peltier and thus the current
  2. Get a different Peltier which will draw less current at 5v

Thoughts?

What relative humidity are you trying to achieve?

CocoMonGo:
Refering to jremington's comments, my thoughts then is to either:

  1. Run a small resistor to reduce the voltage across the Peltier and thus the current
  2. Get a different Peltier which will draw less current at 5v

Use a switching regulator to reduce the voltage (and thus current) provided to the peltier.