I need your help…bad.
I have a brush DC motor with a PWM controller to manage motor speed (the pwm uses mosfets to send the flyback voltage back through the motor and switches at 20K). The power source is 2 x 12 VDC batteries in series (size is what you would find in a motor cycle). All works well. I’m trying to measure volts, amps, and RPM using an arduino. I have a buck converter hooked to the battery (24 VDC) and dropping the voltage to 5VDC and connected to +5 to power the arduino, and i’m using a simple voltage divider to drop the 24 VDC to around 4 so my arduino can read the batttery voltage (then in software i compute the voltage based on R1 and R1), note my voltage divider is connected directly to the batter, no filtering. My amp meter is a hall effect sensor with a low pass filter to smooth the output signal.
I have several issues
My issue is the arduino “locks up” and I suspect is just spiky, noisy voltage caused by the motor and controller. I added a home made inductor (wire wrapped through a washer, and connected it in series to the ground (read that tip somewhere) and while the arduino no longer locks up, it does restart (as if the battery were unplugged and plugged in again. I still suspect the issue is very spiky voltage caused by the pwm controller and motor. I can only hope my buck converter is filtering out all the junk, but I now suspect connecting the noisy battery directly to the arduino input w/o any type of filtering, may be causing issues.
a plot of the input voltage (the ~4 VDC signal from the voltage divider) over time is a sine wave with about .05 volts peak to peak–again I suspect its due to the noise and spikes of the pwm controller. The sine nature really makes me suspicious.
I’ve tried dozens of things like shielding wires, twisting wires. etc. maybe i can
- add a low pass filter to the positive (before the buck converter and the input to the voltage divider
- connect the power and voltage measurement the the point between the batteries (12 VDC).
It feels like #2 will give the cleanest DC signal because one large battery should isolate the spikes, but this is a bit over my head.
Thanks in advance.