Pages: 1 [2]   Go Down
Author Topic: Correct schematic for DC motor contoller  (Read 2204 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im going to tr'y this tomorrow.  I couldn't find this particular mosfet, so bought another, 100v 30 amp one.  Where do I find the sketch for the arduino, or does the one from the original thread work? thanks
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't need a controller to turn a motor in both directions. Im really looking for one that will turn a motor in one direction but with variable speed.  Looked round on the Arduino playground and tutorials, but not sure there's anything simple enough for me, as this is first project.  Also reading a schematic is going to be uphill...

The original sketch can be made to work.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10496
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Arduino 5v line probably can't supply enough current for the motor

Make that "The Arduino 5v line defnitely can't supply enough current for the motor and trying to do so may damage the Arduino board".
Logged

[ I won't respond to messages, use the forum please ]

Pakistan
Offline Offline
Full Member
***
Karma: 0
Posts: 101
Advances are made by answering questions. Discoveries are made by questioning answers.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

check this, if it helps so good, if not then sorry  smiley
if u want to increase and decrease speed of your 12V DC motor in one direction, u should have 12V DC supply and any of the 5 Volt NPN transistor..
so u can do it in 2 ways, according to your needs.. if u want to control it by yourself at anytime so u can use potentiometer connected to analog pin 0 i-e (A0), otherwise if u want to control it according to time or some sensor so instead of potentiometer u may give input according to that, so after this connect PWM pin 10 to NPN transistor base and connect motor and 12V battery in series in between collector and emitter of transistor..
if u r new, so in program i have also explained everything..
Code:
/*
  Motor Speed Controller
  First Declare an integer variable "potentiometer" for
saving the input value of potentiometer.
  The speed of the Motor will depends on the value obtained by analogRead(). */
intsensorPin   = A0;        // select the input pin for the potentiometer
intmotorPin    = 10;     // select the pin for the Motor
intsensorValue =  0; // variable to store the value coming from the sensor
void setup()
{
pinMode(motorPin, OUTPUT);  // declare the motorPin as an OUTPUT
}
void loop()
{
     // Range of Analog Value(Potentiometer) is in b/w
  // "0" & "1023" as we have 10 bit ADC in Arduino.
sensorValue = analogRead(sensorPin);
     // PWM is 8-bit so we can write from 0 to 255 not from 0 to 1023.
  // So using map function we will write sensorValue on output.
int mapped = map(sensorValue, 0 , 1023 , 0 , 255);
analogWrite(motorPin, mapped);  }

Logged

Saad Khalil

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Im going to tr'y this tomorrow.  I couldn't find this particular mosfet, so bought another, 100v 30 amp one.

Just make sure it's a logic level mosfet, not an ordinary one - especially if your motor may take more than 1A.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: 1 [2]   Go Up
Jump to: