Automatic Toilet Flusher


Closed Thread
Results 1 to 40 of 99

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Maybe this can work better in case it is only code problem
    Loop:
    If IRLED1 =1 then
    for a=1 to 100 'allow several pulses for the servo to reach the requested position
    Pulsout 0,140 'could be 100=1ms to 200=2ms
    pause 10
    next a
    else
    pulsout 0,150 '150=1,5ms middle position
    pause 10
    endif
    Goto Loop



    Also check your servo if it is damaged since you power it with 9V instead of the usual 5V most RC servos work.

    Bill

  2. #2
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Thanks

    I appreciate it

    Although the servo was modified along time ago for continuous rotation,
    Although it still works

    5volts is actually low for a servo, that's the lowest amount of voltage you can imply.
    In the book I own PIC basic projects
    it has a servo page and it states that servos can run from 5vdc to 9vdc and 5volts was not recommended.

    I tested it out and it works fine

    I believe for it to be the sensor

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Post the code you are currently trying.

    Write the code to make a pin high or low output. No pulses for testing and use an LED instead of the servo.

    What is the voltage at the sensor out put when connected to the PIC?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Doesn't RBO and RB1 and so fourth supply 5+ to the pin?

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Techbuilder View Post
    Doesn't RBO and RB1 and so fourth supply 5+ to the pin?
    Yep, at roughly 25mA per pin, at MOST! Try to draw any more than that, and you'll end with a pin that won't supply squat.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Techbuilder View Post
    Doesn't RBO and RB1 and so fourth supply 5+ to the pin?
    In your case RB0 is an input so it is looking for 0 volts to 1.2 volts for a LOW and 3.6 volts to 5 for HIGH. It is best to use a pull up or pull down resistor so the pin will be 0 or 5 and not floating around. Another part or two but I like using external pulls and not rely on the internals.

    So, when the sensor is sending its high signal to the PIC and connected to the PIC, what is the voltage.

    Try making the pin high or low with out the sensor.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Ok so I tried it with an led and it was working so I am guessing it is the servo
    the potentiometer must be broken in the servo

    When I get the new servo in the mail I will try it out

    thanks everyone

    by the way once everything works I will put up a "How to" for this automatic toilet flusher
    once I am done.

    Just in case anyone else wants to build it

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Glad you found the problem!

    Just curios, what servo are you using?
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Automatic 240V / 110V selector
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 13th October 2008, 01:33
  2. LCD automatic management?
    By ruijc in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th September 2008, 12:24
  3. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 08:57
  4. Automatic turn off
    By AMay in forum Schematics
    Replies: 22
    Last Post: - 6th February 2006, 13:31

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