Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
dryanhuston
PostPosted: Feb 20, 2013 - 05:02 AM
Wannabe


Joined: Mar 19, 2010
Posts: 52
Location: California

A few weeks ago I made a chicken egg incubator with some scrap wood, a light bulb, and water heater thermostat. It worked, just not as nice as I wanted, I was in a rush.

I have been researching/designing a avr controllable incubator. No real need just a want and a challenge.

I am roadblocked at figuring out the heating element. I was thinking of using a PID controller to vary a PWM signal to a solid state relay that switches a 100-250 watt AC heating element.

I know I can use a PID controller to vary a PWM signal. I know I can switch the element on and off with a SSR. What I don't know is if I can use them together.

Would a DC to AC SSR chop the AC sine wave properly?

Is there a better approach?

_________________
I am not encumbered by the restraints of the adult mind.
 
 View user's profile Send private message  
Reply with quote Back to top
meslomp
PostPosted: Feb 20, 2013 - 06:41 AM
Raving lunatic


Joined: May 02, 2007
Posts: 3990
Location: Nieuwegein, Netherlands

I do not know if the heating element will like chopped AC sine waves.
As a PID regulator has to be adjusted to work correctly, you could just use a SSR and a couple of temperature sensors ( that you need anyway )
you have to run experiments on when to switch ON the controller to have a certain temperature and then how long it has to be on to get hot and a check on how fast it will heat up the environment + how long it keeps heating after you switched it off again.

will be a challenge, but if you first characterize the system then making a control for that should not be to hard. ow and don't forget the outside world to as this will influence the heating.

_________________
1)Datasheet and application notes checked?
2)tutorial forum
3)Newbie start here
 
 View user's profile Send private message  
Reply with quote Back to top
KitCarlson
PostPosted: Feb 20, 2013 - 11:46 AM
Posting Freak


Joined: Feb 06, 2009
Posts: 1158
Location: TN

I built one a few years ago with mega32 AVR. It works quite well.

I used opto-coupled zero cross control on the triac with PWM over a 2 second update period. It varies 0 to 120 cycles "ON" with 60 Hz line input. Control is P-I with some tweaking on "I".

I used a LM92 to monitor air temperature, it is SPI. I think the raw count was around 600 for 99.75 degrees F. The sensors vary some so you will have to calibrate. I used cheap oral thermometer. The temperature is fairly critical. Temperature is dropped about a degree, and more ventilation and humidity added when hatching.

I used a strip plate heater in the bottom, on an aluminum plate, with a bi-metallic cutout switch from a dryer on the plate as a safety.

There was a circulation fan, and a small amount of ventilation and water tray. Rotation was manual 3 times a day. The eggs placed in screen racks with dividers.

I also had an LCD to monitor control variables. I can share code if I can find it.

There may also be a post somewhere here.

_________________
It all starts with a mental vision.
 
 View user's profile Send private message  
Reply with quote Back to top
KitCarlson
PostPosted: Feb 20, 2013 - 12:03 PM
Posting Freak


Joined: Feb 06, 2009
Posts: 1158
Location: TN

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=85290&highlight=incubator

_________________
It all starts with a mental vision.
 
 View user's profile Send private message  
Reply with quote Back to top
dryanhuston
PostPosted: Feb 20, 2013 - 06:10 PM
Wannabe


Joined: Mar 19, 2010
Posts: 52
Location: California

I plan on using a Honeywell HIH-6130. It uses I2C, 14bit ADC resolution, and sensor calibration is easy. It cost $15 at mouser, but its a temperature and humidity sensor combined.

Humidity will be controlled with a DC water pump, in an external bucket, that sprays water through a mister nozzle.

I plan on having servo activated air vents, auto egg rotation, a circulation fan, door switch, and an alarm.

An LCD on the I2C bus will have a menu for choosing incubation settings for chicken, turkeys, ducks, quail, etc. As well as display pertinent information current temp, humidity, time till hatch, errors, etc.

_________________
I am not encumbered by the restraints of the adult mind.
 
 View user's profile Send private message  
Reply with quote Back to top
dryanhuston
PostPosted: Feb 20, 2013 - 06:32 PM
Wannabe


Joined: Mar 19, 2010
Posts: 52
Location: California

@KitCarlson
KitCarlson wrote:
I used opto-coupled zero cross control on the triac with PWM over a 2 second update period.

Admittedly I am a CS not an EE. My EE skills are self taught and generally low volt DC.

I essentially want to control an AC heating element like you would with a dimmer switch.

As I understand the way a good dimmer switch works is that it turns off the AC when crossing the x axis and back on at some point proportional to where the switch is, so twice during one period.

Does your solution factor that in? Or is your period long enough that it does not matter?

_________________
I am not encumbered by the restraints of the adult mind.
 
 View user's profile Send private message  
Reply with quote Back to top
dksmall
PostPosted: Feb 20, 2013 - 06:57 PM
Raving lunatic


Joined: Apr 16, 2001
Posts: 3544
Location: Phoenix, Arizona

This egg rotation surprises me, does that happen in nature? I thought the eggs just sit there with momma on top.
 
 View user's profile Send private message  
Reply with quote Back to top
dryanhuston
PostPosted: Feb 20, 2013 - 07:46 PM
Wannabe


Joined: Mar 19, 2010
Posts: 52
Location: California

dksmall wrote:
This egg rotation surprises me, does that happen in nature? I thought the eggs just sit there with momma on top.


Yes. The hen will spin the egg several times per day.

Most people when doing it by hand in an incubator will put an X on one side and an O on the other.

Automated turners orient the egg small end down in a sort of egg carton and rotate them back and fourth from +-45deg

The point of it is so the chick does not get stuck to a part of the shell. If that happens they can be deformed or die.

_________________
I am not encumbered by the restraints of the adult mind.
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Feb 20, 2013 - 08:14 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 29245
Location: Wisconsin USA

Quote:

I essentially want to control an AC heating element like you would with a dimmer switch.


Quote:

Or is your period long enough that it does not matter?

Indeed you could perhaps/probably "feather" the heater as with a dimmer. The real EEs will need to comment on possible heat considerations in the dimmer itself.

However, many/most heating situations will have a quite long "time constant". While P-I-D concept/approach can certainly be used, you may well find that just a common-sense approach using the concepts and information about the actual device will be simple and effective. For example, getting to desired temperature from room temperature when setting up isn't a big race. Steady-state shouldn't have many disturbances. Perhaps the biggest will be from inspection/rotation?

I'd wager a virtual cold one that you'd find that having a smallish heater on for a few seconds out of 50 or 60 would work well. (But I don't know the effects of the venting/circulation.)
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Feb 20, 2013 - 08:39 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 24107
Location: Orlando Florida

So the mother hen worries if her chicks are sitting bigendian up or littleendian up. The ones that develop upside down grow up to be Intel programmers. The others Motorola.

_________________
I ain't nobody's uncle, so don't call me that.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
dryanhuston
PostPosted: Feb 20, 2013 - 08:55 PM
Wannabe


Joined: Mar 19, 2010
Posts: 52
Location: California

bobgardner wrote:
So the mother hen worries if her chicks are sitting bigendian up or littleendian up. The ones that develop upside down grow up to be Intel programmers. The others Motorola.


Very Happy Funny stuff

_________________
I am not encumbered by the restraints of the adult mind.
 
 View user's profile Send private message  
Reply with quote Back to top
KitCarlson
PostPosted: Feb 20, 2013 - 09:45 PM
Posting Freak


Joined: Feb 06, 2009
Posts: 1158
Location: TN

The large end is best if tilted up, it is the air pocket.

Most modern breeds can not sit to term on eggs. They will stop too soon.

There may be electrical noise using dimmer approach. The zero cross turns on near zero. A triac will turn off at zero cross. It is something to test first.

The control in my unit regulated to +- 0.1 deg. F. It is also important to not overshoot after opening door.

Also things get messy when hatching, so consider that in design. With all your other automation, a pathway to a brooder would be nice.

_________________
It all starts with a mental vision.
 
 View user's profile Send private message  
Reply with quote Back to top
mikericetga
PostPosted: Feb 20, 2013 - 11:58 PM
Hangaround


Joined: Jul 29, 2012
Posts: 147
Location: Southwest Florida USA

It is often the case that a light bulb is suspended above the brood to radiate heat.

This is inefficient. The radiant heat provided by the bulb pales in comparison to the convective. Since the bulb is suspended above the brood, the bulk of the heat tends to rise away from the chicks.

A resistive heater placed below the brood provides much greater efficiency, virtually all the heat (read $) is used to warm the brood.

Another benefit is that this does not affect the chicks diurnal clock. That light bulb up there tends to mess with it badly.

A purely resistive heater cares little about the period or wave shape of the applied waveform, as long as the period is fast compared to the thermal mass of the system.

The typical brooder will have enough thermal mass to 'smooth out' temperature swings of a thermostat... i.e a comparatively high thermal time constant. A PWM method should be no problem.

Just curious, how are you implementing the egg turning?
 
 View user's profile Send private message  
Reply with quote Back to top
KitCarlson
PostPosted: Feb 21, 2013 - 12:49 AM
Posting Freak


Joined: Feb 06, 2009
Posts: 1158
Location: TN

And a light bulb dimmed at a low level may not last the 21+ days.

_________________
It all starts with a mental vision.
 
 View user's profile Send private message  
Reply with quote Back to top
GeococcyxC
PostPosted: Feb 21, 2013 - 03:38 AM
Hangaround


Joined: Feb 19, 2013
Posts: 100
Location: United States

Quote:
I was thinking of using a PID controller to vary a PWM signal to a solid state relay that switches a 100-250 watt AC heating element.
This will work, as long as your PWM signal switches rather slower than 60 Hz (or 50 Hz if that's the AC line frequency where you live). In other words, if the PWM signal is going on and off five times a second (5 Hz), it will be fine. If the PWM signal is going on and off six hundred times a second (600 Hz), this won't work very well.

The solid-state relay is basically an optocoupler (LED and phototriac) plus a beefy triac, all in one box. The LED is connected to your AVR and is blinked on and off by your PWM algorithm. The phototriac switches on when the LED shines on it. The phototriac is relatively wimpy at handling AC, so it is used to switch a beefy triac to handle the "real" power. The beefy triac is always all the way on or all the way off.

The cheap solid-state relays will turn on "whenever", not caring about where in the sine wave the AC power line is. They will always turn off when the AC power line passes through 0 V, no matter when you tell the LED to turn off - there will always be a little bit of a delay (at most 1/120 of a sec) between when you tell the LED to turn off and when the AC actually gets turned off. This is because that's how a triac works... once turned on it stays on until the voltage across it goes to 0 V.

Slightly more expensive solid-state relays will also have a "zero crossing" circuit to do the same thing at turn-on. (The data sheet for the relay will say if it has this or not.) You turn the LED on, then the relay waits for the next time the AC power is 0 V to turn on. Again, the delay will be no more than 1/120 of a sec. This is done because starting at 0 V is better for some loads, like incandescent light bulbs. If the filament is sitting there, off, and you suddenly turn it on when the AC is at 90 V, it has to heat up in a hurry, and the sudden temperature change makes it more liable to break. If you turn the filament on when the AC is 0 V, it has a few milliseconds to warm up as the AC voltage rises to the maximum, so the filament lasts longer. Switching at the zero crossing also helps reduce radio interference.

The reason why I said this will work as long as your PWM signal is slow, is that with this configuration, your AVR doesn't "know" what the AC line is doing. The AVR doesn't wait for the AC to be 0 V, it just switches whenever it wants to. As long as the AVR switches the output on for at least a few cycles of AC, there will be some useful power delivered to your load.

You mentioned a light dimmer switch. These are related, but have the advantage of "knowing" when the AC line goes through 0 V. You are correct about how they work. When the knob is at "10%", the switch waits for the AC to start at 0 V, rise to 120 V RMS, fall back down to maybe 12 V, and *then* it turns the output on. The output is on from 12 V down to 0 V and then it turns off again... lather, rinse, repeat. When the knob is at "80%", the switch waits for the AC to start at 0 V, rise to 24 V RMS, then turns on and stays one while the voltage goes up to 120 V RMS and falls to 0 again... lather, rinse, repeat.

It's tricky, but you can feed a sample of the 60 Hz power line into the AVR so the AVR "knows" about the AC line. Then the AVR can make decisions about when to switch, relative to when the AC line is at 0 V. You must have some kind of isolation between the power line and the AVR, usually either a transformer or optocoupler.

Advice 1: Don't worry about feeding a 60 Hz reference into the AVR for your first attempt. It's a lot simpler to let the solid-state relay worry about the switching... buy one with zero-crossing switching if you want to be fancy. Smile

Advice 2: Solid-state relays are never totally 100% "off". There is a small leakage current through the beefy triac always, enough to surprise you if you touch the output side of the relay, even if it is turned off. If you need to work on this, turn off the 120 V AC power to the solid-state relay. (Mechanical relays, in contrast, do turn 100% off.)

Advice 3: Include some kind of independent temperature limiting. KitCarlson mentioned this. You *will* screw up the algorithm (or, less likely but possible, the solid-state relay will fail in the "on" state) and the independent limiting will keep you from catching anything on fire. (It may or may not keep you from having fried chicken.) This is *required* in commercial heating appliances - coffee makers, clothes dryers, etc. You can use a bimetallic thermostat that will switch on and off (Klixon is the classic supplier of these) or a "one shot" thermal fuse that will open once and never close again. This thermostat or thermal fuse is placed in the hottest part of your box, and is wired in the AC power line to the heat source. Both kinds are available with the AC current and voltage ratings you need, so you don't have to hook up a lot of extra parts. They cost a dollar or two.

Advice 4: Omega Engineering (omega.com) has all kinds of nifty heaters and other goodies. Their prices are maybe not the lowest possible, but they have a good selection and things are in stock. I don't work for them or otherwise get money from them, I just know they exist. Alternatively, some pet stores sell heaters that look like a ceramic disc on the end of a ceramic stalk and that screw into a regular light bulb socket; these are $10-$20 or so and come in different watt ratings.

I hope this helps!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits