Introduction: Low Cost and Accurate Incubator for DIY Biology

DIYbio, (Do It Yourself) biology is a growing movement that aims to make biology accessible outside of professional contexts. Over the past few years, platforms such as OpenPCR and Pearl Biotech transilluminator have been designed to support biology work in schools and maker spaces for a fraction of the cost of professional lab equipment. These exciting developments pave the way for crowdsourcing biology research amongst students, hobbyists, and non-experts. Our project contributes to the growing number of open source biology tools by developing a low-cost, yet relatively precise and easy-to-use incubator.

An incubator is an essential tool for a number of biological experiments and is often used in bacterial cell culture experiments. Given the higher price range of the commercially available incubators (upwards of several thousand dollars), non-professional biology enthusiasts might not afford to add an incubator to their stock of DIYbio tools. In this instructable, we describe how to build a low cost (under 70$), yet accurate ( +/- 0.25C) DIY incubator using simple materials and some basic electronics components.

A not-too-technical overview of how our incubator works.

The goal of the incubator is to keep a constant temperature inside. On the most basic level, we are using a temperature sensor and a light bulb as our heating element. The change in temperature inside the incubator is proportional to the amount of heat emitted by the tungsten bulb minus the heat loss through the walls of the incubator. In other words, to increase the temperature, the bulb needs to emit more heat than the heat loss through the walls. Once the desired temperature is reached, the bulb should emit the same amount of heat as what’s lost.

The amount of heat emitted by the tungsten bulb is proportional to the power applied to the bulb. Hence, we can control the temperature inside the incubator by controlling the AC input supplied to the bulb.

This project is by Piyum Fernando, Matthew Pandelakis, and Stacey Kuznetsov at the Social And Digital Systems (SANDS) Group at Arizona State University.

Step 1: A More Technical Overview of How Our Incubator Works

In this step, we discuss how to control the AC supply using AC phase control mechanism. This step has some technical details before we get into the practical steps of assembling the incubator.

In AC phase control, we control the input power supplied to the load (in our case the tungsten bulb) by allowing only a part of each half cycle of the AC signal to go through it. This is somewhat similar to Pulse-Width-Modulation(PWM) in DC. Unlike DC supplies, where the voltage is constant at any given time, the voltage of an AC supply follows a sine waveform. Therefore we need to know the current position of the AC cycle exactly before allowing it to go through the load in order to achieve desired output power.

Simply, the power control mechanism should be synchronised with the input AC signal. For that we use a Zero-Crossing detector. As the name suggests, zero-crossing point is where the AC signal crosses the 0V level or the point it changes its direction. This happens at the beginning (and the end) of each half cycle and the zero crossing detector outputs a square pulse at each of these points. Once we detect this point we can wait T1 amount of time before we switch ON the AC signal to go through the load. By controlling the T1 we can control the output power of the load.

If you are a newbie for working with mains power (~110V/~220V) it might be a good idea to consult someone who has good experience with it to help you. It’s good to learn from your mistakes, but not with the mains power!!!

Step 2: Materials We Need

In this project we used:

Step 3: Assemble the Circuit

Building the AC phase control circuit

The circuit diagram shows the AC phase control circuit we used in our incubator project. This circuit consists of two main parts; a) Zero-crossing detection circuit b) AC trigger circuit. In both circuits, low voltage DC components are opto-isolated from high voltage AC components. We used H11AA1 opto-coupler with a 10k pulled up resistor to detect the zero-crossing points. Please note, here we connected the AC supply with the H11AA1 across two 15k resistors. Using a step down transformer (~110V to ~12V) would be a nicer way of doing this. But if you are willing to use resistors please keep in mind you have to use high power resistors (not the tiny quarter watt ones). We used 5W resistors, but 2W ones will be more than enough for 110V supply. Anyway do your math(V squared over R), specially if you are at 220V or using some other resistor values. We used Q6015L5 triac to trigger(switch ON) the AC circuit. Triac function is similar to the function of a relay where we can switch on and off an high voltage signal using a small voltage signal from an Arduino.

NOTE: When you are building this circuit you have to be very cautious since you are dealing with higher voltages. You can’t use the internal wiring of stripboards or tiny circuit wires to connect high power components. You must use thick wires and a good amount of lead while soldering them. We used screw terminal block connectors to connect the AC input and output. Please check the connections several times to prevent short circuits before you connect it to the mains supply.

Once you are done with soldering the circuit, connect the AC power cable to the input screw connectors so that you can easily connect it to a power socket. Then connect the bulb holder to the output screw connectors. Then you can connect the DC end of the circuit to Arduino’s 5V, GND, 9 and 2 pins as shown in the schematic. Here the zero-crossing output is connected to the int.0 pin (pin 2) of the Arduino as we use Arduino’s interrupt functions in the code and pin 9 is used to trigger the triac (you can use any other available pin for this)

Connecting the temperature sensor

You can follow this nice article from Adafruit. It explains everything you want to know. Our schematic shows how to connect the thermocouple amplifier to the Arduino.

Connecting the LCD user interface

We used Olimex Arduino-compatible LCD shield which comes with 4 inbuilt buttons as the user interface of the incubator. This shield can communicate with the Arduino via both I2C and UART. In this project we used I2C communication. Therefore you only need to connect 5V, 3V3, SDA,SCL,AREF and GND pins of the shield to the relevant pins of the Arduino.

Step 4: The Arduino Code

In the next step we discuss how to control this circuit with the Arduino code. You can simply download and run our code. The rest of this step goes into the gory details of how the code works. Please note that some parts of our code are based on Arduino’s AC phase controlling tutorial and we re-used some part of that code as it is.

The Arduino UNO board contains a ATmega328P 16MHz microprocessor. To trigger the AC phase control circuit at precisely timed intervals we utilized the hardware timer interrupt functions of ATmega328. So, if you are not familiar with concepts like timers, registry overflows and prescaling, this article explains them better.

Before we go into coding we have to do some basic calculations. The AC signal is 60 Hz. (Don’t worry if you have 50Hz in your country, you can re-calculate it easily) This means, the AC signal crosses zero, reaches peak positive voltage, crosses zero again, reaches peak negative voltage and returns to zero 60 times each second. The period (length of time this takes) is 1/60 or 0.01667 seconds (16.67 milliseconds). Thus, a half cycle or the time between two zero-crossing pulses occurs in 8.33 milliseconds.

From here onwards, we will determine time intervals in the code from clock counts, not by seconds. The Arduino clock runs at 16 MHz, which is 16,000,000 cycles per second: one clock cycle takes 0.0625 microseconds. A single half cycle of the 60 Hz AC signal contains 133,333 clock cycles. The 16-bit timer (timer1) of Arduino Uno can only count to 65535. So we need to configure that with a prescaler. In this code we used a 256 prescaler. With the 256 prescaler, half a cycle means about 520 timer increments. For practical reasons (slight changes in supply frequency and triac operational delays) we considered it as 450. This assures that the triac driver has time to switch off before the next half cycle. So we controlled the waiting time before switching ON the triac within the range 1-450 inside each half cycle to control the output power. We used comparator match interrupts for this. We used timer overflow interrupts to control the signal to triac gate and set the pulse width to 4 timer counts. Here, when the pulse is sent to the GATE of the triac, it will turn the AC supply ON and will remain ON even after the pulse is removed until the next time the AC wave reaches zero. (If you are not familiar with Triac’s operation this is a good article.) Because of this we don’t need to worry about switching OFF the triac.

Following code snippet shows the AC phase controlling logic.

#define DETECT 2 //zero cross detect

#define GATE 9 //triac gate

#define PULSE 4 //trigger pulse width (counts)

// set up Timer1(16-bit)

OCR1A = 100; //initialize the comparator

TIMSK1 = 0x03; //enable comparator A and overflow interrupts

TCCR1A = 0x00; //timer control registers set for

TCCR1B = 0x00; //normal operation, timer disabled

// set up zero crossing interrupt

attachInterrupt(0,zeroCrossingInterrupt, RISING);

//zero cross detected

