BackYard Chickens › BYC Forum › Raising BackYard Chickens › Incubating & Hatching Eggs › Starting an Arduino DIY incubator project
New Posts  All Forums:Forum Nav:

Starting an Arduino DIY incubator project - Page 3

post #21 of 47

knex (kids toy) has some carousel gears that are about 5" in diameter and maybe a piece of 4 inch pvc drain pipe would be big enough to make a incubator (its can be bent and modeled if heated).

post #22 of 47
Thread Starter 

Update on the relay - without the 110V switching, the relay I picked initially (show in picture) worked fine.  ​Once I plugged in the 110V with the light to use as a heat source, my LCD kept browning out (display goes blank).  After a little research I found that the relay will 1) use too much power, 2) inject noise back into the Arduino leading to the brown-out.  To solve this, I lucked out and had another relay that is opto-isolated and allows me to power the relay separately.  I rigged up an old 5V cell phone charger and the problem seems to be gone!.

Edited by abqchicken - 11/24/15 at 9:46am
post #23 of 47
Thread Starter 

I decided I will try a manual turn incubation first so I will not implement the egg turning (yet).  Here is the code I will use.  I made some modifications to minimize power consumption.  I added a temperature control section to hold the temperature between 99.2 and 99.9 F.  The simple control switched the light too often.  I also added a simple computer fan controlled by Pin 9.


// Incubator code
// ---------------------------------------------
#include <LiquidCrystal.h>
#include "DHT.h"
#define DHTPIN 1                              // Define the temp sensor data pin
#define DHTTYPE DHT22                         // define the temp/hum sensor type
#define RELAY  7                              // define the relay control pin - Pin 7                        
DHT dht(DHTPIN, DHTTYPE);                     //initialize the temp sensor
// LCD Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);    //set up what port the LCD will use
int backLight = 13;                           // pin 13 will control the backlight
int fan = 9;
int is, im, ih, id, ida;                      // variables for time
float time, s1, m1, h1, d1;                   //  Set up variables to calculate time
int ic, ip, ik;
byte thermo[8] = {B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110}; //thermometer icon
byte drop[8] = {B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110}; //drop icon
// byte smile[8] = {B00000, B10001, B00000, B00000, B10001, B01110, B00000}; // smile icon
byte tim[8] = {B00000, B01110, B10101, B10101, B10011, B10001, B01110,}; // clock icon
// done with initial parameters
void setup()
  dht.begin();                                //start the temp sensor
  pinMode(RELAY, OUTPUT);
  pinMode(backLight, OUTPUT);
  pinMode(fan, OUTPUT);
  digitalWrite(backLight, LOW);              // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(20, 4);                           // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                                // start with a blank screen
  lcd.setCursor(0, 0);                        // set cursor to column 0, row 0 (the first row)
  lcd.print("Incubator 1.0");                 // opening line
  lcd.setCursor(0, 1);                        // set cursor to column 0, row 1
  lcd.print("Hatch Them!");
  // Uncomment if you want more text on the 4 line LCD (not used in 2 line LCDs)
  // lcd.setCursor(0,2);                        // set cursor to column 0, row 2
  // lcd.print("Row 3");                        //Text for line 3
  //lcd.setCursor(0,3);                         // set cursor to column 0, row 3
  //lcd.print("Row 4");                         // Text for line 4
  lcd.createChar(0, thermo);
  lcd.createChar(1, drop);
  //  lcd.createChar(2, smile);
  lcd.createChar(3, tim);
