quantenschaum / egg-incubator

adruino controlled incubator for chicken eggs
https://create.arduino.cc/projecthub/quantenschaum/egg-incubator-ef0cf6
GNU General Public License v3.0
50 stars 35 forks source link

Egg Incubator

Is an arduino controlled incubator for chicken's eggs. It's purpose is to keep temperature and humidity at defined values, so that the eggs are incubated and the chicks finally hatch after some days.

It might as well be used to incubate other things than chicken's egg like other kinds of eggs (ducks, turtles, alligators, ...), or cultures of bacteria or fungus i.e. to make yoghurt or to leaven yeast/sour dough or to make Tempeh.

Incubation Conditions

Chicken's eggs are incubated for 21 days under temperature and humidity conditions as shown in the table.

Day Temperature [°C] Humidity [%]
1-17 37.8 55-50
18-19 37.5 55-60
20-21 37.5 70

Turn the eggs 3 times per day on days 3-17.

The eggs are checked by "x-raying" them with a flashlight on day 7 and 15 (german schieren). Dead or unfertilized eggs are sorted out.

How it works

The arduino constantly measures temperature and humidity. The raw measurements are smoothed using Holt-Winters double exponential smoothing. The smoothed values are then fed into a PID control loop.

Temperature control

The temperature is maintained by turning the heating element on and off in a 2 seconds cycle. The duty cycle of the heater is determined by the temperature PID loop. Using a low frequency pulse width modulation turns a bang-bang controlled heating element into a fully modulated element.

As heating element I highly recommed Kanthal wire (used for styrofoam cutting). 10-15 watts are enough! This is much better than a light bulb. It can be operated with low voltage (safer than 220V bulb), does not emit light and does not burn out. Use a MOSFET to turn it on and off (no heatsink needed due to PWM and no clicking and wearing of a relay).

Humidity control

The humidity is maintained by opening and closing an air vent on the incubator using a servo. The servo angle is determined by the humidity PID loop. Inside the incubator is a water filled jar. The water warms up and evaporates, the humidity rises, the vent is opened and the humid air can escape letting dryer air in. The air vent is also needed also to allow fresh air and oxygen to get into the incubator. You have to experiment with the size (water surface) of the jar to reach the humidty setpoint and have the air vent (half) open.

Fan monitoring

The fan does not need to be controlled, it is constantly running and distributes heat and humidity equally in the incubator. I used a 12cm 12V PC fan operated at 5V, so it runs slowly. The Arduino monitors the fan using it's rpm signal and sets of an alarm if it fails. The fan also cools the heating wire, the heating is turned off, if the fan fails.

Usage

Using the select button, you can cycle through the different modes of the display.

The first line always displays currently measured values or an alarm message. The second line displays information depending on the selected display mode. To silent the alarm, press any button (select).

  1. display current T/H values
  2. temperature setpoint, change with up/down left/right
  3. humidity setpoint, change with up/down, right changes humidity control mode, on = control air vent, off = humidity regulation and alarm turned off, auto = control air vent if humidity error greater 3% to avoid constant noise from the servo
  4. average temperature and standard deviation
  5. average humidity and standard deviation
  6. average heater dutycycle and current heater power (0-1)
  7. air vent state (0-1) and fan speed
  8. uptime

Changed values are stored permanently in the EEPROM.

Setting it up

Parts

Wiring

Have a look into the code for the pin numers, starting at line 10.

The LCD uses the pins 8, 9, 4, 5, 6, 7 and 10 for the background light and A0 for the input keys.

The fan tacho signal is connected to pin 2 and it is powered with 5V from the 7805 regulator.

The heating wire is powered with 12V, the MOSFET is used as switch with it's gate on pin A1.

The DHT22 T/H probe has it's data pin connected on pin 3, a 10k pullup resistor might be neccessary.

The air vent servo is connected to pin 11.

The buzzer is connected between ground and A2.

schematic

PID tuning

The PID coefficients in the code are those I used in my setup. They are probably not appropiate for you setup. You have to tune them.

Calibration

There is a T_OFFSET in line 11. Set it to 0 and let the system get into a stable state (standard deviation of temperature < 0.5 and decreasing). Now drop a mercury fever thermometer into the incubator and let it settle for a couple of minutes. Compare the temperatures measured by the incubator and measured by the fever thermometer and calculate the offset.

Use a mercury fever thermometer because it cheap, more accurate than an electronic one and it comes calibrated because it's a medical device meant to be used on humans. Be aware the it is a maximum thermometer.

How does it look like?

control unit

Arduino with LCD shield, below 5V regulator with heatsink and the MOSFET

air vent

air vent made from clear plastic, the servo turns the disk of the vent to open/close it

heater and sensor

fan with heating wire in the back, T/H on the left

heater close up

close up of fan with heating wire

Hatching Chicks

hatching chicks

hatching chicks