Author Options:

Arduino high voltage capacitor charge indicator? Answered

I made a 330v gauss gun and wanted a way how to know when capacitors charge, at first i took an led and resistor, that worked but is kinda boring. I want to use arduino and lcd to display percentage which should look more cooler. How should I measure the capacitor bank voltage with arduino? Should I use voltage divider? or there is a better way?



2 years ago

Yeah, you'd need a voltage divider for the ADC on the Arduino. Make divider resistance values appropriate to reduce the max voltage (330V) to 5V for the ADC.

Or whatever works with your Arduino -- with many new boards operating at 3.3V, I'm not sure if 5V is the correct ref voltage for all Arduinos (it would certainly work with the AVR based boards).

Well I guess I gonna try, lets hope i don't blow any arduinos

sadly the voltage divider resistor heats up and as you may know hot resistors change value.(BTW the 0.5w resistor burned out)

Why not stick to your LED design and measure the voltage drop on the LED?
If your need such big resistors to measure if the caps are charging then you waste more energy on heat than charging...

To cover all angles, the LED indicator is still a voltage divider. An average LED (3V max forward V, 20mA max current), would need something like 4mA to be dimly lit. The series resistor, which has to drop ~327V to keep within the forward V, must draw the same amount of current as the LED (works out to be something like 82K ohms, 1.3W). That's a fair amount of wasted power. And that's best-case, for a dim LED.

A well-designed voltage divider would draws much less current, with the side effect of a faster-charging circuit.

Just my two pence.

A divider (and the ADC) doesn't need small value resistors -- only a tiny amount of current is needed.

Use something like 500K and 6.8K for the divider, that's ~370V -> 5V, and only draws 0.0007A.

It seems ok, 10w 16.8K (themperature goes up to 50.8 C) resistor and 0.25w 220R resistor seems fine, everything works, now im going to work on the code

That should draw about 20 mA at 330V. Probably a factor of 10 more current than you need, but reasonable for your test.

just noticed that capacitors charges only to 250v and when the charger is turned off, the voltage quickly drops. I guess im going to need to buy bigger value resistors :(

Yep. Adding the divider (at those values) draws enough extra current to drop the supply voltage, so your HV is fairly low-current supply. Start with 10X those values (20x or more would work). At 10x res values, you're still looking at 3/4 of a watt, so 1W resistors would work.

The 500K / 6.8K div would still probably need 1/2W resistors.

Your divider will also act as a safety feature. When the power is cut, it will bleed off the charge in a minute or two (longer with the greater resistance).

Add a little extra "headroom" to the divider -- set values for 400V -> 5V.

I've had success using a current-limiting resistor on AVR ADCs. Add a 250K or 500K resistor between the divider and the ADC. It's a little bit of insurance against transients. Those ADC inputs are really high-impedance, so it doesn't effect the measurement too much, other than slowing it down slightly.

Good luck.

Same way as with the LED, just measure the voltage drop ;)
Needs a little table to get really accurate readings but if it is only to check when full and all between does not matter you only would need a few lines of code.
Check the Arduino code pages for "voltmeter" ;)

Seems flawless but arduino draws almost no power (few microamps) to measure the voltage, it wont be much of a drop. Unless you are talking about also connecting the led, then in theory it should work but in real life, i burned 3 resistors doing that