Arduino Small DC motor
Arduino Small DC motor This little engine has the ability to buzz. You can manage the level with command like analogWrite(motorPin, speed); where speed is 0 to 255 means level. I am using details from Starter Kit Mosfet transistors [IRF520], (to manage voltage for motor) 1N4007 diod (for protection) TFK-280SA-22125 MOTOR (6V DC) See the circuit below (click to enlarge) //Arduino code (google examples for more details) const int motorPin = 9; // the number of the motor pin int switchState = 0; // variable for reading the switchs status void setup() { // initialize the motor pin as an output: pinMode(motorPin, OUTPUT); Serial.begin(9600); while (! Serial); Serial.println("Speed 0 to 255"); } void loop() { if (Serial.available()) { int speed = Serial.parseInt(); if (speed >= 0 && speed <= 255) { analogWrite(motorPin, speed); ...