I'm using an Arduino Uno, a DBH-12 Dual H-bridge motor driver with a 12v dc motor. There is a spool on the motor shaft and when the motor is being driven, a string is being wound around the spool. The string is at the same time being run over a pulley and pulled in the opposite direction by weights hanging off the table. When I stop the motor, I need the motor shaft to have as little friction as possible so that the weights can pull on the string and unwind the spool fully. However, when I stop the motor, the shaft of the motor is hard to spin as it's magnetised (I think) so the weights can't fully unwind the spool. I've used a multimeter on the output terminals of the motor driver to see if there's any voltage when I stop the motor. The multimeter shows 0 volts but for some reason the motor shaft is hard to spin (so there must be current running to the motor?). When I completely disconnect the motor from the driver, the shaft becomes easy to spin again. Why is the shaft hard to spin even though the driver is providing 0 V? I can't keep physically connecting and disconnecting the motor from the driver so it would be nice if I can completely demagnetise the motor to allow it to freely spin using code. I could also use a relay but it would also be nice to not need more hardware to do this. Here's the code I'm using to stop the motor:
#define IN1A 3
#define IN2A 5
void setup() {
}
void loop() {
analogWrite(IN1A, LOW);
analogWrite(IN2A, LOW);
}
Here's a sketch of my setup:
Link to driver: 1pc DC5V-12V 0A-30A Dual Channel H Bridge Motor Driver Board Module Durable | eBay
Link to motor: High Torque DC Motor 6V 12V 24V High Speed Reversible With Encoder RS555SH | eBay
Wiring: