3

I would like to know if someone has experience with measuring high voltages using an Arduino.

I know you can use resistors to lower the voltage, however.

I want to be able to measure the pulses of an electric fence used to prevent farm animals from escaping. These pulses are high-voltage and will not always be a similar voltage. I want to read these voltages, to scan for differences.

So, I wondered if someone has done something like that, and if the Arduino gets weird when it gets a voltage above 5 V at a low amperage on its analog port.

--here some possible solutions for those wanting to know the answer-- -mostly based on comments and answers below-

  • Using resistors as a voltage divider while keeping an eye on the maximum spark gap distance and capacitive coupling.
  • using a transformer/coils to reduce the voltage.
  • using a high voltage probe to measure it.
  • using neon bulbs or other light sources to measure it.
  • charging a capacitor and measuring discharge time with high resistance(only works for the total power)

-this list is meant as a summary of what is discussed further ideas and solutions are still welcome-

ocrdu
  • 1,673
  • 2
  • 9
  • 22
TeD van Loon
  • 119
  • 6
  • 1
    Duh, that's typically a couple thousand volts. I fear a simple resistor won't do, since the voltage is high enough to cause severe interference or jump trough the air. And that would destroy your equipment quite spectacularly. – PMF Feb 03 '21 at 14:25
  • Do you really want to measure it, like proportionally, or just see that it's still operating? – timemage Feb 03 '21 at 14:36
  • 1
    I don't think that the high voltage is the problem. I grew up on a farm in Germany and There were many occations to experiment with el. fences, when I was a child ;-). The voltage is not high enough to "jump" over more than a fraction of a millimeter, and that only with a perfect ground. I would say the only thing that jumps is the farmer if, he touches the fence. Yes, I've tried it. Yes, I jumped. – Peter Paul Kiefer Feb 03 '21 at 15:12
  • One of the problems is the variations in the voltages. You can be sure that all pulses are of the same amount. You could build a voltage divider, sometimes it is sufficient, sometimes not. The next problem is the length of the pulse, How can you be sure you get the peak voltage, if you only take probes at discrete times? So I would say the arduino allone is not fast enough to give you reliable results. – Peter Paul Kiefer Feb 03 '21 at 15:12
  • 2
    If you are fit in electronics, build a voltage devider with two high watt, low value resistors. Add a peak detektor to it and meassure the voltage with your arduino. Use a 5V Zehner diode to protect the Arduino pin from high voltage. Zehner diodes are slow, so you might want to use N shottkey diodes that add to about 5V. – Peter Paul Kiefer Feb 03 '21 at 15:13
  • 1
    i think that you can buy a fence tester that contains a neon bulb ... use a photo sensor to detect the light from the lamp – jsotola Feb 03 '21 at 16:05
  • 1
    @PeterPaulKiefer: at 10kV, the pulse can build a spark of at least 10mm, which is absolutely significant given the physical size of a breadboard or a resistor. – PMF Feb 03 '21 at 16:22
  • 2
    Typically you would use a long chain of resistors. The voltage across each one is then below the maximum rated voltage for that individual resistor (and any distances involved). However a transformer may be a better solution to give galvanic isolation. – Majenko Feb 03 '21 at 16:31
  • 1
    @PMF A 10kV signal with a high frequency can do that (e.g. Tesla coils). A single pulse has not the power and not the time to to ionize the air. The pulse can create a high potential electric field, but the wires are too small to take much voltage from that. If you keep the arduino 10 cm away from the fence wire, the field has nearly no impact. A direct voltage coupling whith a voltage devider is the only way to build a cheap measurement solution, as long as you get it to measure fast enough to find the pulse peak or use a peak detector. – Peter Paul Kiefer Feb 03 '21 at 16:40
  • Using a trafo is diffficult, because you have no sine wave, so the trafo has impact of the shape of the signal. Then it gets difficult to reconstruct the peak. And as I understand, the different peak voltages of the pulses are the goal of this exercise. – Peter Paul Kiefer Feb 03 '21 at 16:40
  • Ahh, one thing I forgott to mention. Of cause the Arduino is not the only one who is in danger. 10kV (even a short pulse) can kill you. E.G. if your the owner of a weak heart. So, be carefull. – Peter Paul Kiefer Feb 03 '21 at 16:44
  • @PeterPaulKiefer I just want to throw in another point: you don't need to measure pulses. The voltage on an electrical fence is static: when touching the wire, you get a shocked immediately - you don't need to wait for the next pulse. Pulses are only used to recharge the fence's capacity. – Sim Son Feb 03 '21 at 17:48
  • @SimSon As soon as you add the voltage devider to the wire it will be discharged. You will only get the peak voltage at the peak of the pulse. You need to meassure exactly at the peak of the pulse or you use a peak detector, if you want to measure the differences in the peak voltage, like IMHO the OP asked. – Peter Paul Kiefer Feb 04 '21 at 07:06
  • In my experience electric fences put out high voltage AC. That's the easiest, low-tech way to boost voltage, after all - a transformer many time more windings in the secondary than in the primary would boost an AC input to high voltage quite simply. – Duncan C Feb 04 '21 at 21:37
  • 1
    https://forum.arduino.cc/index.php?topic=18043.0 – AFract Feb 05 '21 at 07:37
  • While my question describes an electric fence to make it more usable and understandable for everyone, the actual system uses a specific coreless coil for self-inductance. it runs from 12v and is meant to detect objects that respond to the magnetic or electromagnetic charge. since the coil itself has quite high resistance(+-50 ohm) the output current and voltage are quite safe and below an actual electric fence. I can make sparks with it to the battery terminal by slide-disconnecting it I get at most around 2mm sparks(see st. jacobs ladder). normal sparkgabs work up to around 0.1mm at most. – TeD van Loon Mar 04 '21 at 14:53
  • 1
    @timemage I need to actually measure it to detect the difference in self inductance. so I can use that to detect objects and their relative distance/location. – TeD van Loon Mar 04 '21 at 15:10
  • @PeterPaulKiefer perhaps I might be able to get it stable enough with some small capacitors then I can measure the total energy instead of the voltage which in this case should give good results as well that way I stabilize the highest peaks and it might better suit the arduino's peak. – TeD van Loon Mar 04 '21 at 15:13

