In the need of controlling a 7A 20Volt DC Motor i designed a speed controller with some cheap components. The circuit is a digital circuit and works with Pulse Width Modulation (PWM) which is one of the best ways to control a dc motor. This circuit can drive up to 33A 10V DC motor with a big heat sink placed on the switching mosfet.
Summarily i used in this circuit, the AVR ATtiny13 to control the PWM , a n-mosfet IRF540N for switching the motor and a Rotary Encoder to adjust the PWM Duty Cycle.
Note. The same circuit can be used as a light dimmer for LEDs.
The circuit consists of:
The Power Supply.
It is a basic LM7805 power supply which adjusts the voltage at 5V for powering the ATtiny13 and the LEDs. Capacitors before the LM7805 C10, C7 and after C8, C11 have been used for noise filtering. Diode D1 1N4001 is there to protect the circuit from inverting voltages.
The main circuit.
The main circuit can be separated in 4 sub circuits to be more understandable.
The LEDs
3 Leds have been used for indicating PWM Duty Cycle value: Minimum (LED3), Maximum (LED2) and the Current Value (LED1). LED2 and LED3 are connected directly to the ATtiny13 I/O. LED1 which indicates the current PWM Duty Cycle value is driven by the transistor T1 BC337 triggered by the PWM output. R1 R3 and R4 are current limiting resistors for LEDs. R2 Limits the current draw to the BC337 base.
The Rotary Encoder
This is the Rotary Encoder connected with the appropriate components to work properly. R6 and R5 are pull up resistors which "pulls" A and B pins to VCC. Pin C is directly connected to GND. C4 and C3 are decoupling capacitors which are appropriate for noise filtering. If you don't place them the noise will be not filtered and the rotary probably will not work.
The Motor Switcher
For Motor Switching i have used a n-mosfet IRF540N which can Continuous Drain Current, VGS @ 10V 23-33A depending on the temperature (25C-100C). Diode D2 has been placed for inductor inverting voltages. Capacitor C1 is there to filter the noise provided from the motor. If you don't place this capacitor you may have noise at the rotary encoder and it will not work properly.
Make sure you have placed a heat sink on the IRF540N because at high currents it is getting realy hot!
Here you can find photos of the test circuit i built.
The code and the Circuit Scheme can be found:
I would suggest you to put a buffer and a small current limiting resistor in the gate of that MOSFET. I cannot get why motor injects noise into the rotary encoder circuit btw.
MOSFET GATE does not draw current (it is very small) so there is no need of current limiting resistor
Actually, the gate is a capacitive load. So it will draw as much as current it can, but degrading very very fast. A small current limiting resistor with small wattage not only limit the current to the maximum value that microcontroller source, it may blow up like a fuse in case MOSFET is damaged. In addition to the buffer, this will be extra safety. I have read about it in: http://www.4qdtec.com/mostest.html. Go down and read "Dead MOSFETs". Well maybe it is an overkill 🙂 Nice project by the way! You have put a lot of thought in its functions, that's great!
Thank you both for your note and your good words! I'll check this
Had you made any improvements according to what Abdullah said? I would be interesting to see them.
No i haven't yet the time to make the changes
Looking nice with that knob! The LED speed, min & max indicators are great idea!
I have few question:
*thik wires is needed just at the output of circuit right? becuse high current
*if I want to control a simple toy DC motor I must make changes in the circuit like removing the FET amplifier and D2 .
Thick wires is needed where high current flows. No you don't have to make any changes, it will work as it is, but if you want you can replace the FET with a smaller one but there is no reason. D2 must be there for reverse currents produced by the motor on start stop or speed change.
For me don't change anything. Only if for some reason you can't find this specific FET replace it with another which meets your needs
Thanks for such a nice thinking.The ckt. is very handy,chiper and looking impressive as well.Sir kindly suggest me that what we have to change or modification in the circuit if we use the same circuit to very the180vdc to vary the rpm (180v voltage input type motor) of 2 hp motor.
plz help me sir.
thanks very much
Very energetic post, I enjoyed that a lot. Will
there be a part 2?
my homepage :: Mercedes
Does the device increase the output current? For example if the input adapter has 12V 2A, can it supply 12V 5A DC motor?
No no… 🙂 there isn't any device that can increase the output current without reducing the output voltage
Hi What is the PWM frequency? as you may know different types of motor require different pwm freqencies. Also if the frequency is too low it can damage the motor over time. If the frequency is selected properly a good battery saving can be made. I have developed a precision pwm motor speed controller using an 8 pin pic using a standard 10k potentiometer ;o)
hi is possible to write convert code to arduino ?
Tnx..
hi is possible to convert code for arduino ?
i have made the circuit
some noise in to the motor on low speed..
i need to increase the speed..
i wanna use 36w motor 20000turn /min
http://wangebote.de/260946375065/fr%C3%A4ser-fr%C3%A4sger%C3%A4t-promed-1020-handablage-gratis-kunstn%C3%A4gel-nageldesign-feilenbsp.html
Ohh man this is incredible
Hi, sorry for my bad english
I'm interested in this construction but I have a problem
When you burn main.hex to the processor and turn it on
so only shines min. and max. LED and motor does not rotate
You know what might be the problem?