The output should then range from 0.303V for 1KV, up to 2.424V for 8Kv.
Questions :
should I add a Zener Diode after the voltage divider to ensure the output from the divider never exceeds the input pin limit of 5V ? Or is there a better way to do this ?
Because the voltage pulses for only a fraction of a second, once per second, is the Arduino Uno capable of reading the voltage ?
Another idea that I saw only 1 post about, was to add a capacitor to the voltage divider to buffer the voltage, but I do not fully understand how this would work, as I assume that the capacitor would just keep storing more and more with each pulse, and surely must eventually fail, or need some sort of discharge circuit added to discharge the capacitor after each pulse.
Add a small signal-diode after your voltage divider, and a cap to store the voltage, then you will have a DC-voltage that shows you the peak of the voltage on the fence.
A 5,6V Zener across the cap is a good measure to insure that you don't inaverdently destroy your analog input, if the resistor-divider goes open circuit.
Recommended input impedence for arduino is 10 k ohms
The sampling capacitor takes time to charge .
Its unlikely to work without an external amplifier which will need a several hundred megohm input impedence and
Apologies for shouting, i dont know why.
EDIT
It may work if you allow the input to charge over a number of pulses before taking a reading.but someone who has moe knowledge than me about the a to d workings may have other ideas.
I have done something similar to monitor 300 to 500 v charging of a photoflash type circuit but the values for peak volts were nowhere near the spikes seen on an oscilloscope.
The zener is essential, if the divider goes oc it s unlikely to protect the arduino anyway.
But fences can have unusually high spikes that could still exceed the 5v.
I ended up using a plug in sacrificial amplifier to protect the arduino during development
So what I have now is this ( please see attachment )
Can anyone please confirm if I am on the right track with the diagram ?
I have sourced the resistors and already have the 1N4007.
But I do not have sufficient understanding to know what rating components to use for the capacitor and the Zener.
My understanding is that the output from the voltage divider should range from 0.303V for 1KV, up to 2.424V for 8Kv. The capacitor will simply store, over a few pulses, the input voltage from the divider ( so it won't exceed the input voltage, but would take a few pulses to get up to the input voltage ).
The Arduino would read the voltage from the capacitor ( result is 1KV for each 0.303V in the capacitor ).
Would I need to add a manual discharge circuit for the capacitor ( cap '+' terminal to a push button switch to a resistor to ground ) to discharge the capacitor after reading the value ?
Or could a 2N2222 or simplar NPN transistor, controlled by a High Output Pin on the Arduino, replace the manual push button above ?
That way, I could let the capacitor charge for, say, 6 seconds ( 6 pulses ), read the capacitor voltage on the Arduino Input Pin, and then program the 2N2222 transistor Output pin HIGH, for say 3 seconds ) to ground and discharge the capacitor.
The capacitor will never charge to more voltage than there is across the 60k resistor, minus 0.7V. But that means that you won't get any reading until the electric fence voltage gets above 2kV.
It would be better to put the diode in series with the six 33Mohm resistors, but then it has to withstand 8kV. In any case, if the pulses on the fence are high enough frequency, a 1N4007 may be too slow.
The point behind the diode is to charge the capacitor to a DC voltage from the AC pulses on the fence, yes?
So instead, how about an Op Amp connected as a precision rectifier? Use a fast small signal diode like a 1N914 or 1N4148 in this circuit, an LM324 or LM358 can go down to the ground rail in a single supply configuration:
An NPN transistor can discharge the capacitor to reset the circuit and you can then leave the 10k resistor out.
8000v across 6 resistors. That's around 1300volts per resistor.
Most "standard" resistors will tolerate a couple of hundred volts or so, certainly not voltage in excess of 1000. It's nothing to do with power dissipation, it's all about voltage rating.
You will need to source "high voltage" resistors.
That looks like a good resistor. I would not put them on a PCB, especially not a phenolic board. Solder together in a straight line, careful not to leave points sticking out.
You might coat the soldered connections with high voltage liquid tape, called "corona dope".
Do not expect the zener to behave as expected under this circumstance.
Hv pulses will cause spikes on the gnd rail to be induced depending on layout.
They may be very fast and high voltage.
The foward conduction of the zener is needed to protect from this.
Consider recovery time.
The device specifications are unlikely to give the required information in thiese circumstances.
You could have spikes which are unobservable on a scope but will puncture an fet.
This was a well known problem with gasfets some time ago, under these conditions it could easily apply to fets.
Short pulses, high impedance divider, there's a problem here:
Stray capacitance forms a low-pass filter with the high value resistances reducing
the speed the output voltage can track the input pulse.
For instance with 200M resistor and 5pF stray capacitance you have a time constant
of 1ms. If the pulses are less than a millisecond then this isn't going to work.
You also have to consider the loading effect of the potential divider on the voltage
source - without knowing the impedance of the source its hard to know how important
this is.
I'd suggest abandoning a resistive divider in favour of a capacitive divider, although
it will be hard to find an accurate valued high-tension capacitor, it isn't too hard
to make one(*). Something like a 10kV rated 1pF capacitor and a 2.2nF capacitor to
ground. Then a 10k resistor to the analog pin (protects from over voltage). A bleeder
resistor of 100M across the 2.2nF capacitor will prevent charge build-up over time but
not affect short pulses.
(*) small areas of aluminium sheet in a sandwich with some polythene or teflon plates.
Mine uses a resistive ,capacitive arrangement similar to a scope probe , and im only working at 400 v.
Without it the comparator does not give stable results.
Fwiw i think fence output is measured in uS.
Edit, accurate values are not needed but the ratio of R1/R2 should be roughly equalto the ratio of C2/C1.
Something iv been meaning to try , use double sided pcb .3 mm thick for one of the caps.
Fairly big use of board though.
My requirments are more modest than yours , max of 2 kv.
I would be very interested in details if you are succesful.
Out of curiosity, do you need to measure the actual fence voltage in volts, or do you just want a measurement that is roughly proportional to the fence voltage? If the later, you may have some other options.
The high voltage recommendation are all good advice.
A couple of thoughts:
Might there be a lower voltage inside the HV controller to sense the voltage? Perhaps on the primary side of the transformer?
You mentioned a "fraction of a second" pulse. Do you have any idea how much of a fraction it is? I'm thinking this is like an automotive ignition coil (or at least the old ones). The collapsing field of a coil will generate the high voltage. It may be difficult to get a stable reading if this is the case.