Erik van Gerven
Member
My daughter started a project at school where she wants to develop eggs to little chickens.
I helped her to design and build the incubator. I also built the thermostate using Picaxe, thermo sensor and OLED display. Output is using a relais because the heating draws 240 watts of power.
There is just one button for control needed.
A 'child-lock' is built-in
Push short - will display '*** LOCKED ***' and switches on the light for about 10 seconds
push long - wil go into temp set mode. The setting can be changed in 0.1 degrees celcius steps between 30 and 40 degrees.
The setting will be stored in eeprom 10 seconds after the last button click.
When the actual temperature is more than 1 degree higher or lower an alarm is shown
The eeprom storage is needed for the incubator to recover after a power failure.
The OLED will show
on line 1:the actual temperature and an indicator showing changes in temepature
on line 2:the temperature in memory or a system message and an indicator when the heater is switched on
The project seems to run very stable now but some improvements can be made:
- all of this can also be built into the 18m2 on the OLED board... or use a 18m2 instead of the 08 to make some enhancements possible as:
- using interrupts to respond to the button instantly
- RTC and logging of temperature
- RTC and a day-counter. Maybe even show some instuctions on the display
- RTC and automatic rolling the eggs every 2 hrs (using a slow servo?)
- Switch off half of the heater s when temp is within 0.2 degrees from goal to prevent overshoot
- Door lock
- Door switch will turn on light and sounds an alarm if left open for a long period
- Audible alarms
- Adding a humidity sensor and moist control
- Rearrange output pins
rgds,
Erik
The code (not too well documented yet.... sorry...)
-
I helped her to design and build the incubator. I also built the thermostate using Picaxe, thermo sensor and OLED display. Output is using a relais because the heating draws 240 watts of power.
There is just one button for control needed.
A 'child-lock' is built-in
Push short - will display '*** LOCKED ***' and switches on the light for about 10 seconds
push long - wil go into temp set mode. The setting can be changed in 0.1 degrees celcius steps between 30 and 40 degrees.
The setting will be stored in eeprom 10 seconds after the last button click.
When the actual temperature is more than 1 degree higher or lower an alarm is shown
The eeprom storage is needed for the incubator to recover after a power failure.
The OLED will show
on line 1:the actual temperature and an indicator showing changes in temepature
on line 2:the temperature in memory or a system message and an indicator when the heater is switched on
The project seems to run very stable now but some improvements can be made:
- all of this can also be built into the 18m2 on the OLED board... or use a 18m2 instead of the 08 to make some enhancements possible as:
- using interrupts to respond to the button instantly
- RTC and logging of temperature
- RTC and a day-counter. Maybe even show some instuctions on the display
- RTC and automatic rolling the eggs every 2 hrs (using a slow servo?)
- Switch off half of the heater s when temp is within 0.2 degrees from goal to prevent overshoot
- Door lock
- Door switch will turn on light and sounds an alarm if left open for a long period
- Audible alarms
- Adding a humidity sensor and moist control
- Rearrange output pins
rgds,
Erik
The code (not too well documented yet.... sorry...)
Code:
symbol cdeg = w0
symbol deg = w1
symbol tmp =w2
symbol settemp = w3
symbol cdegset = w4
symbol degset = w5
symbol mtemp = w6
symbol stemp = w7
symbol diff = w8
symbol trend = w9
symbol light = b22
symbol lock = b23
symbol schrijf = b24
symbol lees = b25
symbol save = b26
symbol loopcounter = b27
init:
read 127,lees
let settemp = lees+480
schrijf=settemp-480
serout c.0,n2400,(254,1)
pause 1000
serout c.0,n2400,(254,128," KIP-TV ")
serout c.0,n2400,(254,192,"EvG-Electronics ")
pause 1500
serout c.0,n2400,(254,128," Lovelyn ")
serout c.0,n2400,(254,192," Daphne ")
pause 1500
serout c.0,n2400,(254,128," V.1.0 ")
serout c.0,n2400,(254,192," 29-09-2012 ")
pause 1500
start:
if pin3 = 0 then
if lock = 0 then
serout c.0,n2400,(254,192,"*** LOCKED ! ***")
pause 5000
lock = 1
light = 10
if pin3 = 0 then
goto start
end if
end if
end if
if pin3 = 0 then
loopcounter = 0
save = 50
settemp=settemp*10'increase settemp with 0,1 degree
settemp=settemp+16
settemp=settemp/10
if settemp > 640 then'limit between 20 and 40 degrees
pause 1500
settemp=480
end if
let cdegset=settemp
let cdegset = cdegset * 10'set graden
let cdegset = cdegset/16
let degset = cdegset /10'tiende graden
let tmp = degset * 10
let cdegset = cdegset - tmp'hele graden
serout c.0,n2400,(254,192,"Chng : ",#degset,".",#cdegset,210,"C ")
pause 50
goto start
end if
read 127,lees
schrijf=settemp-480
if save =1 then
if lees = schrijf then
else
write 127,schrijf
end if
serout c.0,n2400,(254,192,"Save : Data ")
pause 1000
end if
let loopcounter = loopcounter + 1
if loopcounter >7 then
loopcounter = 0
end if
if save > 0 then
save = save -1
end if
readtemp12 c.1,cdeg
let cdeg = w0 * 10'gemeten temp
let cdeg = w0/16
let deg = cdeg /10'tiende graden
let tmp = deg * 10
let cdeg = cdeg - tmp'hele graden
let cdegset=settemp
let cdegset = cdegset * 10'set graden
let cdegset = cdegset/16
let degset = cdegset /10'tiende graden
let tmp = degset * 10
let cdegset = cdegset - tmp'hele graden
'display temp
serout c.0,n2400,(254,128,"Temp : ",#deg,".",#cdeg,210,"C ")
let mtemp=deg*10'gemeten temp
let mtemp=mtemp+cdeg
let stemp=degset*10'set temp
let stemp=stemp+cdegset
'alarm
if loopcounter >4 then
diff = mtemp-stemp
if mtemp > stemp then
if diff >10 then
serout c.0,n2400,(254,192,"Alarm: HIGH!! ")
pause 500
end if
end if
diff = stemp-mtemp
if mtemp < stemp then
if diff >10 then
serout c.0,n2400,(254,192,"Alarm: LOW !! ")
pause 500
end if
end if
else
'display set temp
end if
if save = 0 then
lock = 0
if light >0 then
serout c.0,n2400,(254,192,"Light: On ",#light," ")
else
serout c.0,n2400,(254,192,"Mem : ",#degset,".",#cdegset,210,"C ")
end if
else
serout c.0,n2400,(254,192,"Chngd: ",#degset,".",#cdegset,210,"C ")
end if
'switch
if trend = mtemp then
serout c.0,n2400,(254,143,187)
else
if trend>mtemp then
serout c.0,n2400,(254,143,185)
else
serout c.0,n2400,(254,143,186)
end if
end if
'trend
let trend = mtemp
if stemp>mtemp then
serout c.0,n2400,(254,207,173)
high c.2
else
serout c.0,n2400,(254,207,219)
if light > 0 then
else
low c.2
end if
end if
if light >0 then
high c.2
light = light -1
serout c.0,n2400,(254,192,"Light: On ",#light," ")
pause 1000
end if
goto start