Chat freely about anything...

User avatar
By infor_mare
#37406 Hi Martin, thanks for your help.
I'm a novice , so i need some explanation about it. I draw a scheme of what i have undestand. Is it right?
Consider that i would connect a led on gpio0, but i need a scheme about that. Can you give me a link or something else?

thanks
Mirko

ps: in my example, i want drive a l293d with the gpio2 after the boot
Attachments
example.png
User avatar
By martinayotte
#37409 Hi Mirko,

The difference between sink/source for a GPIO output can be seen here :

Image

For GPIO0/GPIO2, since they both need to be HIGH for proper boot process, you cannot use source mode, therefore you need to connect the LED as sink mode. And since the LED will be ON when the GPIO is providing a LOW, your software need to be written in such consideration, doing digitalWrite(LED, 0) will turn ON the LED while digitalWrite(LED, 1) will turn it OFF.

For your L293D H Bridge, you don't need the R6 resistor, it is useless...
But there is a side effect of connecting it to GPIO2 : since during the boot process the pin is HIGH, your motor will be turned ON for few microseconds until your code is booted and reach digitalWrite(MOTOR1A, 0) which will turn it OFF.
If this small ON pulse is problematic, you will need to invert the logic there too for the L293D.
It can be accomplish using a NPN transistor or a N-MOSFET along with another pullup on the L293 1A pin.
User avatar
By infor_mare
#37411 yes mister .... this is a problem!
In your opinion, can i use the pin1 and 9 (enable pins) connected to the gpio15 ?
during the boot the gpio15 is LOW , so the l293d is disabled ...

So , i can connect the l293d directly to the pin of esp without resistor?
mirko
User avatar
By martinayotte
#37413 Yes, GPIO15 will be good for those EN pins.
No series resistors, but still GPIO15 pulldown resistor, something like 4K7 or 10K to GND.
So, in your code, digitalWrite(MOTOR_ENABLE, 1) will bring the EN pins to HIGH.