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 10355 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
Parents
  • yvanttt
    yvanttt over 13 years ago

    One option is to use the gertboard and drop in an atmega 328.

     

    With this setup  the PI will be the brain part and the arduino  the muscle portion of the setup.

    the Gertboard has already 2 motor interface on it.

    And the arduino has 6 PWM build in.

     

     

    It will then be easy for the PI to just send the PWM values to the arduino via the serial port or I2C as you wish.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 13 years ago in reply to yvanttt

    Ok,


    I have bought a freetronics 'Eleven' which is exactly the same as the Uno. Here is what I want to do:


    1. Two motors + one servo:

    The two motors will be moving the robot and will be changing speed according to the position of a Joystick. The servo will either be the steering or for the camera (depending on whether or not it is possible to turn with the two motors and PWM). Both will be connected


    2. The Joystick:

    It will be connected to a PC running Linux (which I still have to setup) and controlling the direction and speed of the robot on the x-axis (forward/backward) and y-axis(left/right).


    3. Camera

    I have not got the camera working correctly yet (speed issues) but I will get this to work. I think that it is a combination of incorrect settings and network lag (I will see to this).


    4. The Eleven

    All the motors will be connected to this including the servo. The Two motors will be connect to PWM channel via the double H-bridge chip. I have a schematic to do this.


    5. Software

    I have no clue on how the software will work except that I need 3 pieces: Ardunio, raspberry Pi and PC. All I know is that I want dynamic speed control with the joystick. The formula that I came up with was:

    (100/255)*i

    where 'i' = position of co-ordinate of Joystick on the y-axis.


    This will give out a percentage number which I want to replicate the percentage that motors are "ON" through PWM. I don't know if this can be done but I would like advice on how to go about it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • wallarug
    wallarug over 13 years ago in reply to yvanttt

    Ok,


    I have bought a freetronics 'Eleven' which is exactly the same as the Uno. Here is what I want to do:


    1. Two motors + one servo:

    The two motors will be moving the robot and will be changing speed according to the position of a Joystick. The servo will either be the steering or for the camera (depending on whether or not it is possible to turn with the two motors and PWM). Both will be connected


    2. The Joystick:

    It will be connected to a PC running Linux (which I still have to setup) and controlling the direction and speed of the robot on the x-axis (forward/backward) and y-axis(left/right).


    3. Camera

    I have not got the camera working correctly yet (speed issues) but I will get this to work. I think that it is a combination of incorrect settings and network lag (I will see to this).


    4. The Eleven

    All the motors will be connected to this including the servo. The Two motors will be connect to PWM channel via the double H-bridge chip. I have a schematic to do this.


    5. Software

    I have no clue on how the software will work except that I need 3 pieces: Ardunio, raspberry Pi and PC. All I know is that I want dynamic speed control with the joystick. The formula that I came up with was:

    (100/255)*i

    where 'i' = position of co-ordinate of Joystick on the y-axis.


    This will give out a percentage number which I want to replicate the percentage that motors are "ON" through PWM. I don't know if this can be done but I would like advice on how to go about it.

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

    Hey Cdog, we have changed this to using a Windows Client and interfacing the joystick through Pygame. The joystick movement will then result in a changing modulation.

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

    I have started a new thread here:

    http://www.element14.com/community/thread/20181

     

    and here:

    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=19725

     

    If anyone can help me with the issues in these threads I will be happy. 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