I have a 1000vdc signal which I am putting through a voltage divider (200Kohm, 1Kohm) to step down to 5v. I have verified that only 5V comes out. I have calculated it should be 5mA. When I apply this 5V to input pin 13 of my Arduino, I get random results. Sometimes it goes high, then stays high even after I remove the signal, sometimes it works if I go to ground with my 5V, sometimes it goes high if I wave the 5v around in the air next to pin 13, sometimes it does nothing. It seems to work better if I hold the arduino in my hand. I read somewhere about pull-up/pull down resistors and I think this might be my problem, but I don't understand them (What they do, why I need them, where to connect them, etc). So, what's the deal?
BTW I did have the 1kv source ground connected to arduino ground.
Well pin 13 has an internal on board led and resistor wired to it. Perhaps that is loading down your divider. Why don't you try another pin. You know that 1kv is a pretty risky thing to have wired to an Arduino, divider or not, if the 1k ohm resistor ever opens or gets disconnected your board will be overdone toast. If ever a application could utilize an opto-isolator this is the one.
RetroLefty: An opto-isolator, as in my 5V going to an LED, and a photoresistor coming from my arduino?
- only a few mA, it's a megger. But in the future, when I get everything the way I want it, I am going to swap in a 1kv DC/DC converter which should be higher.
- Yes, for this specific thing, I am only looking for high/low. In the future I may consider trying this same thing on an analog pin to get a rough measurement (obviously not a very accurate one).
- Yes duemilanove.
- roger. I was using pin 13 specifically for the LED so that I could tell if my little scheme was working, without adding anything extra. Never thought about the fact that it might be messing me up. thanks.
Why lower resistance value? I picked 200k so that the amperage would be low and so that any variations in the 1kv would not have a dramatic effect on my +5v. Did I go overboard?
Would the protection diode mess with my +5v? does it drop a set voltage?