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.
Bookmarks