Can a MOSFET be used to replace a mechanical potentiometer in a PWM circuit?

Click For Summary

Discussion Overview

The discussion revolves around the feasibility of using a MOSFET to replace a mechanical potentiometer in a PWM circuit designed for controlling the speed of a DC motor in a microcontroller-powered quadcopter. Participants explore various approaches to achieve variable RPM control, focusing on the integration of transistors and microcontroller capabilities.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant expresses interest in using a MOSFET as a potential replacement for a mechanical potentiometer but admits uncertainty about how MOSFETs operate.
  • Another participant suggests using a digital-to-analog converter (DAC) to set the threshold voltage for PWM control, questioning the communication interfaces available on the microcontroller.
  • Several participants discuss the Arduino's capabilities, noting it can provide PWM signals but is limited to a peak voltage of 5 volts, which may not be sufficient for higher voltage motors.
  • There is mention of using buffer amplifiers between the Arduino and the motors to ensure proper operation, with one participant recommending this as the best option for accurate PWM control.
  • A participant highlights that microcontrollers typically have built-in PWM modules suitable for driving brushed DC motors and mentions the use of MOSFETs in PWM applications.
  • Another participant introduces the idea of using an H bridge with MOSFETs to allow for motor direction control.
  • One suggestion includes using a small Arduino Trinket to generate PWM outputs, which could simplify the design and programming process.

Areas of Agreement / Disagreement

Participants generally agree on the need for additional components, such as buffer amplifiers, to drive motors effectively from the microcontroller outputs. However, there are multiple competing views on the best approach to replace the mechanical potentiometer and the specific components to use, leaving the discussion unresolved regarding the optimal solution.

Contextual Notes

Participants express uncertainty about the exact interfaces available on the Arduino and the implications of using different types of motors (brushed vs. brushless). There are also unresolved questions about the specific requirements for MOSFETs in this application, such as gate charge and frequency considerations.

Who May Find This Useful

This discussion may be useful for hobbyists and engineers interested in motor control applications, particularly those exploring the integration of microcontrollers with PWM circuits and alternative components to mechanical potentiometers.

DarkBabylon
Messages
72
Reaction score
10
Hello, I've been wanted to make a PWM module for a DC motor for a micro controller powered quadcopter.
Now it might be easier to just punch the code for PWM, however I would like a voltage of more than 5 volts on the motor. That wouldn't be a problem to adjust the components and source.

The problem is that currently I am building the circuit in a simulator, and got stuck at a problem. The purpose of a PWM is to adjust it on the fly (literally) for a variable RPM and the circuit is currently built with a mechanical potentiometer. What I would like is to use transistors as they can act like a variable resistor, however I can't seem to think of a solution that doesn't involve op-amps and think there might be a more efficient solution. [Edit: I think maybe a MOSFET, but don't exactly know how they work.]

Here is a link to the circuit in question.
The 25 ohm resistor is the motor (don't know an equivalent circuit for a motor, so I just put a linear one, and going to test it later), using a darlington pair and a 555 timer.
The idea is to replace the potentiometer that controls the PWM, with a component or components to act like the potentiometer currently connected.
 
Engineering news on Phys.org
DarkBabylon said:
Hello, I've been wanted to make a PWM module for a DC motor for a micro controller powered quadcopter.
Now it might be easier to just punch the code for PWM, however I would like a voltage of more than 5 volts on the motor. That wouldn't be a problem to adjust the components and source.

The problem is that currently I am building the circuit in a simulator, and got stuck at a problem. The purpose of a PWM is to adjust it on the fly (literally) for a variable RPM and the circuit is currently built with a mechanical potentiometer. What I would like is to use transistors as they can act like a variable resistor, however I can't seem to think of a solution that doesn't involve op-amps and think there might be a more efficient solution. [Edit: I think maybe a MOSFET, but don't exactly know how they work.]

Here is a link to the circuit in question.
The 25 ohm resistor is the motor (don't know an equivalent circuit for a motor, so I just put a linear one, and going to test it later), using a darlington pair and a 555 timer.
The idea is to replace the potentiometer that controls the PWM, with a component or components to act like the potentiometer currently connected.
If the uC is not going to drive the PWMs directly, you could use a DAC to make the threashold voltage instead, and set that via the uC. What interfaces does your uC have for communicating with several DACs (one per motor)? I2C? SPI? Parallel?
 
Well not exactly sure about the interface, but I am wanting to use the Arduino for that application if it helps.
 
DarkBabylon said:
Well not exactly sure about the interface, but I am wanting to use the Arduino for that application if it helps.
What interfaces does the Arduino uC offer?
 
Some Microchip devices, maybe most of them for all I know, offer an output that is PWM. I have never used it in a finished application but have fiddled with it during design. If you are willing to use a PIC processor from MicroChip this would solve some of your problems. Certainly reduce the parts count.
 
  • Like
Likes   Reactions: berkeman
berkeman said:
Looks like it at least has SPI (not sure how many chip enables it can offer, though)...

https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
I can't really speak in the language you are using. What I can say is that the Arduino (Uno, which I intend to use) is able to give a binary signal in the 14 pins it provides, and 8-bit PWM signals on 6 pins out of the 14. There is an ICSP interface which I have yet to learn about. Guessing that the ICSP is the serial interface you are referring.
TX and RX serial pins, 5 analog inputs with an additional reference pin and power pins.
The 14 digital I/O pins are effectively on and off switches, with only 6 having a PWM control.

Averagesupernova said:
Some Microchip devices, maybe most of them for all I know, offer an output that is PWM. I have never used it in a finished application but have fiddled with it during design. If you are willing to use a PIC processor from MicroChip this would solve some of your problems. Certainly reduce the parts count.
While the Arduino is able to provide the PWM signals in a good set of intervals, it is only able to provide a peak of 5 volts, and would like to use higher voltage motors, as they provide a bit more power than the 3.7-5 volt ones.
 
DarkBabylon said:
I can't really speak in the language you are using. What I can say is that the Arduino (Uno, which I intend to use) is able to give a binary signal in the 14 pins it provides, and 8-bit PWM signals on 6 pins out of the 14. There is an ICSP interface which I have yet to learn about. Guessing that the ICSP is the serial interface you are referring.
The MOSI and MISO pins are used for SPI communication (along with some Chip Select signals).
DarkBabylon said:
While the Arduino is able to provide the PWM signals in a good set of intervals, it is only able to provide a peak of 5 volts, and would like to use higher voltage motors, as they provide a bit more power than the 3.7-5 volt ones.
You are not going to drive motors directly with the uC outputs. You will need buffer amps of some sort between the Arduino uC and the motors no matter what. So your best option is to use the built-in PWM generators, and add buffer amps outside to the motors. That will give you the fastest and most accurate control of the PWM drives to the motors.
 
berkeman said:
You are not going to drive motors directly with the uC outputs. You will need buffer amps of some sort between the Arduino uC and the motors no matter what. So your best option is to use the built-in PWM generators, and add buffer amps outside to the motors. That will give you the fastest and most accurate control of the PWM drives to the motors.
Well, seeing as that is the easiest option, guess I'll go with that, thank you very much.
 
  • Like
Likes   Reactions: berkeman
  • #10
Microcontrollers typically provide a PWM module just for that purpose. I assume this is for a brushed DC motor. Brushless motors can be driven using an MCU and most ESCs use that method, but coding is pretty involved especially for BEMF sensing in lieu of mechanical rotor position sensing. For that you need a fairly fast MCU. There are brushless motor drivers that can do most of the heavy lifting for you such as the TI DRV8305, but typically brushless ESCs use a fully MCU based solution.

For a brushed DC motor you will need to use a MOSFET to provide the PWM drive. If you use an H bridge (four MOSFETs in a ladder) you can even reverse the motors if you want. In some cases you can drive the MOSFET gate directly off the MCU's output pin assuming low frequency and low MOSFET gate charge. If you have a need for a larger transistor having higher gate charge running at higher frequencies or if you need level shifting you would have to use a MOSFET gate driver which is a widely available component.
 
  • Like
Likes   Reactions: DarkBabylon
  • #11
You might consider a very small and light-weight “arduino trinket” that costs less than $10 and can generate a couple of PWM outputs.
With a Mosfet driver for your motor it will make a complete controller re-programmable in C via a USB connector.
It also has I2C data, SPI data input and A-D converters.
https://learn.adafruit.com/introducing-trinket/pinouts
 

Similar threads

Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
101K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 14 ·
Replies
14
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K