element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Dc motor problem
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 17 replies
  • Answers 1 answer
  • Subscribers 418 subscribers
  • Views 1890 views
  • Users 0 members are here
Related

Dc motor problem

e14 Contributor
e14 Contributor over 12 years ago

Hi all just started with programming an Arduino UNO - I have no previous programming background!!

 

I started with Evil Genius book and I want to make a table feed for my milling machine, but right now im just experimenting with dc motor control.

 

What I have set up is a H Bridge (HMD-02)  2 buttons and 2 potentiometers and 1 dc motor

What i want it to do is 1 Nothing until I press 1 button then Turn forward at speed set by pot 1  , stop when i let go of button and turn backward at speed set by pot 2 when I press button 2???

 

MY sketch starts the motor running as soon as I compile and I cant find the problem??????

 

Please any help??

Many thanks.

Attachments:
dc_motor1.ino.zip
  • Sign in to reply
  • Cancel
Parents
  • e14 Contributor
    0 e14 Contributor over 12 years ago

    I just bought one of these HMD-02 H-Bridge boards but mine did not come with any documentation.  The ebay seller hasn't gotten back to my request for information.

     

    I have some screw terminals labeled out1, Vcc,GND, out2.

     

    I also have some pins labeled +5,gnd,in1, in2, en.

     

    I need to speed control a single motor, don't need reversing.

     

    Does anyone have a pointer to a datasheet or wiring diagram for it?

     

    Thank you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago in reply to e14 Contributor

    I would imagine the motor will go across Out 1 and 2, supply for the motor to the + and - in between these pins

     

    Arduino output pins would go to in1 and in2, 5V and Gnd from Arduino to respective pins on that connector

     

    Educated guess on funtionality:

     

    0 on both in1 and 2, motor stationary, same if 1 (High) is set on those two pins

     

    if in 1 and 2 are different then the motor will turn one way or the other

     

    you should be able to test this without a motor connected by simply putting a meter on the out 1 and gnd or out 2 and gnd, change the input state and you should see the outputs change appropriately

     

    if you want to control only a simple dc motor then you could use this board to run two motors, one between out1 and gnd, one between out2 and gnd, you will loose direction control thats all.

     

    if you use a PWM output from Arduino you should be able to vary the speed of either side. If you have a motor across the outouts (Reversible) then only apply PWM to one side

     

    let me know how it goes

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago in reply to Robert Peter Oakes

    btw, be warned, this is an educated guess, I do not have a circuit or a board to have tried this with

     

    It is how I would connect it if I did have one though, I take no responsibility for any outcome (Except Success image )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago in reply to Robert Peter Oakes

    btw, be warned, this is an educated guess, I do not have a circuit or a board to have tried this with

     

    It is how I would connect it if I did have one though, I take no responsibility for any outcome (Except Success image )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube