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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Wiring a motor to the RPi?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 63 replies
  • Subscribers 710 subscribers
  • Views 10291 views
  • Users 0 members are here
  • help
  • rc
  • pi
  • control
  • raspberry_pi
  • please
  • motor
  • raspberr
Related

Wiring a motor to the RPi?

wallarug
wallarug over 14 years ago

What do I need?

 

I am told that I need some transitors.  I have a 12v powerpack and 2 x12v motors.  How do I set this up so that I don't blow-up the RPi and that I can control the motors through the GPIO?

 

I have a gertboard on the way but I would like to see if I can do it without it first.

 

I have little knowlegde about transitors and electronics but I do know how to build circuits.

  • Sign in to reply
  • Cancel
  • e14 Contributor
    e14 Contributor over 14 years ago in reply to wallarug

    Look up an H Bridge circuit.  I have had good luck with this kit with an Arduino.  I made a roller robot.  I tried and failed with TIP102 and TIP107 but I am clumsier than most.  If you go this route,

    buy extra transistors in case you fry them.

     

    Look at http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/.  Follow the links to basic transistor etc.

     

    The H bridge would have one output for forward and one for backwards.  The kit controls 2 motors.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • evan.stoddard
    evan.stoddard over 14 years ago

    I think with the new gert board, it comes with software so you should be able to run it just fine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 14 years ago in reply to evan.stoddard

    i have bought one image

     

    I guess I will just wait. image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • evan.stoddard
    evan.stoddard over 14 years ago in reply to wallarug

    Hope it all works out for you image  I don't have a gertboard or an RPi so I'm afraid I can't offer a great amount of help.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 14 years ago in reply to evan.stoddard

    That's ok,  I have a friend helping me work this out.  I think he has almost got it.  I will post the results when he completes the build. image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 14 years ago in reply to evan.stoddard

    UPDATE:

     

    My friend and I have created a circuit that can run a motor one direction at one speed THROUGH the GPIO on the Raspberry Pi.  We are working on two directions now.

     

    image

     

    My friend plans to use a H-bridge to get some two direction action.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to e14 Contributor

    Ken Seymour wrote:

     

    Look up an H Bridge circuit.  I have had good luck with this kit with an Arduino.  I made a roller robot.  I tried and failed with TIP102 and TIP107 but I am clumsier than most.  If you go this route,

    buy extra transistors in case you fry them.

     

    Look at http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/.  Follow the links to basic transistor etc.

     

    The H bridge would have one output for forward and one for backwards.  The kit controls 2 motors.

    Could you draw up a schematic diagram for me if I use this: https://www.adafruit.com/products/807.  My friend has informed me that a H-Bridge is required and I found this IC and I think that it could work nicely.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to wallarug

    I have not created schematics except with pencil and paper.  I noticed that his is a 5 Volt chip and the Pi outputs are 3.3 Volt.

     

    I am working on a schematic with 2N3906 transistors to level-shift the outputs.  If you power the motors off 5V as well, it avoids two power supplies.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to e14 Contributor

    Motors are powered off 12volts.  Did you look at the Double H-Bridge IC I posted earlier?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 13 years ago in reply to wallarug

    Here is the schematic.  JP1 is meant to be the motor.  I should mention that the transistor logically invert their signals.

    When the GPIO is high, the chip input is low. So from the Pi's perspective, they are active when they are zero.

     

    You need two power supplies.  The solarbotics board has an on board regulator to provide the +5 volts.

     

    The Pi only has one PWM output, so you could do PWM in software but get the motor going fast first.

     

    Make sure the motor fits within the chip's power output max or just buy extra chips.

     

    The 2N2222A2N2222A is cheap.  Buy extra.  I live in the US so I would get them here. http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_38236_-1.

     

    Or use Newark/element 14, or Digikey, or Mauser.

    Attachments:
    image
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
<>
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