Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 2.35 KB

README.md

File metadata and controls

34 lines (23 loc) · 2.35 KB

DC Motors Speed and Dirction Control

This Repository will explain my 2nd task in Electronics and Electrical Power departmentt at SMART METHODS summer training.

Task Requirements:

  • Control the DC motor using H-Bridge in clockwise and then counter clockwise direction.
  • Use potentiometer to control the speed of DC motor, and push button to swap the direction of DC motor.

Detailed Steps:

  1. Connect the circuit diagram in Tinkercad website.

    • Use L293D H-bridge IC (datasheet) which is similar to L298D.
    • Vss=5v from controller, Vs= 5v to 36v power supplay, Enable= PWM control, Input= Direction control.

  2. Now, use potentiometer and push button to control the speed and direction of DC motors (see the code with explination in comments).

    • Note that the potentiometer read an analog value from 0-1023 and we should convert it using map() command into PWM which is from 0-255.
    • To consider safety, the motors will not start until the push button is pressed for the first time.

  3. Printing the max value of potentiometer which is max PWM value

  1. Task is Done 😍