User Tools

Site Tools



Incubator is mqopen-firmware modification originally developed for temperature and humidity control of cockroach colony nest. It is designed to read data from connected sensor and control heater and fan to keep stable environment condition in the nest.


Heater is controlled by two relays in series. Their are doubled to increase reliability. For more info read relays. Power supply for heater is completely isolated circuit.

Fan is used to prevent too high humidity in the colony. It is controlled by N-Channel MOSFET.

Incubator can be configured for other purposes. For example controlling a light.


  • Configure target temperature.
  • Configure hysteresis.
  • Support alarm.
  • Disable alarm after incubator is first powered on (while heating up).
    • Configure delay for this alarm suppression (15 minutes by default).
  • Humidity control (fan, water nozzles).
  • Physical device identification. Make it beep/blink based on MQTT message.


Incubator has couple of LEDs to notify user about its activity or state. Most of them can't be controlled independently.

  • PWR - On when incubator is powered on.
  • ACT - On when incubator is connected to MQTT broker. Blinks when sending packets. Controlled from the software.
  • RELAY - On when RELAY_NO is closed (and RELAY_NC is opened).
  • FAN - On when FAN is on.
  • ALARM - On when ALARM buzzer is on.

Configuring hysteresis

To configure an incubator, you have to specify target temperature and hysteresis.

Target temperature is value which should not be exceeded by heaters. When heaters are on, target temperature defines at which temperature the should be turned off.

Hysteresis value specifies a point of temperature which should not be exceeded while incubator cools down. It must be positive value and also should not be a zero. Incubator turns heaters on when its temperature drops under target temperature minus hysteresis value.

Process is described on the graph below.



Relation of different incubator parts and ESP8266 GPIOs.

  • Sensor - GPIO13, GPIO14
  • Relay - GPIO12
  • Buzzer - GPIO5
  • Fan - GPIO4
  • Notification LED - GPIO16

RJ-11 connector

Incubator has single RJ-11 connector for connecting various sensors labeled as SENSOR_CONN.

RJ-11 pinout


  • 1 - RXD0
  • 2 - GND
  • 3 - GPIO13
  • 4 - GPIO14
  • 5 - 3V3
  • 6 - TXD0

It is possible to solder pull-up resistors on pins 3 (GPIO13, R5 on the PCB) and 4 (GPIO14, R6 on the PCB). It is also possible to solder decoupling capacitor on pin 5 (3v3, C2 on the PCB).

Pins 1 (RX0) and 6 (TX0) are used for debugging purposes only. The should not be connected to sensor in real incubator application.


Incubator can have two relays for ensure better reliability. Relays are connected in inverted logic to each other - one is normally opened, other is normally closed.

They are referred by following names:

  • RELAY_NO - When heater is OFF, relay is opened (current doesn't flow through its coil).
  • RELAY_NC - When heater is OFF, relay is closed (current flows through its coil).

When GPIO is LOW

  • Q1 is in “OFF” state. RELAY_NO is open, RELAY_LED is off.
  • Q2 is in “OFF” state, voltage is applied at the gate of Q2. Q2 is in “ON” state. RELAY_NC is closed.


  • Q1 is in “ON” state. RELAY_NO is closed, RELAY_LED is on.
  • Q2 is in “ON” state, no voltage is present at the gate of Q2. Q2 is in “OFF” state. RELAY_NC is opened.

If both relays are populated on the PCB, there can be three states of their actual state.

Heater is OFF

If heater is OFF, RELAY_NO is opened and RELAY_NC is closed. Electrical circuit is disconnected in two points. RELAY_NO is draining electrical current.

Heater is ON

If heater is ON, RELAY_NO is closed and RELAY_NC is opened. RELAY_NC is draining electrical current.

Incubator is powered off

When incubator is powered off, RELAY_NC is in closed state, because there is no electrical current which will normally keeps it opened. Heater power supply circuit is disconnected only in one point.

Warning: If RELAY_NO has failure, incubator will still heats up. Because control electronics is powered off, it can't detect any errors and warn user. This can be fatal to animals in the incubator.

However, relay failure is considered as really rare state. Also having incubator electronic powered off while main power supply is still on is also considered as rare event. So statically it is nearly impossible to kill animals by overheating them.

Using single relay

Incubator can be used with RELAY_NC not populated. In this case, you can also omit populating these components:

  • R13, R14, R15
  • T6, T7
  • D3

Also, you must solder wire at RELAY_NC position to allow current flow through.

FIXME Image!


Incubator has FAN output screw terminal, intended for driving 12V computer fan. It is designed to control air flow in the incubator.

It is driven using P-Channel MOSFET. While motor fan is off, its winding isn't “hot”.

Screw terminal supplies voltage equals to input voltage at PWRJACK.



There are panelized two incubator PCBs on single board. If you order it from, you will get material for 20 incubators.

You can download PCB source files at GitHub.


  • 1900 mils x 3610 mils / 48.26 mm x 91.694 mm


Bill of Materials

Part Pcs (a) Pcs (b) Value Package Comment
ESP8266 module 1 1 ESP8266 ESP-12 Or other ESP board with same pinout.
Power supply module 1 1 22x17mm Power supply module.
Electrolytic capacitor 1 1 1000nF 8x12mm Power supply filtering capacitor.
Resistor 4 4 10K 0805 ESP8266 pull-up resistors.
Capacitor 1 1 100nF 0805 ESP8266 decoupling capacitor.
Resistor 1 1 10K 0805 GPIO15 pull-down resistor.
LED 1 1 Red 1206 Activity LED.
Resistor 1 1 82R 0805 Activity LED current limiting resistor.
Button 1 1 B3F-1020 6x6x5mm Reset button.
Resistor 1 1 470R 0805 Reset button resistor.
Pin header 2x3 1 1 2×3 2.54mm ISP programmer.
Button 1 1 B3F-1020 6x6x5mm Programming button.
Resistor 1 1 470R 0805 Programming button resistor.
NPN transistor 2 2 S5080 SOT-23 Programming reset transistors.
Resistor 2 2 10K 0805 Current limiting resistors.
Pin header 1x3 1 1 1×3 2.54mm ISPPWR jumper.
N-Channel MOSFET 1 1 BSS138L SOT-23 FAN N-Channel MOSFET.
P-Channel MOSFET 1 1 IRF9540 TO-220 FAN P-Channel Power MOSFET.
Resistor 2 2 10K 0805 FAN circuit resistors.
Resistor 2 2 100R 0805 FAN circuit resistors.
Diode 1 1 1N4007 DO-214 FAN protecting diode.
Capacitor 1 1 100nF 0805 Fan decoupling capacitor .
LED 1 1 Red 1206 FAN LED.
Resistor 1 1 1K 0805 FAN LED current limiting resistor.
Screw terminal 5 mm 1 1 KF301-2P 5mm Fan screw terminal.
N-Channel MOSFET 3 1 BSS138L SOT-23 Relay MOSFETs.
Resistor 2 1 10K 0805 Relay circuit resistors.
Resistor 3 1 100R 0805 Relay circuit resistors.
Screw terminal 5 mm 1 1 KF301-2P 5mm Relay input screw terminal.
Screw terminal 5 mm 2 2 KF301-2P 5mm Relay output screw terminals.
Switching diode 1 2 LL4148 1206 Relay diode.
Relay 1 2 SRD-3VDC-SL-C 19.1×15.5mm Relay.
LED 1 1 Red 1206 Relay LED.
Resistor 1 1 1K 0805 Relay LED current limiting resistor.
Buzzer 1 1 SD1209T3-A1 12mm Alarm buzzer.
N-Channel MOSFET 1 1 BSS138L SOT-23 Alarm MOSFETs.
Resistor 1 1 10K 0805 Alarm circuit resistors.
Resistor 1 1 100R 0805 Alarm circuit resistors.
LED 1 1 Red 1206 Alarm LED.
Resistor 1 1 1K 0805 Alarm LED current limiting resistor.
RJ-11 socket 1 1 6P6C Sensor socket.
Resistor 2 2 10K 0805 RJ-11 pull-up resistors.
Capacitor 1 1 100nF 0805 RJ-11 decoupling capacitor.
Pin header 1x1 4 4 1×1 2.54mm Power supply module mount.
Pin header 1x2 1 1 1×2 2.54mm PWR jumper.
LED 1 1 Red 1206 Power LED.
Resistor 1 1 1K 0805 Power LED current limiting resistor.
Power supply connector 1 1 5.5×2.1mm Power supply jack.

Resistor summary

Value Package Pcs (a) Pcs (b)
10K 0805
100R 0805
120K 0805
82R 0805

Capacitor summary

Value Package Pcs (a) Pcs (b)


  • a - Single relay
  • b - Double relay

Power supply


Remove jumper from PWR header. You must setup power supply module for 3.3V output before connecting PWR jumper.

Incubator is powered with 5.5 mm, center positive jack. It is recommended to use 12 V power supply.

Note: FAN output screw terminal has voltage equals to power supply voltage.


FIXME Case isn't available yet.



Board is populated with 2×3 programming header and programming button. You and upload code to the ESP8266 by using only RX and TX pins or take advantage of and FTDI chips to upload code automatically.

Programming header

Programming header pinout:

  • 1 - TX0
  • 2 - VCC
  • 3 - DTR
  • 4 - RX0
  • 5 - RST
  • 6 - GND

If you are uploading code using FTDI chip, connect RST and DTR pins and write command will resets the processor and enters programming mode automatically.

Pin labeled as VCC is connected to ISPPWR jumper. It is used to supply voltage to the board. You can power processor directly from the programmer by supplying 3.3 V. In this case connect ISPPWR jumper at 3V3 position. You can also supply 5 V of more by connecting ISPPWR jumper at HIGH position.

You can also ISPPWR jumper entirely and provide voltage using PWRJACK connector.


If you are connect ISPPWR jumper at 3V3 position and supply more than 3.3 V to VCC pin at programming header, you will damage ESP8266!


Configuring firmware

devices/incubator.txt · Last modified: 2016/12/12 09:30 by buben