Is this circuit adequate to interface a micro-controller with a dc motor using an optocoupler?

Thread Starter

FranciscoB

Joined Feb 8, 2014
107
I would like to make a device using an esp32c3 and an optocoupler to allow me to actuate a separate device comprised of a motor running from a different power source (4.2V, 6V or 12V).

The esp32c3 runs from 2x AA alkalines and would wake up periodically to run the motor for a minute, then go back to sleep.

What should I change in the attached circuit? https://tinyurl.com/28jr5j6k

Thank you.
 

Attachments

Last edited:

MisterBill2

Joined Jan 23, 2018
19,398
The circuit shown does not function as described because the opto-isolator /mosfet section is directly across the battery . Or perhaps the cross connection shown is not a connection. But if the intent is for the source end of the mosfet connected to the opto-isolator is intended to connect directly to the top motor connection then the circuit could function as desired.

Whatever program was used to create the drawing is not doing it very well.
 

BobTPH

Joined Jun 5, 2013
9,264
I don’t understand what you are trying to do with the circuit to the right of the first MOSFET.

All you need is the opto-coupler and a P MOSFET. Connect the motor positive to the drain of the P MOSFET and you are done.
 

Thread Starter

FranciscoB

Joined Feb 8, 2014
107
How much Current does the Motor draw normally while running ?
.
.
.
It draws 700mA.

BTW, I'm still using two circuits you suggested me in this forum some years ago: a minimal part count 555 LED on my bicycle and a circuit using some TL431 that switches one load but not a second one during the day and both during the night. Thank you!
 

Thread Starter

FranciscoB

Joined Feb 8, 2014
107
I don’t understand what you are trying to do with the circuit to the right of the first MOSFET.

All you need is the opto-coupler and a P MOSFET. Connect the motor positive to the drain of the P MOSFET and you are done.
I re-drew the schematic, hope it's clearer.

the water dispenser is comprised of an 18650 cell, circuit board and motor. The circuit board has a uC that handles USB charging and that enables/disables the motor when its button is pressed.

I want to enable/disable the motor periodically with an ESP32C3 through an optocoupler.
 

Attachments

LowQCab

Joined Nov 6, 2012
4,290
Since this project is Battery Powered,
You would want zero Quiescent-Current to be drawn.

I would recommend a "Photo-Voltaic-Gate-Driver", ( FDA217-ND )
along with your choice of N-Channel-MOSFET,
a Logic-Level-Gate is preferred, but not necessary,
and one Input-Resistor to limit the LED-Current.

Recommended N-FET .......... ( IRLD024PBF-ND )

That's all of the parts necessary.

The Gate-Driver requires a minimum-Input-Current of ~5mA to fully turn-On the FET,
~10mA Input is preferred, your Micro-Controller can provide that easily.

Why does this setup have to be isolated from the Micro-Controller ?
A common Ground would greatly simplify things.
.
.
.
 

Alec_t

Joined Sep 17, 2013
14,407
If the transistor in the optocoupler were connected across the switch shown then you could eliminate the right-hand MOSFET.
 

Thread Starter

FranciscoB

Joined Feb 8, 2014
107
Why does this setup have to be isolated from the Micro-Controller ?
A common Ground would greatly simplify things.
You need only the ESP and one MOSFET. Why do think you need an opto coupler?
Because I intend to make it modular, so I can use the same design with 6V or 12V motors in the future. The esp32c3 has a 3.3V logic and will be powered by 2x AA.

If the transistor in the optocoupler were connected across the switch shown then you could eliminate the right-hand MOSFET.
Thank you for you suggestion, I will give it a try due to it's simplicity. The output of the GPIO on the esp32c3 is 10mA mas, will it be enough to fully "turn on" the transistor?
 

BobTPH

Joined Jun 5, 2013
9,264
Because I intend to make it modular, so I can use the same design with 6V or 12V motors in the future. The esp32c3 has a 3.3V logic and will be powered by 2x AA.
That still does not require isolation. You just need to connect the two grounds together. Isolation is needed when the grounds cannot be connected together.
Thank you for you suggestion, I will give it a try due to it's simplicity. The output of the GPIO on the esp32c3 is 10mA mas, will it be enough to fully "turn on" the transistor?
MOSFETS do not require any current except in the short time to charge the gate capacitance. It is common practice to drive them directly from a micro output if the switching is not at a high frequency. You need a logic level N MOSFET that will turn on sufficiently at 3V. Just connect source to ground, drain to motor negative, power to motor positive and gate to GPIO.
 

LowQCab

Joined Nov 6, 2012
4,290
To make this project completely "modular" use the setup described in post #11.

CAUTION ..........
The suggested FET in post #11 is adequate for the Motor You described.
It's good if the Current is kept below ~1-Amp, and below ~50-Volts.

But now You go and throw-in a zinger on us and say ....... well maybe ~12-Volts ...........
This may involve a much more powerful Motor, requiring a much larger FET, and possibly a Heat-Sink.
I thought this was only for a Battery-Powered Water-Dispenser.

So, what do You want as an end product ????
You must be specific.
.
.
.
 

Thread Starter

FranciscoB

Joined Feb 8, 2014
107
To make this project completely "modular" use the setup described in post #11.

CAUTION ..........
The suggested FET in post #11 is adequate for the Motor You described.
It's good if the Current is kept below ~1-Amp, and below ~50-Volts.

But now You go and throw-in a zinger on us and say ....... well maybe ~12-Volts ...........
This may involve a much more powerful Motor, requiring a much larger FET, and possibly a Heat-Sink.
I thought this was only for a Battery-Powered Water-Dispenser.

So, what do You want as an end product ????
You must be specific.
.
.
.

First and foremost, I'm getting the water dispenser converted. Meanwhile I'll try to understand what the circuit needs to make it also usable with 6V or 12V, drawing about 1A.

I was thinking of using the IRLR7843 in D-Pak format, as I have a few here. https://www.digikey.com/en/products/detail/infineon-technologies/IRLR7843TR/614064

Thank you everyone for your suggestions.
 

MisterBill2

Joined Jan 23, 2018
19,398
I see an attached photo of an assembly, I see no attached circuit drawing.
One concern I would have is the durability of the solder connections to the motor terminals. I see no provision for supporting the circuit board except thru the soldered connection of the motor terminals, and certainly every button press will apply some force toward flexing the motor terminal solder joint. There is no escaping that reality.
The simple solution will be extending the non-circuit portion of the PCB above and below the present limits to allow the creation of two mounting points in line with the button center line.
That addition will provide a durable means of support and extend the life of the assembly to the anticipated life-span of the motor, which appears to be easily replaceable. It will also provide additional support during installation of the three connectors.
 
Top