Maker Pro
Maker Pro

How to Connect to H Bridge?

ashesv14

Feb 10, 2014
5
Joined
Feb 10, 2014
Messages
5
I am building a robot line following. I want to use 4 LDR's. 2 to follow line and 2 to detect the background colour. This is because half side of the track is black and the other white. I am using comparator to detect the high and low voltage between the 4 LDR. But I am confused about connecting this comparator to the H bridge with outputs of the Hbridge being 2 motors. I want to make the robot as fast as possible this is possible by making one motor being clockwise and the other being clockwise. How can this be done using the Hbridge
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
It is a little more complicated than that. You want to change the direction by slowing one motor. And you need some logic. If both sensors are seeing white you want to slow one motor, and both are seeing black you want to slow the other. A microcontroller would be best.

Bob
 

ashesv14

Feb 10, 2014
5
Joined
Feb 10, 2014
Messages
5
It is a little more complicated than that. You want to change the direction by slowing one motor. And you need some logic. If both sensors are seeing white you want to slow one motor, and both are seeing black you want to slow the other. A microcontroller would be best.

Bob

I cant use micro controller for this project. Thats why I am getting stuck. By using microcontroller i could have programmed the microcontroller. Is there any other way to this problem with out using progammable components
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Yep, you can use logic circuits.

Oh, and why are you using an H-bridge? It should not be necessary if the robot only moves forward and it would complicate the logic to make it turn to stay on the track.

Bob
 

ashesv14

Feb 10, 2014
5
Joined
Feb 10, 2014
Messages
5
Yep, you can use logic circuits.

Oh, and why are you using an H-bridge? It should not be necessary if the robot only moves forward and it would complicate the logic to make it turn to stay on the track.

Bob

It has to take turns but not sharp turn maybe around 0 - 60 degrees turn.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
I think what Bob means is it does not go backward so you don't need to reverse the current to the motors.
Adam
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Exactly, which means you can use a single MOSFET to control each motor, no need for an H-bridge.

Bob
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
You could also add another transistor to switch the 0V and a brake Mosfet to supply power the 0V side to act as a brake when the 0V Mosfet is off. But you still don't need a full H bridge.

Adam
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The placement of the LDRs with respect to the wheels is important.

Obviously they should be on the center-line of the vehicle, but how far ahead or behind the axle? You would be wise to make this adjustable.

Googling "White line follower" is going to give you a lot of information.

Most old school white line followers used just 2 sensors. There may be reasons to use more, but they're probably not good ones if you're not experienced.

The fact that you seem to be following an edge rather than a line makes little difference to the number of sensors needed. You need to invert the signal from one of your sensors (you could swap the resistor and LDR in the simplest case).
 
Top