Shop OBEX P1 Docs P2 Docs Learn Events
Egg Turner — Parallax Forums

Egg Turner

levilevi Posts: 9
edited 2007-06-10 11:49 in BASIC Stamp
Hi there, i have done a fair bit of trawling through the site and cant seem to find an answer, so here i go....

I am trying to develop a microcontroler to control an incubator, which my wife and i would like to set up in a small village for locals to use free of charge when we go in july to kenya.

I have the control of the tempuature and humidity sorted out using a combined probe and solid state relays....

Now the part that i am stuck on is an egg turner.....i know the principle that i want to use but therein lies the difficulty.

I want to control a motor (more than likely dc) that rotates in one direction untill a microswitch is pressed, then stop and wait an hour before rotating in the opposite direction untill another switch is pressed, then stop an hour before going back and so on......

the following is a schematic that would work continuously, but does anyone have a suggestion as to how i could control this with the stamp module and include a timming aspect.







image008.gif

Any help would be greatly appreciated.

Yours,

Levi

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-05-30 17:41
    Levi,

    Assuming you are setting up a regular size incubator (ie many eggs being turned at one time), you probably will use a fairly substantial DC gearmotor. That is, something with a slow speed output shaft.

    Have your limt switches set up to detect the extremes of travel, as you have suggested. When an extreme is reached, start a timer. When the timer expires, go in the other direction.

    I'd use packaged, off-the-shelf timers which can be easily replaced when they fail. I'd also tend to build in a set of manual buttons so, if necessary the eggs can be turned manually if the controls stop. Also, a way to turn the eggs if the batteries die would be useful as well.

    If it would help, I'd be willing to do up a schematic for you. Just PM me.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-30 18:25
    Okay, I know nothing about incubating eggs, and it's that lack of knowledge that prompts these questions: Why does the motor need to reverse? Assuming the eggs are placed atop and between a couple closely-spaced rubber rollers rotating in unison, wouldn't turning them two half-turns in the same direction accomplish the same thing? For that matter, why not just rotate them continuously, but very slowly?

    -Phil
  • levilevi Posts: 9
    edited 2007-05-30 18:54
    Hi thanks for the reply, but i am hoping more for control by the BS2 than a plug in timer....as these wont be easy to get hold of.

    the manual buttons is a good idea, and ill incorporate this so i can toggle the trays back to middle.

    Cheers,
  • levilevi Posts: 9
    edited 2007-05-30 19:09
    Phil,

    All valid points, but i am hoping to make a large incubator to supply the whole village........in the region of 3000-10000 eggs.

    so the roller principle is not fesable,

    instead i have in mind are trays that are pivoted in the middle, stacked about ten high, connected together on one side, such that when one is lifted they all lift (up one side and down the other)...i want to lift it so the trays are on the 45, then drop to the other 45...(/ to \).....thus getting 180 degree turn.....several times a day.

    so i need a motor to turn untill the top tray corner hits a microswitch, then wait an hour before turning the otherway...till the bottom tray corner hits its corresponding switch, waiting, then back up and so forth.......

    hope that clears things a little.

    Levi
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-30 19:37
    Levi,

    Thanks for the clarification! Unless I'm still missing something, it does seem that your scheme will only rotate the trays — and hence the eggs — through 90 degrees, though (-45 to 45), instead of the 180 you're aiming for.

    -Phil
  • levilevi Posts: 9
    edited 2007-05-30 20:07
    Phil,

    The eggs will sit in holders in the tray with the small end down so they will get tipped over and i think (if i am not going crazy) it will be about the 180 degree mark.

    its good though that you are very obsevant...

    thanks.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-30 20:53
    Ah, I get it now: The trays tilt through 90 degrees and the eggs flop back and forth another 90 degrees within the tray. Thanks!

    -Phil
  • levilevi Posts: 9
    edited 2007-05-31 16:47
    right,

    what if i connect a solid state relay to P8 and P10, which control opposite polarities to the motor and push button switches to P9 and P11, acting as limit switches.

    With something like,

    DO

    IF (IN9 = 1) THEN
    LOW 10
    PAUSE?
    HIGH 8

    ELSEIF (IN11 = 1) THEN
    LOW 8
    PAUSE ?
    HIGH 10

    ELSE

    PAUSE 50

    ENDIF

    LOOP


    Well something like that.....lol... this is my firt time at any of this and it is confusing to say the least!

    The PAUSE? just represents that i dont know if i can pause upto an hour with the stamp....any help or critique welcome.

    levi
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-31 17:13
    You can delay up to 65.535 seconds with the Stamp, using a PAUSE 65535. For longer delays, just put the PAUSE in a FOR...NEXT loop.

    -Phil
  • levilevi Posts: 9
    edited 2007-05-31 17:48
    sorry to sound dumb but how can i do this? would i have to count to sixty and repeat 60 times?
  • metron9metron9 Posts: 1,100
    edited 2007-05-31 17:58
    3000 eggs gone bad is alot of eggs. Perhaps three 1000 egg units would be wise. I get a kick out of my wife when the computer goes haywire or the printer stops working, these things do have from time to time glitches, its the nature of the technology. Just something to think about, especially if you are in the village and 3000 eggs go bad.

    Oh and external high low temp alarms with backup battery supplys that are independent of your egg turner microprocessor controlled system. A mechanical counter with a little arm to count the number of rotations would also be handy if the system turns the trays very slowly, that way someone can check at a timley interval to see what the count is at.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 5/31/2007 6:04:17 PM GMT
  • stamptrolstamptrol Posts: 1,731
    edited 2007-05-31 18:26
    Levi,

    I was showing a friend with Engineers Without Borders your post re incubators. He has done exactly this project in two different countries of developing Africa.

    His over-riding concern is to encourage extensive research on what materials are readily available on site and to keep things low tech. As was pointed out in an earlier post, several small incubators would be better than one or two large ones. Definitely provide for manual backup at every level as replacement parts have long lead times and equipment such as storage batteries may get "repurposed" by folks with other needs.

    A noble project to be sure, but extra care is required so it doesn't turn into the Axemakers Gift.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-05-31 18:30
    Levi,

    Given that you still want to go the Stamp route, here's a subroutine that will give you an hour's delay:

    Ctr [b]VAR[/b] Byte
    
    WaitOneHour:
    
      [b]FOR[/b] Ctr = 1 [b]TO[/b] 60  'For sixty minutes...
        [b]PAUSE[/b] 60000      '... wait one minute (60000 milliseconds)
      [b]NEXT[/b]
      [b]RETURN[/b]
    
    
    


    In your program, where you need a one-hour delay, call the subroutine thus: GOSUB WaitOneHour

    -Phil
  • levilevi Posts: 9
    edited 2007-05-31 19:44
    Hi,

    -Phil, I am greatfull for what you have done.......but i have just seen a flaw in my idea, in that the stamp wont be able to control the temp and humidity whilst pausing for the egg turner.

    without getting another stamp i cant see it working without, as stamptrol said, using external timers.

    Cheers,

    Levi.
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-05-31 20:16
    Oh, of course it can monitor temperature.

    Seconds VAR BYTE
    Minutes VAR BYTE

    MAIN:
    · FOR MINUTES = 1 TO 60
    ··· FOR SECONDS = 1 to 60
    ····· PAUSE 1000 ' Pause 1 second
    ····· GOSUB CheckTemp
    ····· GOSUB AdjustHeat
    ··· NEXT
    · NEXT
    · GOSUB ChangeTrayPosition
    · GOTO MAIN
    END

    CheckTemp:
    · ' Do stuff to check the temperature
    · RETURN

    AdjustHeat:
    · '· Do stuff to turn the heaters on and off
    · RETURN

    ChangeTrayPosition:
    · ' Do stuff to change the tray position
    · RETURN
    ·
  • stamptrolstamptrol Posts: 1,731
    edited 2007-06-01 00:55
    ·Levi,

    ·· Attached is the one-component solution for the tray turner.

    ·· It is based on a "recycling timer" which is very common in industry. It essentially turns on and off indefinitely and causes the motor to go first one way then the other. Both periods are adjustable. Available in many voltages. Contacts are heavy enough for the motor directly; no relay required. Limit switches are needed at each extreme of travel.

    · A main power switch can be added, of course.

    · regards,

    ·Tom Sisk

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    1127 x 1202 - 161K
  • LSBLSB Posts: 175
    edited 2007-06-01 04:02
    Please send a picture when you're done, I’d love to see how you fold it.

    By my estimation... allowing for the roll you mention, I figure 9 sq in per egg. 3000 eggs = 27000 square inches or 187.5 sq feet! Figure a square frame, four levels high... isn't that ~7 feet on a side?
    Research shows that a "Large" grade chicken egg must weigh 2 oz. that's 375 pounds of eggs in the small model and the 10000 egg model would hold over 1200 pounds of fragile, slime centered ovoids full of liquid chicken!

    I was raised on a farm, we raised chickens 500 at a time and I never thought I’d see more chickens than that; obviously, I am a neophyte…
  • metron9metron9 Posts: 1,100
    edited 2007-06-01 04:54
    I did a tiny amount of reading about hatching eggs, (I did not grow up on a farm but bought a hobby farm 20 years ago, I had chickens and pigs and cows, now I have grass and I mow)

    Anyway, I see a problem with a large incubator in that the eggs should only be rotated for 18 days. I don't know if you get the fertile eggs all in on the same day but I assume the village has chickens and that every day new eggs would arrive for incubation. It would seem to me a 3000/21 or perhaps 200 egg per incubator would be a better idea. That way all the eggs that come in one day can be incubated for 18 days with rotation and then still for the last 3 days. Otherwise it could get pretty confusing.

    I would think if the eggs are in a tray balanced in the center that a single servo could be used as the rotation motor and they have a 180 degree rotation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • levilevi Posts: 9
    edited 2007-06-01 10:56
    Hi all,

    Thank you to everyone for their input, it has given me alot to think about ( i dont know if that is a good thing or not!).

    allanlane5, thank you for the code.....it could work with a little tweeking as the exact timming of the turner is not critical, and i could tweek the code a little to get closer to the hour......

    However i dont wish to seem ungratefull but i now am of a mind to follow stamptrol's idea, only to save space on the stamp to carry out other routines like an open door alarm and auto water top ups.

    Now onto that issue.......Stamptrol (or others) the schematic seems simple enough (and thankyou for that!) but could you clarify what is happening near the 4,7,1, 6,9,3.

    I see from the amperite site that the contacts between 1 and 7 and 3 and 9 are N/C and those between 4 and 7 and 6 and 9 are N/O......well what i am trying to get at is that in your scematic you are showing the contact states within the timer, and then saying to add N/C switches (limit) at my extreems? is this true?

    if so how do i go about it, do i place the switches between pins 4 and 3 and 1 and 6?

    Yours,

    Levi
  • stamptrolstamptrol Posts: 1,731
    edited 2007-06-01 12:18
    Hi Levi,

    To the powers that be, thanks for leaving this thread intact in, arguably, the wrong forum. Its a great project on a world scale and needs to be discussed.

    The circuit is the classic motor reversing circuit using a DPDT (double pole, double throw) relay. In this case, the DPDT relay is actually the timer. The limits switches are external to the relay, obviously, wired back to the relay pins.

    Consider the case where the tray is somewhere between the two limits. When power is first applied, power flows in through pin 7, through the N/C contacts of the relay, out pin 1, then through the N/C contact of the limit switch at the clockwise extreme, through the motor, back to pin 3, through the relay N/C contact, out pin 9 and back to the battery.
    During this time, the motor is connected so it travels towards the CW extreme. And, power is applied to the timer during this time.

    When the tray reaches the CW limit, it shuts off the motor. The timer keeps running for whatever time its set to, say 1 hour. At the end of the hour, the timer operates and the relay contacts change state.

    Now, power flows in to pin 7, through the NO contact (which is now closed), out pin 4, through the CCW limit switch, to the bottom connection on the motor, out the motor and back into the relay on pin 6, through the second NO contact, out pin 9 and back to the power supply. The motor runs in reverse until the CCW limit opens which stops the motor. The timer continues for another time period, then lets the contacts revert to the original state and the cycle repeats.

    Of course, a main power switch could be added at the battery, and manual switches could be added as well.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • levilevi Posts: 9
    edited 2007-06-01 14:15
    Thankyou stamptrol that has cleared it all up for me...

    I will of course post schematics and code when i have finalised my design.......

    but again thankyou to all that have given their 2 pennies (cent) worth.

    Levi
  • stamptrolstamptrol Posts: 1,731
    edited 2007-06-10 11:49
    · Levi,

    ··· Didn't have your direct email, so had to put sketch here.



    ·Cheers,

    Tom



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    1223 x 1241 - 168K
Sign In or Register to comment.