Egg Incubator based on '08m2

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...)
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
-
 

MPep

Senior Member
Hi Erik,

Do you have any photos and schematics you can share with us?
By the descripton, you've certainly made a feature-full incubator. Well done.

Mark.
 
I have a little problems using Designspark PCB... :(
But the setup is quite simple.
There is a standard 5 V regulated power supply,
Th Picaxe08M2 has the standard programming resistors out of the manual.
The following in/outputs:
C.0 Serial out + OLED serial in
C.1 connected to the DS18B20
C.2 via a transistor connected to a relais. The other side of the relais is connected to 12 V unregulated
C.3 is the button input

The DS18B20 has an accuracy of +-2 degrees and a resolution of 0.1 degrees Celcius and this is more accuracy than needed. It showed the same temperature as a mercury fever thermometer.

An improvement can be made to exchange C.2 and C.3. The C.3 doesn't have a ADC, forcing me to the one button approach' Using a resistor ladder, more switches can be used...

The incubator itself is made out of wood by the design of a 'motorised incubator'
The side panels are hollow and air is circulated from the top, through the hatching area and up again through the hollow side panels. A 12 volt Fan (on 5 volts) circulates the air.
Heat is generated by 4 lightbulbs (60 watts each), switched by the relais.

Since the heated air will dry, a spronge sist over the fan to moisturise the air ro rel 55% humidity. It can be somewhat regulated bij putting the spronge aside more or less.

As extra a hole is made in the top just above one of the bulbs to shine through the eggs to see in they are incubated (normally a seperate accessoire... never saw it built-in like this :)

Just these 1000 words against one picture... see 4 yourself!
 
Last edited:

MPep

Senior Member
Thanks Erik. Very nice indeed.

For non-Dutch readers, "kip" (from Robokip) is Dutch for chicken. :)
 

pleitch

New Member
In Australia we call a chicken a "Chook". At work anyone with a last name "Fowler" will be called "Chook".

Anyway, I've just done the coding on ReadTemp12 and got a different implementation from you for the decimals. On the data sheet of my Dallas DS18b20 the "decimal" proportion is actually in increments of 0.0625.

This was my implementation:

Code:
	Temp = 0
	TempDecimal = 0

	ReadTemp12 Dallas, Temp 'Dallas is the pin that the Dallas temperature sensor is on.
	TempDecimal  = Temp And %000000001111
	TempDecimal = TempDecimal * 625 'value = 0.XXXX where XXXX is the value in TempDecimal

	Temp  = Temp  / 16
 

jermb11

New Member
Hello, I was just wondering how much fluctuation in Temp you get with this? I have a Incubator that I bought from the local feed store, It will fluctuate 2-3 degrees. (that is in Fahrenheit). I am trying to make a homemade incubator that is fan forced to circulate the air. I would like for it to hold as close to 99.75 deg for Chicken eggs. I quess the main question is how close to the preset temp will it be able to maintain? exactly, within 1/2 a degree, plus or minus 2 dergees?
Thanks Jeremy
 

Paix

Senior Member
I run one or two 60W lamp bulbs in a honey warming cabinet, unregulated, and due to the warm environment, the bulbs don't last particularly long.

I am going to wire four 100W lamp bulbs in series parallel, so that I can extend their working life and have two 50W strings that I can switch on or off as necessary.
 

Paix

Senior Member
- 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?)
Apparently so Willam . . . :)
 
Top