0
\$\begingroup\$

I've an ESP32 with a DAC pin that outputs a variable voltage between 0 and 3.3 V.

I need to drive a 12v motor using only a NPN power BJT like mj802g (or BUTW92, mj1403, NTE29, BUV21G, ...) powered typically at 12v (+ or - 1 volt)

My requirements is that motors is stopped at 0v, 50% of power at esp32 1.65 out, 100% of power at esp32 3.3v out: my idea is that motor's power is linear with esp32 output

What is the best way to achieve this ? I know that the power dissipation of the BJT will be a problem in this configuration, but I don't want any pwm drive or mosfet for now.

\$\endgroup\$
2
  • \$\begingroup\$ Simple: use an opamp configured with appropriate voltage gain to convert the DAC voltage range to the desired motor voltage range. Include a power BJT in the feedback loop to deal with the power levels. BTW, the OP does not specify the power of the motor. \$\endgroup\$ Commented Aug 9 at 22:20
  • 2
    \$\begingroup\$ Does no PWM "for now" mean "forever"? At any sort of power level this is going to be a complicated bandaid, especially if your motor power/DAC output has to be well controlled. And what do you mean by 50% power? 50% of output rated torque? Speed? \$\endgroup\$
    – vir
    Commented Aug 9 at 22:57

2 Answers 2

1
\$\begingroup\$

You didn't specify the motor, but here is a general idea of a circuit that uses an auxiliary 24V supply and drives the BJT with a TIP120 darlington. The motor is represented by the 1Ω resistor so the maximum current would be 12A (of course you can't get all the way there because the BJT has some voltage drop).

The purpose here is to show you some idea of the power dissipation in the various components:

enter image description here

The top (violet) trace in the top plot pane shows you the motor voltage, which tops out at around 11V.

The gray trace in the middle plot plane shows you the current from the 24V supply, which is maximum at a bit more than 2A

The bottom pane shoes you the dissipation in the various power components.

The blue trace is the pass transistor dissipation, which is maximum at 6V on the motor, as you would expect, at a bit less than 35W.

The red trace is the dissipation in R4 which is maximum at maximum output voltage- at more than 21W.

The green trace is approximately the dissipation in the TIP120 which peaks at at almost 9W.

All in all, a pretty ugly combination- requiring heat sinks and massive parts as well as an inconvenient 24V supply at substantial current.

A PWM solution in this power level could require minimal heat sinking.

BTW, a brushed DC motor will have no-load RPM proportional to ESP output with this kind of circuit, however there will be minimal braking since the circuit shown does not sink current.

\$\endgroup\$
2
  • \$\begingroup\$ Why I need an auxiliary power supply ? I've only 12v input \$\endgroup\$
    – Papuan
    Commented Aug 11 at 20:35
  • \$\begingroup\$ @Papuan This particular solution uses an emitter-follower which requires more than 12V to drive it to saturation so only ~9% of to maximum voltage is lost. There are other possible designs. \$\endgroup\$ Commented Aug 11 at 22:32
0
\$\begingroup\$

As I understand it ESP32 does not have analog outputs, only PWM as such the most of the extra heat will go into the motor instead of the transistor.

My requirements is that motors is stopped at 0v, 50% of power at esp32 1.65 out, 100% of power at esp32 3.3v out: my idea is that motor's power is linear with esp32 output

Your requirement is unclear: motor power is dependant on the mechnical load.

But you should get something like what you want with the naiive connection of output pin to transistor base through a suitable current-limiting resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

However if you want direct speed control or torque control it the gets more complicated because then you need to sense or control the current or voltage going to the motor.

\$\endgroup\$
2
  • \$\begingroup\$ ESP32 had two DAC pins. I can use one of them. Alternatively I will add an external DAC \$\endgroup\$
    – Papuan
    Commented Aug 11 at 20:38
  • \$\begingroup\$ linearising and stableising an all analog solution for this seems like doing it the hard way, but you should probably claifiy how 50% and 100% power are to be defined and/or measured, \$\endgroup\$ Commented Aug 11 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.