Hello everyone,
I’m trying to measure the output voltage of a DC generator using a voltage divider connected to an analog pin (A1) on my Arduino. The voltage divider uses 30kΩ (R1) and 7.5kΩ (R2) resistors, designed to scale down the voltage to stay under 5V.
Here’s the setup:
DC Generator(with positive and negative terminals)
Voltage Divider: connected in parallel with the generator output
The divider output is connected to A1 on the Arduino
An ACS712 current sensor is in series between the generator's positive terminal and a lamp (load)
The issue:
When the generator spins fast (high RPM), the measured voltage drops to 0V or near 0.
But when the generator is not spinning or spinning slowly, the voltage reads correctly (typically 1–4V).
What I’ve tried:
Measuring the voltage divider output with a multimeter during high RPM: shows correct voltage (not 0V)
Here’s the code I use for reading the voltage:
int readADC(int pin, int samples) {
long total = 0;
for (int i = 0; i < samples; i++) {
total += analogRead(pin);
delayMicroseconds(200);
}
return total / samples;
}
adc_value = readADC(A1, 50);
voltage_adc = (adc_value * 4.95) / 1024.0;
input_voltage = voltage_adc * (r1 + r2) / r2;
What are the solutions of this problem?
Any advice or recommendations would be greatly appreciated ![]()
Thanks in advance!