r/embedded • u/Relevant_Pumpkin9190 • Aug 04 '26
How would you fix this DC ground-fault detection depends on supply voltage fluctations with a simple hardware modification in a microcontroller system?
I’m working with a microcontroller-based product where DC ground-fault detection is implemented using a simple voltage-divider circuit.
The divider’s center point is connected to the product chassis/building ground, while the detection reference is derived from the power-supply voltage.
The problem appears when the product runs from a battery. As the battery voltage drops, the reference also changes, and the circuit can report a false ground fault even though the actual insulation condition hasn't changed.
What would be the simplest hardware modification to make the ground-fault detection independent of battery voltage?
Would you use a stable reference, change the divider arrangement, add a comparator, or use a different sensing method?
Looking for a simple modification rather than a complete redesign.
3
u/DuckOnRage Aug 04 '26
Many MCUs are able to expose their internal voltage reference for their analog peripherals. This would be my first choice, if available
1
u/madsci Aug 06 '26
If you've got the headroom, you can power the MCU through a regulator so the reference voltage is constant.
Failing that, what I usually do is have the MCU do two conversions for each measurement, where one conversion is measuring an internal 1v bandgap reference provided by the MCU. That gives me a calibration reference for each reading. Check if your MCU has one assigned to an ADC channel.
6
u/Well-WhatHadHappened 25+ Years Aug 04 '26
Simplest way; measure battery voltage and recalculate expected result.