element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 Trouble getting servo and dc motors to work with adafruit 16 channel pwm controller on raspberry pi
  • 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 1 reply
  • Subscribers 661 subscribers
  • Views 1076 views
  • Users 0 members are here
  • raspberry pi i2c
  • i2c
  • pwm
  • raspberry pi io
  • servo
  • raspberry pi
Related

Trouble getting servo and dc motors to work with adafruit 16 channel pwm controller on raspberry pi

tlucas756
tlucas756 over 7 years ago

Hello everyone,

I need to get a servo motor and a DC motor of an RC car to work via pwm using a javascript app on my raspberry pi, which takes my phone's gyroscope coordinates in order to change the speed and direction of those motors.

The app does register the phone's movement, however, the motors do not move at all.

What can I do to fix this? this is fairly urgent, so any help at all is appreciated!

the files were copied from the site http://github.com/shaunuk/picar and are as follows:

pwm_test2 is the configuration file for the motors.

README.md is the instructions file I was using

socket.html is the html file that is launched, and I think its code plays a role in driving the motors.

The images are how I connected my Pi to the controller, and how I connected the controller to the servo and the DC motor.

This project was based on shaunuk's project: http://github.com/shaunuk/picar

Thank you!



Attachments:
image
image
  • Sign in to reply
  • Cancel
  • beacon_dave
    beacon_dave over 7 years ago

    I take it that you managed to swap the DC steer motor for a servo in the end ?

     

    First off you will need to connect a power supply to your servo motor and the DC motor. Your wiring diagram shows that you have connected VCC to the R-Pi, which will power the motor controller logic but not the motors.

    The motors will require a separate power supply connecting to the V+ rail.

     

    Secondly as previously mentioned, you are not controlling the speed motor by PWM with this setup - you have just wired it directly to the +V power rail so it will go full speed forwards as soon as you connect the battery to it.

     

    The original project used a r/c ESC (electronic speed control) between the R-Pi and the speed motor. You need to do the same between your Adafruit clone PWM controller board and the speed motor in order to control it via PWM.

     

    Thirdly, the original project controlled the PWM directly from the R-Pi and not from an external I2C interface motor controller board. You will require to re-write the original code so that it sends the control signals over the I2C bus to the Adafruit clone motor controller interface.

     

    Fourthly, you will need to enable the I2C interface on your Pi before you can communicate with the PWM interface.

     

    Finally, perhaps take a look at the Adafruit tutorials on using the PWM interface:

    https://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi

    https://learn.adafruit.com/16-channel-pwm-servo-driver

    • Cancel
    • Vote Up +1 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 © 2025 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.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube