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

    Now I really am going mad or just confused...

    By playing with components I got the circuit to work until I put it everything back together and it then stopped working reliably. Then I noticed something very strange, in my workshop it worked more reliably with the lights on! Which was the difference between the old boards that worked and the new ones that didn't, the new ones were in boxes!!! I initially thought noise or perhaps moving wires with bad connections etc. But no, I can have the circuit not working with lights out and then turn the lights on from the other side of the room and hey presto....

    That would also explain why it worked with the courtesy light on!!! Are zener diodes light sensitive?

    Any thoughts on how I can make this reliable without being sensitive to light!

    To remind every what I'm doing:
    I'm monitoring LEDs that are switch on by the car switching to ground (they are permanently fed with +12V accessory circuit). Monitoring the point after the LED which is grounded by the car it is ~12V when LED is off and then ~1V when on. Going through a fairly large resistor to stop the car LED glowing dimly and then through a zener diode to drop the voltage closer to 0 when LED is on the circuit appeared to work.

    However there are two problems:
    1) The circuit appears to be sensitive to light - Works when board is subjected to light
    2) When the engine is running the voltage at the LED with LED ON ranges from .8V-1.4V, I added the zener diode to deal with the fact it was 1V rather than zero but those spikes to 1.4V appears to be enough that even when going through zener diode that the PIC sees the input as positive.

  2. #2
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    Now I really am going mad or just confused...
    My money is on "going mad"

    To my knowledge no zener diodes are light sensitive, the LED you are monitoring could react to the light, I don't think that is your problem here though. Perhaps you could put up your code you are using. Do you know how these LED's are being controlled? Something different with this one? What value resistor "fairly large" are you using?

    I would simply read from the LED cathode through a 10K resistor to the input pin. Put a 22K resistor pulled down to ground also to that input pin. You may be able to use lower values on the resistors without the pull down resistor turning on the LED, but I would think this would work. Hope this helps some...
    Shawn

  3. #3
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    You are probably on the money but very strange indeed, I'm happy to be declared mad if I can solve this

    I will post the code but don't think it is code related as simply reading the state of RB4. I don't know exactly how the LED's are being controlled other than from reading the basic circuit diagram available and metering of the circuit (I know the car diagrams are not very accurate because as an example the switches are all show as straight push to make but one actually has a 1K resistor is series). I've played with various values of resistors and need >1M to get the results expected. What I don't have is a resistor pulled down to ground and will go and try what you suggest now.

    There is definitely something different with this one LED because the other 5 read fine and I swapped the inputs and the problem moved with the LED which is why I don't think it is code or RB4 related.

    Thanks again and will report back soon... I will probably need to test in the morning as I need to run the car to test properly and my daughter is in bed.
    Last edited by Bdlhome; - 8th January 2012 at 04:02.

  4. #4
    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 spcw1234 View Post
    My money is on "going mad"
    I would simply read from the LED cathode through a 10K resistor to the input pin. Put a 22K resistor pulled down to ground also to that input pin. You may be able to use lower values on the resistors without the pull down resistor turning on the LED, but I would think this would work. Hope this helps some...
    spcw1234: I owe you a beer or three! 10K on the input and 22K to ground worked but the dim glow on the LED was very noticeable. However 120K on input and 220K to ground seems to work without the glow.

    I was sure I actually started with that approach but had two problems that I recall;
    1) The LED glowed dimly unless I went very high with resistor value
    2) For what ever reason it didn't seem to work with the engine running or at least not reliably.

    Still need to do some more testing but looks good so far.

  5. #5
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Sounds good!
    Shawn

  6. #6
    Join Date
    Jul 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    This project is determined to drive me mad..

    Seeing that you are on a roll, I have another question if you don't mind.

    Testing was going well until the circuit stopped working all together. On checking the PIC was getting power etc so I tried reflowing the solder on a few points and it started working again. It would work for a few minutes out say 5-10 minutes later I would power on and nothing. This appears to be repeatable, could the 22pf caps or 4Mhz Oscillator be working due to the heat caused by resoldering? I only ask that because there doesn't appear to be anything wrong with solder joints, so I wondered if it is the heat that is causing the circuit to work? I'm going to try swapping out those components and see what happens.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    If improper solder is the problem, put the board through some simple tests: freezer for a minute, test, under halogen lamp for a minute, test.

    I'd start by melting all the joints with the solder tip (or reflow oven if you have that). It does sound like you have a bad solder. Heat makes metal expand and bridge small gaps.

    Robert

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Input question from a newbe

    Quote Originally Posted by Bdlhome View Post
    ... On checking the PIC was getting power etc so I tried reflowing the solder on a few points and it started working again. It would work for a few minutes out say 5-10 minutes later I would power on and nothing. ...
    After rereading your post, I wonder if the PIC could be damaged internally? Since you appear to have a heat gun, try applying a little heat just to the center of the PIC.

    Is it possible that you abused the chip somehow, maybe a little too much current on a pin?

    I've messed up PICs before by forgetting little things like current limitting resistors, short circuits mishandling test leads, etc. LOL The PIC would sometimes keep on working, but not reliably.

    In some cases the damage would be limitted to just that port, everything else would work fine. They really are tough little buggers but there's only so much abuse they can handle from people like me.

  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 Demon View Post
    After rereading your post, I wonder if the PIC could be damaged internally? Since you appear to have a heat gun, try applying a little heat just to the center of the PIC.

    Is it possible that you abused the chip somehow, maybe a little too much current on a pin?

    I've messed up PICs before by forgetting little things like current limitting resistors, short circuits mishandling test leads, etc. LOL The PIC would sometimes keep on working, but not reliably.

    In some cases the damage would be limitted to just that port, everything else would work fine. They really are tough little buggers but there's only so much abuse they can handle from people like me.
    I don't think it is the PIC but I've been wrong before - you only have to read this thread for examples

    When using the soldering iron on just the oscillator pins I don't think there would be enough heat transfer through the tracks and PIC socket to have an effect on the PIC itself. By the way I'm using through hole components and not surface mount.

    I've just replaced the OSC and everything now appears to be working, so either a bad solder joint as you suggested or the component itself. I'm going to try the OSC I removed in another circuit to see if I have the same problem.

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