Tuesday 3 October 2017

transistors - How to control the speed of a 12V DC motor with an Arduino?


I'm trying to figure out how to control the speed of a 12V DC motor with an arduino and a 12V battery.


I want to split the «power» and «control» parts of the circuit so the Arduino and sensors receive only 5V.


So far, this is what I've tried :


enter image description here



I am able to control the speed of the motor by changing the PWM of pin 3 on the Arduino. This opens the NPN transistor (BUF654).


The problem is that the speed of the motor doesn't change enough.


From 0% to 50% PWM on pin 3, the motor is stalled.


Above 50%, the motor is nearly reaching its maximum speed.


I wonder if I would be able to have a linear variation :


0% - 10% : very slow
10% - 20% : slow
20% - 50% : normal speed
50% - 80% : fast
80% - 100% : RELEASE THE KRAKEN!


Here are the voltage and current the motor draws when using only a battery, or the previous circuit :


+----------------------------+---------+--------+
| Directly on 12V battery | 12.7 V | 61 mA |
+----------------------------+---------+--------+
| Arduino circuit (100% PWM) | 12.47 V | 60 mA |
+----------------------------+---------+--------+
| Directly on 9V battery | 9 V | 54 mA |
+----------------------------+---------+--------+
| Arduino circuit (60% PWM) | 9 V | 52 mA |

+----------------------------+---------+--------+

What have I done wrong? Could the problem come from my motor?




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...