HI all,
A newbie question so please tolerate with me.
I understand that a toy motor should not be directly connected to a GPIO. However, my project is 3v battery operated and mostly in deep sleep state and it runs motor for 2 seconds approx. once a day. I would like circuit to be as simple as possible so I do not want to connect and transistor or motor IC. Motor consumes around 10ma and connected directly to one GPIO and GND.
What do you suggest I should do to make sure it does not burn ESP32 in long run. Do you think I should add a resistor/diode in series to the motor, just to make sure?
Thanks,
Jay
Connect small N20 geared 3v motor directly to ESP32-S3 GPIO
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: Connect small N20 geared 3v motor directly to ESP32-S3 GPIO
Honestly, just use a transistor or better, a mosfet. A GPIO is relatively sensitive to under- and over-volting; the components you'd need to add in order to protect against that would take up more space than a simple transistor/mosfet.
Re: Connect small N20 geared 3v motor directly to ESP32-S3 GPIO
Thanks for the suggestion!
So, can I connect BSS138N logic level mosfet directly to ESp32 GPIO and that should suffice?
No resistor between GPIO and BSS138N should be fine?
Thanks again,
Jay
So, can I connect BSS138N logic level mosfet directly to ESp32 GPIO and that should suffice?
No resistor between GPIO and BSS138N should be fine?
Thanks again,
Jay
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: Connect small N20 geared 3v motor directly to ESP32-S3 GPIO
Yes. Looking at the datasheet, figure 7, a Vgs of 3.3V (as sent out by the ESP32) will allow you to control a device needing 200mA or less. You don't technically need a resistor although it's good practice to add a resistor from the gate to Gnd, to make sure that if the ESP32 is not controlling the GPIO yet, the gate has a defined signal. Not doing it in your case probably doesn't hurt, but it may make the motor turn on for a fraction of a second during boot.
(Note that the BSS138 is kinda old... not that you need it here, but it may be good to know you can get mosfets with way better specs nowadays. For instance, the AO3400 would be able to control devices requiring multiple amperes in this situation.)
(Note that the BSS138 is kinda old... not that you need it here, but it may be good to know you can get mosfets with way better specs nowadays. For instance, the AO3400 would be able to control devices requiring multiple amperes in this situation.)
Who is online
Users browsing this forum: Baidu [Spider] and 46 guests