# Car window motor control output

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.

• What is the source of 12V? How do you kow that is can supply enough current? What voltage is it supplying when the motor sees 1.5V? If you disconnect the motor, what voltage is across the H-Bridge outputs? How are you measuring the voltages? Are you certain there are no other differences between your circuit and the one at the URL? Could you provide photos so that we can verify the circuit? – gbulmer May 25 '15 at 9:59
• 12V comes from a variable power supply, and it should thus supply enough current. 12V is supplied when the motor sees 1.5V. If i disconnect the motor, there is 0 volt across the H-Bridge outputs. I'm measuring the voltages with a multimeter. – Benjamin May 25 '15 at 10:05

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.

• The power supply is a variable power supply, and can move the window without problems when i connect it directly. The problem appears when i connect the arduino and h-bridge between the motor and the power supply in order to be able to control the motor from my computer. – Benjamin May 25 '15 at 10:17
• @Benjamin What kind of H-bridge are you using? The parts listed in the link (L293 and SN754410) are rated for max 1A load (maybe a little more during peaks). As Brian said, if the stall current is higher, the H-bridge won't be able to provide it and the motor won't start. – Lorenzo Donati -- Codidact.com May 25 '15 at 11:15
• Yea i edited the main post about the bridge and the current, it is indeed max 1A, however i do not currrently have any other bridges to test with. I was wonder though, since it's a bridge for 2 motors normally, is it possible to somehow bridge it to output 2A for 1 motor? – Benjamin May 25 '15 at 11:59
• We still don't know the stall current. Another way to measure it is to stall the motor while running off the supply - if the supply doesn't hit its current limit first. – user_1818839 May 25 '15 at 13:01
• The stall current is around 2A – Benjamin May 25 '15 at 13:10

Old post, but i ended up using an arduino motor shield for controlling it, which worked perfectly.