Author Topic: Is this circuit adequate to interface a uC with a dc motor using an optocoupler?  (Read 527 times)

0 Members and 1 Guest are viewing this topic.

Offline FBMinisTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: pt
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.
« Last Edit: April 27, 2024, 11:56:37 am by FBMinis »
 

Offline FBMinisTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: pt
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.

 

Offline Retirednerd2020

  • Regular Contributor
  • *
  • Posts: 71
  • Country: us
I think you can eliminate one of the FET circuits and just put the switch in parallel with the output transistor of the optoisolator, making a wired-or.  You could do this with an N or P fet, whichever is cheaper.  The opto-coupler isn't really necessary because the FET can be the "translator" between the independent power sources.  Only the ground would be shared.  You have choices.
 
The following users thanked this post: FBMinis

Offline FBMinisTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: pt
The "fet with switch" I included in the schematic next to the motor represent the microcontroller on the water dispenser, which turns ON/OFF the pump when its button is pressed.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: gb
  • Recovering Electrical Engineer
You can just put the manual switch across D and S. That saves you a MOSFET.
Watch out for the opto current. About 8mA from your AAs.
A simple latch circuit may be better. A brief pulse at the opto toggling the load on and off.
Note the emitter follower connection used to change the sense and to speed up the edge seen by the FF.
A CD4013 is about $0.50
The capacitor, resistor and diode connected to the 4013 make sure it powers up in the off state.
 
The following users thanked this post: FBMinis

Offline FBMinisTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: pt
Thank you so much for taking the time, going to give it a go  :-+
 

Offline FBMinisTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: pt
I got it working like in the attached diagram. Do you see any possible point of failure?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf