Arduino Sketch 5/12/2012

•05/12/2012 • Leave a Comment

Below is, at least for now the final sketch for the experimental incubator including the temperature probe, heating and cooling unit. Many many thanks to Paek kwang woong (백광웅) for the development of both hardware and software. The prototype is currently running at Susubori Academy, the work on “new generation” is about to begin :-)

  • SKETCH

//TMP36 Pin Variables
int sensorPin = 3; //the analog pin the TMP36′s Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade with a
//500 mV offset to allow for negative temperatures
/*
* setup() – this function runs once when you turn your Arduino on
* We initialize the serial connection with the computer
*/
void setup()
{
Serial.begin(9600); //Start the serial connection with the computer
//to view the result open the serial monitor
}
void loop() // run over and over again
{
//getting the voltage reading from the temperature sensor
int reading = analogRead(sensorPin);
// converting that reading to voltage, for 3.3v arduino use 3.3
float voltage = reading * 5.0;
voltage /= 1024.0;
// print out the voltage
Serial.print(voltage); Serial.println(” volts”);
// now print out the temperature
float temperatureC = (voltage – 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge – 500mV) times 100)
Serial.print(temperatureC); Serial.println(” degrees C”);
delay(2000); //waiting a second
}

Arduino sketch 29/8/2012

•29/08/2012 • Leave a Comment

Here is the arduino sketch which we use to control the prototype of the experimental incubator.

 

#include <LiquidCrystal.h>
String modeStr[]={“Set Min “, “Set Max “, “Current”};
int mode=2;
int maxTemp=25;
int minTemp=23;

const int downButtonPin=2;
const int upButtonPin=13;
const int onBoardTempPin=A1;
const int lineTempPin=A0;
const int heaterPin=9;
const int coolerPin=10;

boolean upButtonState=false;
boolean downButtonState=false;
boolean heaterState=false;
boolean coolerState=false;
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);

int tempPin=0;
int tempPin2=1;
int onBoardTemp=0;
int lineTemp=0;

void setup() {
lcd.begin(8, 2);
//analogReference(INTERNAL);
attachInterrupt(1, set, FALLING);
pinMode(upButtonPin,INPUT);
pinMode(upButtonPin,INPUT);
pinMode(heaterPin, OUTPUT);
pinMode(coolerPin, OUTPUT);
}

void printStrLCD(int row, int col, String str)
{
lcd.setCursor(row, col);
lcd.print(str);
}
void loop() {
if(mode==2) //current Temp, minTemp, maxTemp
{
int midTemp= ((maxTemp*10) + (minTemp*10))/2;
onBoardTemp=0;
lineTemp=0;
for(int i=0; i<20; i++)
{
onBoardTemp+=map(analogRead(onBoardTempPin), 0, 930, 0, 1024);
lineTemp+=map(analogRead(lineTempPin), 0, 930, 0, 1024);
}
onBoardTemp/=20;
lineTemp/=20;
String topStr= String()+ (onBoardTemp/10) + “.”+ (onBoardTemp%10) + ” ” + maxTemp;
String bottomStr=String()+ (lineTemp/10) + “.”+ (lineTemp%10) + ” ” + minTemp;
if(!heaterState && lineTemp<minTemp)
{
heaterState=true;
coolerState=false;
digitalWrite(heaterPin, HIGH);
digitalWrite(coolerPin, LOW);
}
if(heaterState && lineTemp>midTemp)
{
heaterState=false;
digitalWrite(heaterPin, LOW);
}
if(!coolerState && lineTemp>maxTemp)
{
heaterState=false;
coolerState=true;
digitalWrite(heaterPin, LOW);
digitalWrite(coolerPin, HIGH);
}
if(coolerState && lineTemp<midTemp)
{
coolerState=false;
digitalWrite(coolerPin, LOW);
}
printStrLCD(0, 0, topStr);
printStrLCD(0, 1, bottomStr);
for(int i=0;i<1000;i++)
{
if(mode!=2)
break;
delay(1);
}
}

if(mode==1)
{
upButtonState=digitalRead(upButtonPin);
downButtonState=digitalRead(downButtonPin);
if(upButtonState==HIGH)
{
maxTemp+=1;
delay(300);
}
if(downButtonState==HIGH)
{
if(minTemp+1<maxTemp)
maxTemp-=1;
delay(300);
}
printStrLCD(0, 0, modeStr[1]);
String str=String()+maxTemp+”      “;
printStrLCD(0, 1, str);
}
if(mode==0)
{
upButtonState=digitalRead(upButtonPin);
downButtonState=digitalRead(downButtonPin);
if(upButtonState==HIGH)
{
if(minTemp+1<maxTemp)
minTemp+=1;
delay(300);
}
if(downButtonState==HIGH)
{
minTemp-=1;
delay(300);
}
printStrLCD(0, 0, modeStr[0]);
String str=String()+minTemp+”      “;
printStrLCD(0, 1, str);
}
}
void set()
{
switch(mode){
case 0: mode=1;
break;
case 1: mode=2;
break;
case 2: mode=0;
break;
}
}

 

Build up of heating and cooling unit 27/7/2012

•07/08/2012 • Leave a Comment

The heating/cooling unit (hcu) of the incubator is suppose to heat up the incubator chamber in a control way up to 50°C within 15-30 minutes and cool it down to 15°C within similar period of time. It was build up within a range of several days.

The computer power supply unit (PSU) producing 300 W ??? was used to power the hcu, fans etc. The central part of hcu consisted of aluminium based heat sink, dimensions 65 on ??? mm with five fins in parallel in the middle. This heat sink was insulated from outside by thin slice of insulation (what type???). Two peltier  modules were cleaned properly and thermal grease was applied on both sides of each of them. The 100 W peltier module was positioned on the left hand side of the heat sink, approximately in the middle with the heat generating side attached to the central heat sink. On the cold generating side of the peltier another aluminium heat sink with 21 fins and fan was attached. On the right side of the central heat sink 60 W peltier was attached again thermal grease applied on both sides. The cold generating side was attached to the central heat sink and heat generating side was attached to the aluminium based heat sink with fan, same dimensions as for the 100 w peltier. In both cases an insulation was cut out in the shape of peltier module so the module was directly attached to the heat sinks however around it, between the heat sings themsleves the insulation was places so the thermal exchange was minimised.
In order to keep whole hcu more stable, it was attached to the plywood desk (dimensions – 35 cm long; 13.5 cm broad and 3 mm thick). Everything was tight together with two plastic cable ties, making sure that all the heat sinks are in full contact with the peltier modules.

The hc unit was transferred on the top of the incubator. The PSU fan (dimensions 80x 80 mm) was used to move the air from the hcu to the incubator and back. It was placed directly in front of the hcu, blowing the air through the heat sink and secured to the plywood board by another cable tie. Cardboard and tape was used to create two enclosures to secure air tight circuit. One enclosure was placed before the fan and taped to the cardboard below and to the fan, it had approximately 10 cm long and 6.5 cm wide opening into the incubator chamber. Second enclosure was attached to the rear end of the central heat sink with approximately same size opening to the incubator chamber. Whole structure was taped by insulation tape and usual tape from both inside and outside to ensure that the circuit will be quite air tight and ready for testing.

Things to consider

The plywood used to secure the central heat sink should be removed so the heat sink is radiating heat directly in to the incubator chamber improving the heat transfer.

Completion of the incubator chamber

•01/08/2012 • Leave a Comment

The completion of the chamber was done on 10/6/2012 by attaching the doors to the chamber. I used two door hinges with three screws on both sides of the hinge, I believe 20 mm wooden screws. The hinges were located 15-20 cm from the top respectively bottom edge. The door bolts were connected by two wooden screws on each side (of the door and the chamber) and were adjustable due to the screw thread, see the pictures.

The top ventilation hole was enlarged so it was 12.5 cm wide and 35.5 cm long to accommodate the ventilation duct properly.

Last part which has to be done is the insulation between the doors and the incubator chamber. Temporarily cardboard was used approximately 3 cm wide and 55 cm long, thickness around 3 mm.

When tested the doors do not close properly but that should be improved once the proper insulation will be used. In the worst scenario another door hinges will be used.

The box was subject to testing when the heating and cooling unit was finished as reported in the next post.

The Construction of the Doors 9/6/2012

•09/06/2012 • Leave a Comment

The doors are going to be composed from external layer of MDF board (60×60 cm, 12 mm thickness), internal part made from polyethylene (PE) sheet (60×60 cm, 5 mm thickness), wooden frame (26 mm on 40 mm and to fit the 60 cm sides) surrounding insulation layer from polystyrene (44 mm thickness). The overall thickness of the doors is around 65 mm, elastic plastic material was used to fit between the PE and wooden layers. Silicone was applied so whole structure was sealed.

Procedure

- the wooden frame was measured and cut with two pieces being the 60 cm and two to fit eatch the 60 cm edge
- 10-15 mm deep holes were drilled (3 mm drill) into the wood and brackets (smaller size, one screw at each side) were attached by 28 mm “wood” screws
- holes were drilled (3 mm drill) through the MDF and partly to the wood and 28 mm “wood” screws were used to connect the wood and MDF; location of holes – 12 mm from one edge and 20 mm from the other in each corner and again 12 mm and 300 mm (center of the side)
- silicone was applied into the seal between MDF and wood on the internal side
- polystyrene board (44 mm thickness) was partly cut in corners to fit and slide in
- the elastic plastic material (2.6-2.7 mm) was cut into strips to fit between the PE, MDF and polystyrene, two layers used
- the strips of elastic material were put into position and PE sheet was placed on the top and holes were drilled by 3 mm drill through all the way to the wood (some 4 mm in it); location of holes: 12 mm from the edge and 5 per each side
- silicon was applied between the wood and elastic material and elastic material and PE sheet
- the 28 mm “wooden” screws were used to attach quickly the PE sheet to the wooden frame
- notes and photos were taken the doors were left to dry

Finishing up the front “face” of the incubator chamber box 4/6/2012

•08/06/2012 • Leave a Comment

The box was left to dry after assembling all the parts and applying polyurethane foam. Now it was time to clean it up and add the front face so the box is ready for completion.

Procedure
- overlapping polyurethane foam was cut with a sharp knife sometimes with pieces of polystyrene too
- the rest of the foam was removed by chisel, knife and sponge so whole internal PE box was clean and left to dry
- two strips of plywood cut: 60 cm length and 55 mm height, 12 mm thick to use for making the front of the incubator inner box/part equal
- two holes drilled 6 mm from sides (55 mm edge) on each side with 4 mm drill
- another two holes were drilled on the outer edge of the longer side 6 mm from the edge and 15 cm from the top respectively bottom
- silicon applied to the cover any holes between polystyrene and MDF/PE parts
- silicon applied on the inner side of the plywood boards
- 28 mm wood screws used to connect this piece of plywood to the MDF (NOTE – all screws in the project which I used and called wood screws were actually not exactly wood screws because they were missing the blank part close to the head, they had thread all the way to the head)
- another two pieces of plywood cut same dimensions except length (47.5 respectively 48 cm)
- four holes drilled in each piece with 4 mm drill 6 mm from outer edge every 5 and 15 cm from top respectively bottom
- silicon was again applied and the boards were screwed to the MDF
- silicon was used to make the seams??? in the inner PE box and made equal with a finger
- again silicon used to fill up the seams between all the layers in the ventilation hole
- the box was left to dry

Insulation done, all layers put together 31/5/2012

•08/06/2012 • Leave a Comment

The experimental box is going to  be insulated in order to lover the energy needed to the heating/cooling. Polystyrene sheets, polyurethane foam and silicon were used.

Procedure

- polystyrene board (47 mm thick) was attached to the back of the chamber to the MDF board to the whole side with cutted on the bottom side to fit the bottom supportive plywood board later on
- in order to reinforce the bottom of the PE box and connect it to the box two 27 x 27 mm wooden planks were screwed to MDF box in parallel to the front side (on the edge, whole length 50 cm) and partly on the back (on the edge in the middle of the back side +- 30 cm length) by two wood screws (30 mm) (from outer side MDF to the wooden plank)
- plywood desk of 42.7 cm front side, 60 cm length and 15 mm thickness was placed on these two wooden planks and screwed to them by 55 mm wood screws (two in the front and two in the back) 15 and 10 cm from bracket, 2 cm inwards from the wall
- holes for door hinges were drilled into the MDF boards 18 cm from bottom respectively top (the middle of the door hinges)
- three M5 30 screws were used to screw each door hinge on
- ventilation hole drilled 25 cm from the front in the middle of the desk with use of 54 mm diameter holesaw, second hole drilled just next to it in the direction to the back (again d=54 mm)
- the hole was enlarged to the rectangle shape with oval corners and made smooth

 
Follow

Get every new post delivered to your Inbox.