Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

H-Bridge Question

I'm a newbie when it comes to electronics, so perhaps (definitely) a stupid question here .. I have installed the 2.5 motor controller/H-bridge with speed control. Added the PWM controller in the project and can modify PWM between 0 and 100.

Now the question .. when setting PWM to 100, will the + and - going to the DC motor be exactly the same as when connecting the motor directly to the 7.2V battery ?

The reason I ask is that when I connect the motor to the battery directly, it runs, when when I connect it to the motor controller with PWM=100 it doesn't run (I set also the forward/reserve digital signal). I have an amp meter from my father (which I don't understand really how it works ), but I see the needle swinging to the right when connecting it to the motor controller (exactly the same as connecting it to the battery). Setting PWM=50, the needle swings half way as I would expect.

Thanks and regards

AI Support Bot
Related Content
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
Thx Alan

I followed Rich's manual to the letter. Using the EZB4 with H-bridge and speed control. Pressed the white button so the red light switches on. Is the motor controller sending 5vdc to the engine at PWM=100 ? If so, that might be not enough and I need to hook up another external battery to the H-bridge like discussed here :

Thx for yr help
It will send whatever voltage you provide to the Hbridge. If you are connecting your EZ-B v4 to your 7.2v battery and connecting the power from the EZ-B, it will get 7.2 volts. If you are using a v3 EZ-B, then you will want to just have signal and ground from the EZ-B and power and ground from the battery to the H-bridge because a v3 EZ-B will regulate the voltage down to 5v

United Kingdom
The Vcc and Ground on the 3 terminals on the bottom (labelled Vcc, Ground, 5v) are what effectively go to the motors connected to Out 1, Out 2, Out 3 and Out 4.

For instance, if you supply Vcc with 7.2v directly from the battery and it's ground then, provided the correct logic is applied to the In1, In2, In3, In4, EnA and EnB, this is what your motors will get.

EnA and EnB use the PWM to vary the voltage on Out 1 to Out 4. If EnA for instance is set to a PWM of 50 in ARC it will apply half of Vcc to Out 1 and Out 2 (depending on the logic of In1 and In2), in yout case 7.2 / 2 = 3.6v. If set to 75 it will apply 75% etc.

If it's not working then it's most likely that you have not set the PWM or the logic of In1 to In4 is incorrect. You must always set the PWM on EnA and EnB to something before attempting to move a motor otherwise it will act as if EnA and EnB receive a low signal or PWM of 0 even if it is a high signal.

An init script to set PWM to 100, or in some cases it may be better to set to 99 then sleep for 100ms then set to 100 may help.


PWM(D0, 99)

Where it's assumed D0 is EnA and D1 is EnB
Many thanks for your help

I think everything is as it should. My setup

NiMH accupack 7.2 V 4600 mAh
I only have one DC engine (Voltage unknown)

H-bridge connections:
D19 signal (white) to ENA (for speed control)
Plus battery to VCC
D19 ground (black) to GND
Nothing connected to H-bridge 5V
D15 signal (white) to IN1
D16 signal (white) to IN2
ENB, IN3, IN4 not connected
OUT1/OUT2 will go the the engine

User-inserted image

here the three signal cables:

User-inserted image

The connections of D19, D15, D16 at the EZB4

User-inserted image

On boeard regulators are active (pressing the small button)
All the scripts are in place. I also tried the following


Now the strange thing. Here I show the Voltage (?) output from the H-bridge to the engine when PWM=100. I would have expected 7.2V, but perhaps the device is not working correctly.

User-inserted image

Here I show the Voltage (?) output from the H-bridge to the engine when PWM=0. Nothing is shown; When I use PWM=50, the needle goes in the half position.

User-inserted image

Here is the Voltage measured at the output of the battery (it is the same as the output of the H-bridge when PWM:=100)

User-inserted image

So I would have expected it should work, but it does not. When I connect the motor directly to the battery, it runs. When I connect the motor to the output of the H-bridge is does not run.

I'm completely in the dark ...

kind regards
just to note that on the photo of the " connections of D19, D15, D16 at the EZB4", there are two pins free between the green and purple cable. On the photo it seems three pins.

the little whit button chould be puched in.
Hi nomad,

yes it is switched on and the red light shows. If I don't push it, no output goes to the motor I noticed
The white button gives the motor controller the ability to either take 5 volts from an outside source, or make its own 5v source. Pressed in, it's making its own. Out, it is waiting for 5v on the 5v screw jack. So that's why when it's out, it doesn't work.

The 5v is for the main control chip, as it only is able to use 5v. The battery power is moderated by this chip, and it sends the power required for what setting you set, by pwm.
United Kingdom
What logic are you applying to In1 and In2? Depending on the logic will depend on the voltage across Out 1 and Out 2.

If In1 is high and In2 is low with PWM of 100 on EnA Out 1 to Out 2 should be the same as VIn. If both In1 and In2 are low with any PWM Out 1 to Out 2 will be 0.
This is my current script to move forward

servo(D4, 37) #servo used to either go forward, left or right

set(D15,off) #reverse off
set(D16,on) #forward on

When I run the script, I get voltage on Out1/Out2 as I would expect.
I'm still struggling with this. I did some more test and the following seems to happen :

When running the above script, the H-bridge brings a voltage to the +/- of the motor (I can measure with with my analog device). Then, I connect one end of the motor to out 1 .. no change. Then, I connect the second wire of the motor to Out2. The moment I do that, the voltage output from the H-bridge drops to zero.

The motor runs when I connect it directly to the 7.2V battery

What am I doing wrong ?

thanks and regards
Sounds like maybe the motor is drawing too many amps and browning out the controller. The 2.5 amp controller is for fairly small hobby motors. If you are trying to drive something like a windshield wiper or wheelchair motor it is totally inadequate for the task.

From your labeled pictures, you show the ground going to D19 ground. I assume since you are having partial success that the battery ground is going to the EZ-B? You must have shared ground even if you have separate power for this to work.

hi Alan

i only have one battery. Ground goes to EZB and D19 ground to H-bridge.

I'm using a small 7.2V DC motor from a Tamiya 1/16 scale Remote control tank. But I do not have a spec of it, so I don't know the amp is will draw.:(

Thanks for your help