Controlling DC Motors – on/off, speed, and direction (week 8)

  • Goal of this project : I made a circuit that is controlling DC motor in 3 different ways – on/off, adjusting speed, and changing direction. In order to turn the motor on and off, I used button switch, and to change direction of the motor I used H-bridge and button. And by the “analog” value read from potentiometer, the speed is also adjustable.
  • Assembly description : To change direction of the DC motor I used H-bridge. The one I used is SN754410 and I found data sheet of that model through internet search.

According to the data sheet, I made a circuit connected to the right place of Vcc, ground, one   enable pin to the arduino, 1Y and 2Y for two wires of DC motor, and 1A and 2A connected to the digital output pins of arduino board.

  • Core components : H-bridge, DC motor, potentiometer, 2 x button switch, 2 x 10k resistor (for two button switches), 9v battery for DC motor
  • How it works : 1) When the first button is pressed, the motor will turn on. I set the code that motor is not moving when the arduino is connected to the code at the first moment, and when the button is pressed, then it will turn on. And press the button again, the motor will stop. I set the code in the loop function so it will go back to the “previous” variable so that on/off function is possible. 2) The second button is pressed, then the direction of spinning is changed. It changes back and forth like on/off when every time button is pressed. 1A and 2A of H-bridge which connected to the digital pins, I set the code that enables them to high(1A)-low(2A) and low(1A)-high(2A) according to the data sheet. 3) Potentiometer enables the motor is spinning in a wide range of speed. 
  • codehttps://github.com/minhyekwak/physicalComputing/blob/master/assignments/dcMotor%20hBridge-week8.ino

Leave a Reply

Your email address will not be published. Required fields are marked *