GithubHelp home page GithubHelp logo

lefterisgar / egg-incubator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quantenschaum/egg-incubator

0.0 0.0 0.0 9.25 MB

adruino controlled incubator for chicken eggs

Home Page: https://www.youtube.com/channel/UCHZOLrGnO4VxRvOvBJN7kVQ

License: GNU General Public License v3.0

C++ 100.00%

egg-incubator's Introduction

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.

Ziegler-Nichols does very well for this machine.

Set the the I and D coefficients to 0 and increase the P gain until the controlled values starts oscillating. You can monitor them using the Adruino Plotter. To this ultimate gain apply Ziegler-Nichols formulas to get the P, I and D coefficients.

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

egg-incubator's People

Contributors

quantenschaum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.