//loop to read the sensor and display
void loop() {
  time = millis();                            //  Get time in milliseconds since tunit turn on
  s1 = time / 1000;                           //  Convert time to seconds, minutes, hours, days
  m1 = s1 / 60;
  h1 = m1 / 60;
  d1 = h1 / 24;
  id = int(d1);                               //  Strip out remainder to leave Days:Hours:Minutes:Seconds
  ih = int((d1 - int(d1)) * 24);
  im = int((h1 - int(h1)) * 60);
  is = int((m1 - int(m1)) * 60);
  // Calculate approximate days till hatch (assume 21 days to hatch)
  ida = 21 - id;
  float h = dht.readHumidity();                 // Read the humidity
  float t = dht.readTemperature();              // Read temperature in celsius
  float f = dht.readTemperature(true);          // get the temperature in Fahreheit
  // uncomment to compute heat index in Fahrenheit (the default)
  //float hif = dht.computeHeatIndex(f, h);
  // Compute heat index in Celsius (isFahreheit = false)
  //float hic = dht.computeHeatIndex(t, h, false);
  if (isnan(h) || isnan(t) || isnan(f)) {
    // if sensor can't be read
    lcd.setCursor(0, 0);
    lcd.print("failed to read sensor");
  else {
    //sensor was read succesfully so print values to LCD
    lcd.clear();                                // Clear the LCD
    //Print temperature and humidity in first two lines
    lcd.setCursor(0, 0);
    // lcd.print("Temperature:");
    lcd.print(" ");
    //    lcd.write(byte(0));                       // Write the Thhermometer icon
    lcd.print(" ");
    lcd.print(f, 1);
    lcd.print(" F  ");
    //    lcd.write(byte(1));                         // Write the drop icon
    //    lcd.print("Humidity:");
    lcd.print(" ");
    lcd.print(h, 0);
    lcd.print(" %");
    lcd.setCursor(0, 2);
    lcd.print("  ");
    //  lcd.write(byte(3));
    lcd.print(" ");
    // Print time in format Time: xxd:xxh:xxm:xxs
    //  lcd.setCursor(0, 2);
    //  lcd.print("_-_-_-_-_-_-_-_-_-_-");
    lcd.setCursor(0, 3);
    // Print days left till hatch
    //    lcd.print("Days left:");
    //    lcd.print(" ");
    //    lcd.write(byte(2));
    //Temperature controller
    if (f  < 99.2) {                      //  Set the temperature for the relay to come on (somewhere around 90-101F to get eggs to hatch)
      digitalWrite(RELAY, LOW);          // Turns ON Relay
      digitalWrite(fan, HIGH);
    else if (f > 99.9) {
      digitalWrite(RELAY, HIGH);         // Turns Relay Off
      digitalWrite(fan, LOW);
    // Puase for 2 seconds
post #24 of 47
Thread Starter 


This is the outside of the beast.  I just used a cheap container and lined it with insulation.  On the left I made a small hole to be able to peek in.​

post #25 of 47
Thread Starter 


This is the inside.  You can see the insulation.  In the lower middle you can see the temperature and humidity gauge. The black thing on the lower right is the computer fan (it is right next to a vent hole.  The 50W reptile heat lamp is obviously the glowing red thing.  I also put in a container with water and two rocks.  I found that putting in the rocks gives me some heat capacity to keep the system from cooling too fast and it also helps with the humidity.

post #26 of 47

This is really neat, i've been wanting to do something similar, I'd like to have something that squeezes a water mist bottle to give a bump in humidity when needed rather than rely on evaporation alone.

post #27 of 47
Thread Starter 

you could use a very small cool mist humidifier and a relay to turn it on and off.  The one thing that is challenging is the lag in sensing.  The sensor I have takes around 2 seconds to update and that can be a long time in a small space like in my incubator.

post #28 of 47
Originally Posted by abqchicken View Post

you could use a very small cool mist humidifier and a relay to turn it on and off.  The one thing that is challenging is the lag in sensing.  The sensor I have takes around 2 seconds to update and that can be a long time in a small space like in my incubator.


Shouldn't be a problem to program the mister to run for a short burst then wait 3-5 minutes to check the humidity before deciding if it needs to run again.  I use a separate chamber that holds water and when the humidity drops then air is sent via the chamber to pick up moisture and that works real well with the dht22 sensor.  I am building another one at the moment and im tempted to try the usb 5v mister as ive heard they work (reliability is a little hit and miss but they are cheap)

post #29 of 47
Thread Starter 

The mini humidifier should work well.  I just saw some that screw on to the top of a water bottle and powered by USB.  Could probably just put the water bottle in without the chamber to simplify  The chamber would get rid of the potential of water dropplets.

post #30 of 47
Thread Starter 

On day 3 of my first incubation.  System is working well.

New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Incubating & Hatching Eggs
BackYard Chickens › BYC Forum › Raising BackYard Chickens › Incubating & Hatching Eggs › Starting an Arduino DIY incubator project