Hi, I’m trying to connect a ACS711 current sensor carrier (+25A to -25A) to my (6V) motor. I’m using a Baby O, motor driver 18v15 and this current sensor to stop the motor when the motor draws more then 5.5 A.
I’ve been trying this code, but it doesn’t seem to give good measurements.
CS = (((analog_read_average_millivolts(2, 64) - 2500) * 1000) / 55);
if (CS > 1100) // Current Sensor measures more then ... A over motor
{
set_digital_output (IO_B2, HIGH); // LED ON
}
I’m checking the output of the current sensor with a LED and the if-statement in the above code, to see when the current sensor rises above a certain value.
I know my motor draws about 400 mA when it’s free running. But my coding gives a value of more then 1 A. with the current sensor. If I raise the amps in the if-statement and brake the motor it doesn’t seem to measure anything.
I’ve connected one side of the motor to IP- and one side to OUTB of the 18v15. IP+ is connected to OUTA of the 18v15. Vcc and GND of the current sensor are connected and OUT is connected to PC2 of the Baby O.
What am I doing wrong?