# Comparator Capacitor charge indicator

I have a capacitor in which is used in a coilgun circuit, but i cant come up with a reliable way do indicate the charge of the capacitor without using a multimeter. I want to use a quad-comparator circuit, with 4 LED's, indicating when the capacitor is 25%, 50%, 75%, and 100% charged. I have a single comparator circuit which looks like this:

But I don't know how to power on the LED (Via the comparator output) once the capacitor has reached about 25%

• What is the voltage on the capacitor when its fully charged? Commented Sep 21, 2016 at 15:24
• Connect your separate supply - and not the capacitor - to Vcc on your comparator (and connect its Gnd to Gnd of course)
– user16324
Commented Sep 21, 2016 at 15:37
• The Capacitor charges to 197V but i am looking to increase that to around 300 Commented Sep 21, 2016 at 15:59
• I doubt you'll find a comparator able to handle 300V, so you'll need a voltage divider too. And a reference voltage which you need to create from a constant supply (that of the led). Commented Sep 21, 2016 at 16:06

HVDC measurements are usually done with a capacitive transformer or a resistive transformer ( C or R Divider ratio)

simulate this circuit – Schematic created using CircuitLab

The series element connected to the HVDC must be rated for a voltage greater than what is measured.

There are other methods which use the internal design feedback coils and turns ratio to determine the peak current of charging the cap and voltage remaining from start to finish, but not always such as CC pulse chargers with voltage doublers.

Something like this. THere are other chips with "LED bar driver" and built in comparators or use any Quad Comparator.

• I think the 25% threshold and the input voltage aren't wired correctly there. And how is the capacitor divider going to work at DC? Commented Sep 21, 2016 at 16:17
• Would the charger be referencing to the charging circuit on the Cap? Or the Cap itself? Commented Sep 21, 2016 at 16:30
• Felix , This R ratio method, I used for Lexmark Laser printer HVDC design -15kV to 22kV drum monitor and C ratio method for 200kV transformer insulation test. The 10k part may be 0k if you prefer to reduce <2.5% threshold to actually 0% Commented Sep 21, 2016 at 16:46
• The test cap is assumed to be smaller than the Capacitance of the DUT. For MVA transformers the oil is xx uF, for a coil gun it is probably 200Vdc 1mF Cap pulsed to 10-50kV with air core choke current. Coil and Cap ESR MUST be low with other small caps in parallel... so this app uses R div. with highest R values Commented Sep 21, 2016 at 16:52

Figure 1. An LM3915 LED bar indicator can be used as a voltmeter in dot or bar mode with minimal component count. By adjusting the voltage in on the signal source and the Vref signals any voltage range can be accomodated. The MODE pin allows selection of dot or bar modes.

If fewer than ten LEDs are required then leave them out and adjust the signal source and Vref levels accordingly.

Thanks for all the help guys! I figured it out and now have an adjustable comparator circuit. And there it is:

P2 is the output from the Voltage divider (Which comes from the cap) and the resistance of R3 lets me adjust the voltage at which the output from the comparator turns the LED on, and the whole circuit runs on a separate power supply than the coilgun circuit all together (10V).

You need a transistor. I'd use a N-Channel enhancement-mode MOSFET because it can be easily switched with digital voltages and the calculation for the current limiting resistor is easier.

$$R_1 = \frac{V_1 - V_{LED}}{I_{LED}}$$

$V_{LED}$ is dependent on the LED color and can be taken from the datasheet, $I_{LED}$ can adjust the brightness up to a maximum current that can also be taken from the datasheet.

For this to work, the external power source and the switching voltage at the gate need to be relative to a common ground.

simulate this circuit – Schematic created using CircuitLab