Car window motor control output

arduinodc motorh-bridgemotor

I'm toying around with a car window, and used this tutorial to try and make it work:
https://itp.nyu.edu/physcomp/labs/motors-and-transistors/dc-motor-control-using-an-h-bridge/

I've set it up almost exactly as the tutorial says, however i supplied 12v as i've found that's what the control motor needs. Furthermore i removed the switch, as i want to control the motor movement directly from the code.

However, when i turn on the arduino and the power supply, the window only moves a little; quickly slows down and then stops (i can still hear the motor trying to work though). I measured the output to the motor while running, and it seems it's only getting around 1,5V from the h-bridge in the start, and it drops while running.

The arduino code i'm using is very simple:

const int controlPin1 = 3; // H-bridge leg 1 (pin 2, 1A)
const int controlPin2 = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin

void setup() {
 pinMode(controlPin1, OUTPUT);
 pinMode(controlPin2, OUTPUT);
 pinMode(enablePin, OUTPUT);
 digitalWrite(enablePin, HIGH);
 digitalWrite(controlPin1, LOW);
 digitalWrite(controlPin2, LOW);
 delay(10);
}
void loop() {
 digitalWrite(controlPin1, HIGH);
 digitalWrite(controlPin2, LOW);
 delay(1000);
 digitalWrite(controlPin1, LOW);
 digitalWrite(controlPin2, HIGH);
 delay(1000);
}

The motor runs just fine when connected directly to the power supply (where i manually reverse the polarity), but it just won't work properly through the arduino + h-bridge.

I'm quite rookie to electronics, so it might be a rookie mistake i'm into. But halp pls.

EDIT: I realised that when i plug it directly to the power supply the current is around 2 amps, but when i plug it into the h-bridge the current starts out at 1 amp and then decreases. So it might be a current problem, however i do not have any other bridges to test with right now.

Best Answer

A car window motor is surprisingly beefy for its size : that means it takes quite a lot of current. Which is OK because it never runs long enough to overheat.

Measure the DC resistance of the motor. (Several times, turning the shaft, choose the lowest reading).

Divide 12V by that, to get the motor's stall current, and edit that into the question. I'm guessing something like 6 to 10 Amps...

As your motor is stalled, it needs that much current to move, which your bridge is not supplying.

Replace your H-bridge and power supply with ones that can supply at least that stall current, and try again.