Maker Pro
Maker Pro

H-Bridge feedback signal

embaro85

Jul 9, 2022
3
Joined
Jul 9, 2022
Messages
3
Hi fellas,

I'm trying to make myself an H-Bridge motor controller. All seems to be working fine so far except one thing. I have implemented end switches so that I can home my motor and for that I need a feedback signal to register when the state of the endswitch changes. I'm using a ESP32 as a driver to pull up the trnasistor bases on the left and right and I'm reading the two feedback signals. I always have one side high and the other side low, but I can't register any feedback signal upload_2022-7-9_16-22-31.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,699
Joined
Nov 17, 2011
Messages
13,699
Since your feedback signal is taken from the base of A105 and Q106, it can reach max. 0.6 V ... 0.7 V - the base-emitter voltage of the transistor. The ESP32 will register this as logic low. I can't see where the logic High you mention should come from.
If you want to sense whether the transistors are on or off, you need to take the feedback signal from the collector. With the transistor on, you'll get ~ 0 V ( around 0.1 to 0.2 V VCEsat). With the transistor off you'll get ~ 12 V (11.5 V due to the voltage divider made of the gate resistors). You'll have to add another voltage divider in the feedback signal path to bring this voltage into a safe range for the ESP32 (3.3 V max.)
 

embaro85

Jul 9, 2022
3
Joined
Jul 9, 2022
Messages
3
Since your feedback signal is taken from the base of A105 and Q106, it can reach max. 0.6 V ... 0.7 V - the base-emitter voltage of the transistor. The ESP32 will register this as logic low. I can't see where the logic High you mention should come from.
If you want to sense whether the transistors are on or off, you need to take the feedback signal from the collector. With the transistor on, you'll get ~ 0 V ( around 0.1 to 0.2 V VCEsat). With the transistor off you'll get ~ 12 V (11.5 V due to the voltage divider made of the gate resistors). You'll have to add another voltage divider in the feedback signal path to bring this voltage into a safe range for the ESP32 (3.3 V max.)

I see, so it's either analog read or what you suggested. Since I don't have any free ADC pins left I'll try reading the collector with a additional voltage divider as you mentioned.
My HIGH logic comes from the H-Motor direction + output pin (it is just a random GPIO on the ESP). What will happen if I completely remove resistor R113? Would this raise the base voltage or is it going to destroy the base of the transistor?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,699
Joined
Nov 17, 2011
Messages
13,699
Would this raise the base voltage or is it going to destroy the base of the transistor?
You need current limiting into the base of the transistor. Without, you risk destroying the transistor, although the ESP will in some way limit the current by itself.
 

embaro85

Jul 9, 2022
3
Joined
Jul 9, 2022
Messages
3
You need current limiting into the base of the transistor. Without, you risk destroying the transistor, although the ESP will in some way limit the current by itself.
That's what I thought. Thank you for solving my problem. I have an option to reverse the input and output pin and use an ADC pin to read the change in voltage. For the code this is going to do the trick. Thank you once again for the help.
 
Top