Charge indicator with comparator - very sensitive to noise

Yes, there is, add hysteresis to the comparator so the ripple is less likely to trigger the comparator from one state to the next. I used a circuit like this when I had a lot of ripple on the inputs. If your prototyping this, make sure you have good grounds and Vcc to the amp with bypass capacitors

enter image description here
Source: https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html


Add a tiny bit of hysteresis. [ edit: And increase the R_sense to ONE OHM. Plenty of headroom in that 29 volts.]

Insert 10 kΩ below that 100 kΩ resistor. That will have 2.9 V across it.

Now decide how much you want the voltage across the 15 Ω to vary.....1mV, 5mV?

If 1mV, you need 100,000/15 = 6,000:1 more variation, requiring 6 V variation at the top of the 10 kΩ you just added.

Now add a SECOND resistor from comparator output to that 10 kΩ.


You can try something along these lines:

schematic

simulate this circuit – Schematic created using CircuitLab

R7 and C1 form a low-pass filter with a cutoff frequency of 1.6Hz to filter out load spikes and SMPS noise.

R6 and R9 provide some positive feedback amounting to about 5mA hysteresis. Increase R9 if you want to increase the hysteresis.

R10/C2 balance out any bias current, and can be eliminated if the bias current is small enough.

The op-amp needs to be a low Vos type (your whole signal is ~3mV), high voltage power supply capable and with an input common mode range that includes the positive supply rail. There are some such op-amps available, but only a few.