2 Answers2

4

You are talking about measuring 2 to 10 kV pulses, with about 1 to 5 J of energy per pulse.

The maximum current may be very low, but the voltages you want to measure are very high, and will very probably damage your Arduino without proper measures.

You will at least need a voltage divider to reduce the voltage the Arduino sees to 5 V (or 3.3 V for some Arduinos) to be able to make a measurement with the Arduino's ADC.

The voltages are high enough to bridge a fair distance with a spark; they could well bridge a physically small resistor or the distance between two connections on your breadboard or PCB.

To be honest, I think you shouldn't go anywhere near such voltages with an Arduino, unless you know exactly what you are doing when preparing the signal for an Arduino's ADC pin.

ocrdu
  • 1,673
  • 2
  • 9
  • 22
  • Consider purchasing a high voltage probe for a VOM. They are very high in resistance, if you go low you will drain all the energy out of the fence. Nice part they are designed for this type of voltage, not a kludge device. This would go in series with a load resistor then measure the voltage across the load resistor which has one end grounded to the fence ground. International code limits the voltage to 10KV some countries it is lower. – Gil Feb 03 '21 at 17:29
  • I think perhaps I might make a transformer like some have told in the comments, and then use a divider with extra isolation. some peak detection would be great however in a way where it would only pass through the highest differences. I was also when starting to think about this project thinking about designing my own computer for it or using analogue equipment, however, I thought that Arduino would be great to use because I can also easily perform all other kinds of instructions. – TeD van Loon Mar 04 '21 at 14:37
  • @Gil I will try that, I have some laying around anyway so testing it would be great. I might also try making a custom one since that would make it more readable and less tape and wire. – TeD van Loon Mar 04 '21 at 14:41
0

When you say 'scan for differences', do you mean differences along the fence, or something else? Do you plan to use the Arduino as a portable voltmeter? If so, buying a HV probe for a standard voltmeter sounds a lot more practical.

However, if you plan to install multiple sensor points along the fence so that you can continually monitor pulse amplitudes along the fence, then that is a different kettle of fish, especially if you are thinking about outdoor use over a long fence length.

Can you elaborate a bit, please?

starship15
  • 666
  • 4
  • 9
  • I mean to use a system similar to an electric fence. but more compact and coil like to use the self-inductance to measure changes in nearby metallic or water like objects. since in versions where I manually feel for the differences in shock values it seems to respond really good to metals where a simple coil would give clearly feelable different shock intensity when I introduced small metal objects, at ranges my commercial metal detector can not even detect them. – TeD van Loon Mar 04 '21 at 14:33
  • Note that the coil I use at the voltage and the maximum allowed charge and discharge time cycle is tuned to be rather safe even when put in massive cast iron. I would of course not recommend anyone to use its hands at a high voltage circuit, especially when not sure it is tuned properly to around half of the intentionally dangerous values. – TeD van Loon Mar 04 '21 at 14:57