Questions

  1. Exactly how does transistor protect in reverse current?
  2. What is the difference between connecting the diode across the transistor versus diode across the motor?
  3. While doing the lab, we couldn't run stepper motor. Instead of pins 8,9,10,11 we used pins 5,4,2,3 respectively for the connection?

(Stby pin should be connected to Vcc . Schematic is wrong)

DC Motor speed control

I used potentiometer to vary the PWM output of Arduino pin and control speed of DC motor.

LabHighCurrentArduinoMotor_schem-1.png

const int transistorPin = 9;    // connected to the base of the transistor
 
 void setup() {
   // set  the transistor pin as output:
   pinMode(transistorPin, OUTPUT);
 }
 
 void loop() {
   // read the potentiometer:
   int sensorValue = analogRead(A0);
   // map the sensor value to a range from 0 - 255:
   int outputValue = map(sensorValue, 0, 1023, 0, 255);
   // use that to control the transistor:
   analogWrite(transistorPin, outputValue);
 }

1650FB31-734B-4CD1-8022-ACD313641E43.mov

Screen Shot 2021-11-16 at 9.50.26 PM.png

DC Motor with H Bridge

I used H bridge to control the direction of motor motion.