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
  • 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 Occidentalis Kernel Module for PWM
  • 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
  • State Not Answered
  • Replies 16 replies
  • Subscribers 676 subscribers
  • Views 2664 views
  • Users 0 members are here
  • raspberry
  • raspberry_pi
  • raspberry-pi
  • kernel
  • raspbian
Related

Occidentalis Kernel Module for PWM

Former Member
Former Member over 11 years ago

Hello!

I'm new to RaspbPi usage and i need to make PWM with a DC Motor.  I have an SD card with NOOBS and have installed Raspbian.

I have a kernel module from the Occidentalis distribution ( from Adafruit) that enables the PI to do that but i don't know how to install it in my PI.

Can anyone help pls?

  • Sign in to reply
  • Cancel
Parents
  • iagorubio
    0 iagorubio over 11 years ago

    The power led D6  will be on if the board is powered.

     

    If the ACT led D5 flashes in a pattern it may mean there is a known error:

     

    • 3 flashes: start.elf not found
    • 4 flashes: start.elf not launched
    • 7 flashes: kernel.img not found
    • 8 flashes: SDRAM not recognised.

     

    http://elinux.org/R-Pi_Troubleshooting#Green_LED_blinks_in_a_specific_pattern

     

    The servo is 4.8V to 6V, you should not connect it to 12V.

     

    I would try first to boot it with a new SD card and see if that changes anything.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to iagorubio

    the ACT led doesn't blink anymore.

    I have 2 SD's but it doesn't change anything.

    I've tested the voltage between the TP1 and TP2 points with a multimeter and i got a 3V value and between TP2 and polyfuse a 2.7V on a side and a 3.2V on the other...i've read that the polyfuse is self repairing over a few days...problem is i'm on a timetable and i don't know what to do...buy a new one or wait..what do you think?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 11 years ago in reply to iagorubio

    the ACT led doesn't blink anymore.

    I have 2 SD's but it doesn't change anything.

    I've tested the voltage between the TP1 and TP2 points with a multimeter and i got a 3V value and between TP2 and polyfuse a 2.7V on a side and a 3.2V on the other...i've read that the polyfuse is self repairing over a few days...problem is i'm on a timetable and i don't know what to do...buy a new one or wait..what do you think?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • rew
    0 rew over 11 years ago in reply to Former Member

    Your raspberry pi has limited the current and should be ok after a while.

     

    If you powered the servo THROUGH the raspberry pi it is completely understandable that the polyfuse went. The 9 servo's (that I have a bunch of) are a lot smaller than your 37g one already draw 0.5A which is too much if you add in the raspberry pi itself.

     

    So you need to power the servo separately, or you need to power the raspberry pi from one of the GPIO 5V pins. Then you lose the "fuse" on the raspberry pi, but if you're careful not to start any fires, that will work....

     

    I'd suggest that you go for the second option: Power the pi through the 5V on the GPIO port. This should get you up and running even before the polyfuse resets....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to rew

    the PI Works! but the PWM doesn't...

    when i hit : sudo ls -al /sys/class/rpi-pwm/pwm0/ it says that no file or directory exists...then i manually downloaded the kernel from adafruit but still nothing...

    i actually don't need the PWM part, just to start/stop the motor...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • iagorubio
    0 iagorubio over 11 years ago in reply to Former Member

    If you don't need the PWM part - to regulate speed - it's much easier to use a darlington transistor array like the ULN2003 to just turn on and off the motor.

     

    Much easier and safer than driving it from the raspberry and dealing with PWM and kernel modules.

     

    http://www.adafruit.com/adablog/wp-content/uploads/2012/02/uln2003_motor1.png

     

    http://www.adafruit.com/blog/2012/02/03/part-finder-friday-darlington-transistor-arrays/

     

    It can be driven by TTL voltage levels so the Raspberry can easily drive it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • iagorubio
    0 iagorubio over 11 years ago in reply to iagorubio

    Said that there are many other ways to do it. L298 H-Bridges, power mosfets, and many other.

     

    But the ULN2003 have everything built in already to safely drive an inductive load. If you don't need reversing the motor - you will need an H-Bridge - or controlling speed - you will need PWM - the ULN2003 is the easiet IC that I have used.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to iagorubio

    do you know what can i do to have pwm working on the PI?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • iagorubio
    0 iagorubio over 11 years ago in reply to Former Member

    I don't know much about the Occidentalis distro, but if you want to use their PWM kernel module, and it's not working in your current distro, may be easier just to use that distro, as at least you will know the kernel and kernel module are compatible.

     

    Said that, If I would need PWM on the Pi I would first try the wiringPi library that have hardware and software PWM access and a gpio utility that let you set PWM from the command line just doing:

     

    gpio mode 1 pwm

    gpio pwm 1 500

     

    WiringPi

    https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/

    https://projects.drogon.net/raspberry-pi/wiringpi/functions/

    https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio

     

    If you prefer Python the RPIO library is built towards PWM and RC Servo PWM control.

     

    RPIO.PWM, PWM via DMA for the Raspberry Pi — RPIO 0.10.0 documentation

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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