Digital controller for incubator (eng. post)

Finally, I’ve just finished my new device!
The firmware and hardware tested. And I can introduce this open-hardware project in my blog.

SAM_4961

1. What is it
This device is complete digital control board for incubator (hatchery). It consists of digital temperature regulator with smooth control of heater power (not just on/off, but dimming in percentages). And also it has a timer for eggs auto rotation. The device is based on cheap 32-bit Cortex M0 microcontroller STM32F030F4P6 from ST.

Features:
– digital thermometer based on classical DS18B20 with possibility of manual adjustment of calibrating coefficients,
– digitally controlled output power of heater (triac dimmer),
– PI-controller with autotuning,
– beeper for temperature sensor or heater malfunction,
– all parameter are stored in EEPROM,
– easy firmware upgrade (via UART)

2. Circuits

(all clickable)

Control board:
Incub_control

Power board:
Incub_power

The power board has almost one layer. The control board is 2-layered, bottom layer is GND.

You can download circuits and PCB drawings in PDF format.

3. Sources
Firmware project [for Keil MDK-ARM] and circuit [Eagle] in Github

4. How to download firmware
– Download firmware hex image
– Download and install STM32 Flash loader demonstrator.
– Make following circuit (this is just two inverters between RS-232 port and microcontroller)

RS-232
– Insert temporary the JP1 “Bootloader” jumper at control board
– Download firmware using Floash loader ( here is tutorial )

5. How to use.
Please watch demonstration video.

The menu items:

Group Basic — base user configuration
– Temp.ref — temperature reference setpoint;
– Rot.int — the eggs auto-rotation interval (minutes);
– Rot.dur — time interval during which the rotation mechanism is on (high level at pin PA10), in seconds;

Group Advancd – advanced settings
– T. Ofst and T. Gain — temperature sensor calibration coefficients ([result] = “T. Gain” * [data from sensor] + “T. Ofst”);
– PID K_P and PID K_I — PI controller coefficients;
– PID Auto — start / stop automatic PI controller tuning

Buttons (from the left)
1 — Enter menu, return from the menu;
2 — Start of selected parameter modification, or selecting the digit in numeric parameter for modification;
3 — Increment the selected digit, or changing the parameter to opposite state.

How to perform automatic tuning. It is necessary initial to setup the temperature setpoint to very low temperature (ex, 10 degrees C) — so that the heater was permanently turned off. After this, if temperature in incubator is stable, then go to the menu “PID Auto” by pressing buttons 2 and 3 to enable the automatic tuning mode. This will display the temperature and the heater will turn on full power. (Please make sure that there is no eggs inside). As soon as the temperature stabilized at some point and does not change with time (you have to wait), press button 3. It will display the message “ok” or “failed”, depending on the result of auto-tuning. It is strongly recommended to to check via menu the values of PID K_P and PID K_I parameters.

There is video automatic tuning and temperature regulation with coefficients after auto-tuning.

Feel free to ask questions in comments.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s