Input question from a newbe


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Update and further question:

    I'm sensing the state of 6 LED's using the resistor approach which a great with 5 out of the 6 LEDs. I'm using a resistor of great enough value not to light the LED.

    The problem with one of the LED is that the sensing is unreliable (sometimes it would read the LED coming on and sometimes it wouldn't). Using a meter I found that when the problem LED was on the voltage was ~1.2V at point 2 of the original diagram where the other 5 were at close to zero. It is strange because all 6 LEDs are in the same circuit. The issue appears to be that the PIC sees the ~1V as high which makes sense.

    I did tried the lm78L05 to92 approach but couldn't stop it causing the LED to be illuminated when the LED was off.

    Any ideas?
    Last edited by Bdlhome; - 13th August 2011 at 13:35.

  2. #2
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    This forum is magic, I ask a question after spending hours trying to fix something and then within an hour I come up with an answer. The answer appears to be use a 5v zener diode is series with the resistor.

    So my next question is what is next weeks lottery numbers?

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    The one I have
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Not expecting an answer from Steve because he should have collected his winnings by now

    For everyone else; I want to track when a switch (which is in an existing circuit) is pressed and was hoping to use the same approach. The problem is the voltage is 0.7V when push to make switch is open and 0V when closed and that doesn't appear to be enough of a range.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    ADC, comparator?!? Arwe you sure it's just not a sort of open collector output you have on hand? What if you attach a pull up resistor to it.

    In meantime i'll count my millions
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Not sure what you are trying to do but 0.7v is quite low
    but if that's what you are measuring and assuming its the correct voltage why not fed it via an op amp then adc

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    the adc is capable to do the job without the opamp in this specific case though.

    (0.7/5)*1023=143
    (0.7/5)*255=36
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    For everyone else; I want to track when a switch (which is in an existing circuit) is pressed and was hoping to use the same approach. The problem is the voltage is 0.7V when push to make switch is open and 0V when closed and that doesn't appear to be enough of a range.

    Probably better for you to define track for your "0.7V" being presented to the PIC....

    1. Immediately being notified when the switch is pressed? - use a comparator with PIC's comparator interrupt.

    2. hopefully catching someone pressing a switch while polling the ADC Result very frequently? - use ADC and a tight main loop.

  9. #9
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by HankMcSpank View Post
    Probably better for you to define track for your "0.7V" being presented to the PIC....

    1. Immediately being notified when the switch is pressed? - use a comparator with PIC's comparator interrupt.

    2. hopefully catching someone pressing a switch while polling the ADC Result very frequently? - use ADC and a tight main loop.
    Both would probably work, although #1 is probably better for my project. Having said that, I'm using this project as a learning experience, so I will try both.

    Thanks everyone

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