void zeroCrossingInterrupt(){

TCCR1B=0x04; //start timer with divide by 256 input

TCNT1 = 0; //reset timer - count from zero - counts until it matches the comparator value


//comparator match - reached the expected delay


digitalWrite(GATE,HIGH); //set triac gate to high - turn ON the supply

TCNT1 = 65536-PULSE; //trigger pulse width


//timer1 overflow - pulse reached its width


digitalWrite(GATE,LOW); //turn off triac gate

TCCR1B = 0x00; //disable timer to stop unintended triggers


Temperature controlling

Now we are done with the trickiest part of our code. Next is to control power (or the delay time) according to the current temperature value and the desired target temperature. To read the temperature value we used the Adafruit_MAX31855 library. To implement the control mechanism we used PID control logic. Don’t worry if it sounds a bit complex. Luckily we have an Arduino library for that. The following snippet shows the code for that.

#define DO 3

#define CS 4

#define CLK 5

Adafruit_MAX31855 thermocouple(CLK, CS, DO);

double setPoint, Input, Output; //Define Variables we'll be connecting to

double Kp=2, Ki=6, Kd=1; //Specify the links and initial tuning parameters

PID myPID(&Input, &Output, &setPoint, Kp, Ki, Kd, DIRECT);


myPID.SetOutputLimits(0, 449); // set the range

// inside the loop method

double c = thermocouple.readCelsius();

if (isnan(c)) {

i=450; // Go to minimum power if something went wrong


else {

Input = c; myPID.Compute();

i = 450-Output; // lower the delay, higher the power


OCR1A = i; //set comparator value to i

delay(400);// wait before next temperature read

User interface

To programme the user interface we used olimex lcd shield library together with Arduino wire library. You can download the olimex library from Olimex website.

Step 5: Test the System

Once you are done with soldering, assembling, wiring and programming you have almost everything to make a functional incubator and test it. Just two more simple things to do! You have to drill one hole at the top of the styrofoam box to put the bulb holder and another small hole at the bottom of the back side to put the thermocouple wire. Please refer the first image. Put the holder through the top hole and attach the tungsten bulb to it.

Put the free end of the thermocouple wire through the bottom hole and stick it to the back wall of the Styrofoam box using a tape. Please refer the second image. Use the lid of the styrofoam box to close it, as of now (we will make a transparent door later). Power up the arduino using a DC supply. Plug the AC cable to a power socket and power it ON. Don’t touch anything which carries AC current from this point. By default the target temperature is 35 C. If everything works well the temperature reading should reach and settle at 35 C after 4-5 mins. If it doesn’t, switch the AC power OFF and check your wirings.

To change the target temperature use the following steps.

  • Long press the 4th button from the left until the display changes to set target mode.
  • Use two leftmost buttons to increase and decrease the temperature.
  • Use third button from left to set new value.

It will take some time to settle at the new target.

Now you have a functional system. Let’s make it nicer, safer and easier to use by building an enclosure.

Step 6: Laser Cut the Enclosure

Next step is to laser cut the parts of the enclosure using plywood and acrylic. You can simply download and use the coreldraw files we used if you are using the same components (specially the styrofoam box) as ours. If not you can modify our files easily. All the parts excluding the door(⅛ inch acrylic) and the front UI panel( ⅛ inch acrylic) are made of 1/4inch plywood.

Step 7: Assemble Electronics Into the Circuit Panels

The nicest thing about our enclosure is, it has room for all our electronics parts. You can simply attach them to the circuit panel as shown in the image. Probably you will have to remove the wires you have put in the testing stage. You can re-wire them later. If you couldn’t find very small screws to fix the thermocouple amplifier by any chance, use some hot glue to do it. (That’s what we did. ;) ) Please make sure you put the AC phase control circuit inside a plastic enclosure before you attach it into the circuit panel. This way you can ensure safety of the users. Then attach the LCD shield to the front panel.

Step 8: Putting Everything Together

Let’s start building the enclosure from the bottom.

  1. Fix two sides, back and bottom part together using nuts and bolts as shown in the picture.
  2. Then slide the circuit panel into the slots of side and back walls.
  3. Attach the thermocouple wire to the thermocouple amplifier.
  4. Now put the free end of the thermocouple wire through the hole next to the thermocoupler amplifier in the circuit panel. Then put it inside the styrofoam box as we did in the testing step and stick it to the wall of the box using a tape.
  5. Now you can slide the styrofoam box into the enclosure.
  6. Put the bulb holder through the circuit panel and the top hole of the styrofoam box. If it is loose, use some glue to make it stable.
  7. Then attach front panel to the enclosure using nuts and bolts.
  8. Now re-wire everything as we did in the testing step.
  9. After that you can put the top part of the enclosure and fix it with nuts and bolts.
  10. The last thing is to fix the door. We used two metal hinges in one side and a small magnet as the lock at the other side. You will need to customize the design of the door according to the resources you have.

That’s all folks! Hope you enjoyed this instructable. We welcome your suggestions. Good luck and take care!

Tech Contest

Participated in the
Tech Contest