Hey Guys,
So after about a week of trial and error and google searches, I want to ask for some feed back before I "might" fry my third circuit.
The goal is to control a DC motor with speed and direction from a micro controller.
The motor is from a cordless drill, has no model number on it. From testing, its pulling about 2.5 Adc at 12vdc with small restriction holding the shaft. Its rated for 18 Vdc, but working with 12v PS.
The second I built was working fine when I was testing it with LEDs and using only digitalWrite to the output pins, alternating between pin 3 & 5.
const int motorPinFrw = 3;
const int motorPinRev = 5;
//Void Setup Code
void motor_setup() {
pinMode(motorPinFrw, OUTPUT);
pinMode(motorPinRev, OUTPUT);
analogWrite(motorPinFrw , 255);
analogWrite(motorPinRev , 255);
}
//Alternating ON/OFF between outputs
digitalWrite(motorPinFrw, HIGH);
delay(2000);
digitalWrite(motorPinFrw, 0);
delay(25);
digitalWrite(motorPinRev, HIGH);
delay(2000);
digitalWrite(motorPinRev, 0);
delay(25);
//Alternate Fade ON/OFF between outputs
digitalWrite(motorPinRev, LOW);
for (int i = 0; i < 255; i++) { //A Fade On
analogWrite(motorPinFrw, i );
delay(10);
}
for (int i = 255; i > 0; i--) { // A Fade Off
analogWrite(motorPinFrw, i );
delay(10);
}
digitalWrite(motorPinFrw, LOW);
for (int i = 0; i < 255; i++) { // B Fade On
analogWrite(motorPinRev, i );
delay(10);
}
for (int i = 255; i > 2; i--) { // B Fade Off
analogWrite(motorPinRev, i );
delay(10);
}
It fried when I used analogWrite in a for loop to fade between the LEDs.
LED test strip I used
I BELIEVE Q1 & Q4 was the active path and Q3 let the magic smoke out.
Since this blew when PWM was active, I found out after that pin 3 is 490 Hz and 5 is 980 Hz.
I was testing this circuit as I was building it so I didn't put in diodes yet.
I figured diodes were only needed on inductive loads to protect the MOSFETs but perhaps I'm wrong and LEDs need them as well?
This is going to be my next build.
Next Circuit Idea
So my question, will my next circuit work for the DC motor and LEDs?
Files:
2nd built but fried with LEDs
schem built.png
3rd I'm planning on building
schem with D.png
LED strip I used for testing
12v LED test load.png





