webcontroller8 used to drive a pet feeder

bbsux

Active Member
I have a pet feeder
 
http://www.amazon.com/Automatic-Feeder-Electronic-Programmable-display/dp/B002X73CBC
 
that needs new electronics -original was hard to program didn't work correctly half the time.
 
It uses a motor with a gear system to turn the bowls.  on bowl #1 the is a contact switch that is unhooked, but not in the others.
 
It used an photo interupter (the main gear has small holes that line up with the sensor when it's lined up with a bowl).
 
Of course I want it to feed on a schedule.
 
and maybe add a anti-tamper feature - so it'll reverse to the bowl line up spot if my cat tries to push it to the next one.
 
and i'd like the ability to use a input with a button to make it rotate to the next bowl so i can refill it
 
I would this this would all be possible.  Maybe even put a 1wire temp sensor on the motor so if it jams it'll shut down.
 
 
 
Would I use a modified version of example 8 in the manual?  I've never done anything with time based plc coding.
 
basically have it check for midnight or noon, if it is then power up a output with a relay to power motor, then while motor is on have it be checking for the photo interupter to indicate the bowl is in the right place when it is have motor shut off.
 
have a button that can activate the motor subroutine for refilling.
 
legend

motor = op1
button = ip1
photo interupter = aip1

--------------------
START
CALLSUB TIME
CALLSUB MOTOR
CALLSUB BUTTON
END

SET:
SET RAM1 12:00:00
SET RAM2 00:00:00
RET
TIME:
TESTEQ RAM1 CT
GOTO MOTOR
TESTEQ RAM2 CT
GOTO MOTOR
RET
MOTOR:
SET OP1 1
TESTGE AIP1 ?????
SET OP1 0
RET

BUTTON:
TSTEQ IP1[1000] 1
GOTO MOTOR
RET

here's what I have so far. let me know if you see any glowing errors.  thanks
 
Glowing, not sure.  Glaring, maybe. :)
 
START
    CALLSUB TIME
    CALLSUB MOTOR
    CALLSUB BUTTON
END

TIME:
    TESTEQ CT 12:00:00
    CALLSUB FEED
    TESTEQ CT 00:00:00
    CALLSUB FEED
    RET
 
FEED:
    SET OP1 1
    DELAY 1000
    RET

MOTOR:
    TESTGE AIP1 ?????
    SET OP1 0
    RET

BUTTON:
    TSTEQ IP1[1000]    1   
    CALLSUB FEED
    RET
 
 
The delay after starting the motor is probably necessary to wait until the sensor goes out of alignment so that the bowl doesn't stop immediately.
 
Back
Top