Auto chicken door Pic 818 code oddity.


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Auto chicken door Pic 818 code oddity.

    No, the difference between the two codes is the limit switch inclusion. I ran out of development time before I went away for the New Year and so as a quick fix I used the motor run timer Code A.

    The pause in Code A is the motor run time, in B it's to allow the limit switch to open before it's checked for position. That way I only use one switch, not two for up/down.. The High motorup starts the motor and the pause leaves it running then the program enters the Low phase. The Counter prevents cycling from one to another. Both conditions, LDR and Counter have to be correct for it to run. That was another anomaly, I tried 'AND' which just didn't work, i resorted to a small Loop. All most odd.

    I tried the Code B with Pause inclusions where the Serout commands were in Code A but still it doesn't run correctly, the motor just runs in the Open phase non stop and ignores the limit switch.
    The addition of the limit switch is to make the close and open positions identical. Using Code A and run time I found the door positions changed ever so slightly over time due to not refining the run times. The different run times is for motor torque, in the down run the additional weight of the door makes it close faster than the up cycle.

    It all runs Ok at the moment with Serout commands in the Code B but I'm curious as to why it needs the Serout commands for it to work correctly. Bear in mind they are useless commands, there's no LCD connected, the N9600 is incorrect for the clock at 4Mhz anyway.

    The Tris commands are incorrect above but correct in code, the copy and paste to forum seems to have removed the percent and a couple of 0's and 1's.

  2. #2
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Auto chicken door Pic 818 code oddity.

    OK, the system has been in use for a few days and behaves well.

    So I took the opportunity to add the 4 hour SLEEP after the door is operated in order to save battery drain.

    However, in sleep mode the current consumed is the same as when it is just left looping the LDR adc.

    I know there's a standing current consumed by the 7805 reg but I expected a change when the chip is sleeping that would be measureable?

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts