Shop OBEX P1 Docs P2 Docs Learn Events
It's working... it's working!!! - Page 2 — Parallax Forums

It's working... it's working!!!

2»

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-09-10 06:40
    mindrobots wrote: »
    Chickens are notorious for breaking ranks and becoming mutinous. Ducks on the other hand lend themselves more to precision marching and even exhibit this in the wild.

    That is a bit scary. I suppose that since geese fly in formations, they too might fall under the control of military precision.
  • RsadeikaRsadeika Posts: 3,837
    edited 2012-09-10 07:48
    What is missing in the video? The robots that come in to clean the coop, and get the eggs for you, maybe even round up a few stray chickens.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-10 09:11
    varnon wrote: »
    I would think some of the chickens would run under the coop if the heard the "death from the sky" call.
    Good point!
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-10 09:13
    When I was researching ideas I saw a similar contraption on youtube - somebody has done it... .will search for it again.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-10 09:14
    Rsadeika wrote: »
    What is missing in the video? The robots that come in to clean the coop, and get the eggs for you, maybe even round up a few stray chickens.
    I was thinking and automatic feed dispenser too. :D:D


    cuz, yeah. I'm lazy.
  • jazzedjazzed Posts: 11,803
    edited 2012-09-10 09:32
    doggiedoc wrote: »
    I was thinking and automatic feed dispenser too. :D:D


    cuz, yeah. I'm lazy.

    You could hook up a motor or servo to a seed spreader :)
    http://www.homedepot.com/h_d1/N-5yc1v/R-100664982/h_d2/ProductDisplay?catalogId=10053&langId=-1&keyword=seed+spreader&storeId=10051#.UE4Vto0iYuA

    Think of the big wheels as mechanical advantage.

    The handheld version works, but you have to shake it up.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-10 10:13
    That could work. I was thinking an auger in a tube or something....

    Hmmm.... spreader may have some advantages.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2012-09-10 10:36
    Maybe a barking dog sound playing from outside the coop will coax that last chicken in before the door closes...

    Or maybe fire up the animatronic Colonel Sanders sallying forth an empty bucket.

    450px-colonel_sanders4.jpg


    That's a great contraption you've got there, Doc.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-09-10 14:41
    erco wrote: »
    I miss my chickens. I had 3 gorgeous Rhode Island reds before the twins, raised from Easter chicks. But then LA Animal control came a-knocking. I guess Huey, Duey & Louie failed to charm one of my neighbors...

    LA has long allowed chickens (not sure about roosters) as long as you had the back yard for it. Not enough room in those new fangled tract homes, though. Don't know what kind of setbacks you have, but where we are we're allowed up to six chickens, as long as they're at least 35 feet from the neighbors (but then, I'm sure, only if they object). While we do have such a setback, it would mean a very small run for the chickens.

    Put a chicken in your back yard and you will not have a bug or spider problem.

    Nice project there, DD!

    -- Gordon
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-09-10 14:50
    Everyone else is posting their chicken videos, here's my favorite -- these aren't hens I keep, but I've known a few like this!

    (Go in to 0:25 or so..).

    -- Gordon
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-10 15:02
    Put a chicken in your back yard and you will not have a bug or spider problem.
    This is a very true statement.
    Nice project there, DD!

    -- Gordon
    Thanks GM - BTW I really like your Kickstarts Book!

    Paul
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-10 15:03
    Or maybe fire up the animatronic Colonel Sanders sallying forth an empty bucket.

    450px-colonel_sanders4.jpg


    That's a great contraption you've got there, Doc.
    Suppose I could find the Colonel on Ebay?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-09-11 00:40
    I live in Taiwan''s second largest city. But Asia being what it is, I have a neighbour somewhere nearby that has 4 or 5 free range chickens that wander the streets. People simply respect the fact that they are someone else's and do not molest them.

    If they lay eggs, I have no idea where.

    I've seen other people keeping goats, pigs, and even a cow or two on vacant lots. And we still have the occasional rice paddy wedged between buildings in the urban environment.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-12 17:07
    If they lay eggs, I have no idea where.
    Chickens will generally head home to roost. Home is easily imprinted by raising the chicks where you want them to roost. Then when they are big enough give the more room to roam.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-12 17:40
    BTW, here's the code: (and I attached the spin file)
    '' coop door test
    '' 9/3/2012
    '' Paul A. Willoughby, DVM
    
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    CdS_PIN = 0           'ADC pin (not to be confused with P0)
    RELAY_PIN  = 14
    MOTOR_PIN  = 15
    
    UPPER_SWTCH_PIN = 1
    LOWER_SWTCH_PIN = 0
    
    DUSK = 7
    DAWN = 50
    
    ON = 1
    OFF = 0
    UP = 1
    DOWN = 0
    
    
    
    OBJ
        HB25        : "HB-25"
        adc         : "PropBOE ADC"                               ' A/D Converter on PropBOE
        pst         : "Parallax Serial Terminal Plus"             ' Terminal communication tools
    
    
    VAR
    
      long lightValue, doorState                                              
    
    PUB Main
    
      Initialize
      repeat
    
        lightValue := adc.In(CdS_PIN)                        ' Get AD0 analog to digitla conversion
        GetDoorState
        Display
        if (lightValue < DUSK) & (doorState == UP)
          CloseDoor
        if (lightValue > DAWN) & (doorState == DOWN)
          OpenDoor
        waitcnt(clkfreq / 5 + cnt)                        ' Delay for 50 ms
    
        OUTA [RELAY_PIN] := OFF            
    
    
    
        ''waitcnt(clkfreq * 5 + cnt)
    
    PRI OpenDoor
    
        OUTA [RELAY_PIN] := ON
        waitcnt(clkfreq * 3 + cnt)
        HB25.SetMotorS(1650,1500)
        waitcnt(clkfreq * 2 + cnt)
        HB25.SetMotorS(1500,1500)
        waitcnt(clkfreq + cnt)
        doorState := UP
     
    
    PRI CloseDoor
    
        OUTA [RELAY_PIN] := ON
        waitcnt(clkfreq * 2 + cnt)
        HB25.SetMotorS(1400,1500)
        waitcnt(clkfreq * 2 + cnt)
        HB25.SetMotorS(1500,1500)
        waitcnt(clkfreq + cnt)
        doorState := DOWN
    
    PRI GetDoorState | switchVal
    
        switchVal := INA [LOWER_SWTCH_PIN..UPPER_SWTCH_PIN]
        pst.Str(String("Switches = "))
        pst.Bin(switchVal, 2)
        pst.NewLine
        case switchVal
           %01 :
            doorState := UP
    
          %10 :
            doorState := DOWN
    
      
    PRI Initialize
    
        DIRA [RELAY_PIN..MOTOR_PIN]~~
        DIRA [LOWER_SWTCH_PIN..UPPER_SWTCH_PIN]~
    
      
        OUTA [MOTOR_PIN] ~
        waitcnt(clkfreq * 5 + cnt)
       
        HB25.SetMotorS(1500,1500)
        HB25.Start(MOTOR_PIN)
    
    
    
    ''uncomment to use as debug
    
    PUB Display
    ''Display Method
    ''Sends cursor home, then displays ad=value and clears
    ''to right of value.
    
      ''pst.Home                                              ' Home position on screen
      pst.Str(String("CdS value = "))                        ' Display CdS value =
      pst.Dec(lightValue)
      pst.ClearEnd
      pst.NewLine
      pst.Str(String("DoorState = "))
        case doorState
           UP :
            pst.Str(String("Up"))
    
          DOWN :
            pst.Str(String("Down"))
      pst.NewLine
      pst.Home                                        ' Clear to the right of the value
    
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-14 18:24
    An idea stemming from Chris Savage's post in the project thread on Savage Circuits suggested I need to add a method that takes the average of some number of values from the CdS Photo Resistor to cancel out spikes of light, for example kids with flash light, lightning, car passing by and such.

    I'm thinking something like: (have not tested yet, don't know for sure it will compile)
    PRI GetLightLevels | sumValue
         repeat 20
             lightValue := adc.In(CdS_PIN)
             sumValue += lightValue
             waitcnt(clkfreq / 5 + cnt)
         lightValue := sumValue/20
    

    Then just call GetLightLevels in the main loop instead of reading the CdS pin directly from the main loop.

    Comments? Corrections? Is this "elegant" enough? :D

    Paul
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-14 18:44
    Tested the idea (in code) and it compiles fine. Heading out to the coop to upload the program and "field test" it. :D
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-14 19:16
    Needed to initialize the local var sumValue to 0 each pass through the method. I also added some code to display the values in PST while testing.
    PRI GetLightLevel | sumValue
         sumValue := 0
         repeat 20
            lightValue := adc.In(CdS_PIN)
            sumValue += lightValue
            pst.Home 
            pst.Str(String("SumValue = "))
            pst.Dec(sumValue)
            pst.ClearEnd
            pst.NewLine
            waitcnt(clkfreq / 5 + cnt)
         lightValue := (sumValue/20)
    

    It seems to work fine. This creates a 4 second buffer for the light value reading and assigns the average reading to the global var lightValue. Yay!
  • Roger LeeRoger Lee Posts: 339
    edited 2012-09-14 20:02
    Nice idea to get some kind of average light level before making any logic decisions.
    I think I can see what you are doing with the results of "GetLightLevel" method.
    Results of one run though that method determines if and when to change the state of the door.

    You want to eliminate false triggers for the door opening, correct?
    Just wondering if 4 seconds long enough time.
    Sure, sure, most of the time it will be enough.

    You could easily stretch out that sample time to one or two minutes, for example.
    After all, this is a decision that is made once in the morning and once at night. Why rush it?

    Looking forward to results of your field test.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-14 20:07
    Roger Lee wrote: »
    ... this is a decision that is made once in the morning and once at night. Why rush it?

    Looking forward to results of your field test.
    excellent point! Once I have it finessed to my satisfaction I'll do that. Testing goes much quicker with faster loops. Also I expect to drop the clock speed down to save on current draw.
  • Roger LeeRoger Lee Posts: 339
    edited 2012-09-14 20:12
    doggiedoc wrote: »
    Testing goes much quicker with faster loops.

    LOL, good point.

    PS Congratulations on being named Project on the Week.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-14 20:16
    Roger Lee wrote: »
    LOL, good point.

    PS Congratulations on being named Project on the Week.
    Thanks! I thought that was pretty cool! Never had any kind of recognition like that before!
  • davejamesdavejames Posts: 4,047
    edited 2012-09-14 20:21
    ...how about using one of them cog thingies to act as a basic 24 hour clock "filter" which would determine the proper operating window of the light sensor?

    Sounds good in my head, anyway...
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-15 02:20
    davejames wrote: »
    ...how about using one of them cog thingies to act as a basic 24 hour clock "filter" which would determine the proper operating window of the light sensor?

    Sounds good in my head, anyway...
    I thought about something like that. It could work I think, but I don't believe it's really necessary with this new GetLightLevel method.

    Paul
  • Igor_RastIgor_Rast Posts: 357
    edited 2012-11-09 17:13
    Doggiedog ,
    have you seen my tread about the wiznet connected to the prop measuring temp & humidity.HERE
    and displaying them along with a graph. keeping a relay onder control .
    maybe just wat you were looking for . nice barn by the way
  • skylightskylight Posts: 1,915
    edited 2012-11-10 08:26
    doggiedoc wrote: »
    Yeah it is! After I finish this automatic door project I'm going to expand the coop.. Then I'd like to........... set up a web server for it.


    Paul
    Ok I admit I was only joking when I suggested you train one of the chickens to close the door in your other thread but giving your chickens access to the internet I think is taking it a little too far!

    Glad to see you got it working in the end.
Sign In or Register to comment.