Skip to content

Control 2 DC motors with H-Bridge in Tinkercad-then use potentiometer to control the motors speed, and Push button to control the motors direction.

Notifications You must be signed in to change notification settings

mo7ammed-saleh/DC_Motors_Speed_and_Dir_Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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 😍

About

Control 2 DC motors with H-Bridge in Tinkercad-then use potentiometer to control the motors speed, and Push button to control the motors direction.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages