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 Using Raspberry Pi to drive WS2812B LEDs
  • 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 Verified Answer
  • Replies 19 replies
  • Answers 2 answers
  • Subscribers 676 subscribers
  • Views 5379 views
  • Users 0 members are here
  • gpio
  • led
  • leds
Related

Using Raspberry Pi to drive WS2812B LEDs

Former Member
Former Member over 11 years ago

Hi there, I am pretty new to controlling hardware from the GPIO pins on the Raspberry Pi,

 

First I will give you a little background to what I am trying to achieve:

 

I have a 3D Printer which is controlled via my Raspberry Pi, running a distribution of wheezy containing OctoPrint. I have the Raspberry Pi Camera module connected up and a server accessible over the internet outside of my home network so I can see my prints progressing while away from home.

 

I am trying to use the above quoted LEDs which I purchased here:

 

20 RGB LED WS2812B Individually Addressable NeoPixel DC5V Arduino & Raspberry Pi | eBay

 

To illuminate my print bed. I chose these LED's due to them being RGB and (as the listing stated) them being compatible with the Raspberry Pi. I have thus far been unable to make them illuminate. The only light they emit is a quick purple flash when the ground and +5V supplies are first connected to the Raspberry Pi.

 

I have tried to use the Hyperion package on my Raspberry Pi but again no success. I ideally wanted to be able to be able to control them via the GPIO utilities already built in to the distribution to minimise CPU load (given the nature of 3D printer host software).

 

If anyone can advise me in this matter that would be fantastic.

 

Kindest regards,

 

Nathan

  • Sign in to reply
  • Cancel
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago

    Also needs a PI Health Warning here

     

    The world is full of demolished PIs where the PI has tried and failed to drive WS28xx LEDs, in frustration the PI launched itself from the highest possible location into the abyss.

     

    Seriously though, If you Google this you will find there have been many attempts to drive these LEDs with a PI and all so far have failed with anything but a few LEDs or completely.

     

    A kernel driver may as stated by Roger may be your only hope but Linux being Linux, it still may suffer interference or other timing issues with longer strings

     

    what I have seen successful is using say an ATMEGA328 to drive the LEDs but a PI to perform the complicated Math of other routines to calculate the patterns, this way the critical timing is un affected by the multitasking operating system of the PI. Communications can easily be set up over the SPI or I2C bus

     

    If you are successful in writing and running a kernel mode driver, the world will be knocking at your door for a copy

     

    Good luck

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to Robert Peter Oakes

    Thank you both for your responses.

     

    HAH.. me write a kernel? I would not know where to even begin beginning.. image

     

    So with you mentioning the ATMEGA328, could it therefore be a better solution to use the Arduino to actually drive the LEDs but use the Pi to send the commands? Is this what you are suggesting? I am guessing that if I was to go through the Arduino route then I could use the Adafruit NeoPixel libraries?

     

    Thanks again,

     

    Nathan

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

    Yes correct

     

    The Arduino and the Adafruit library work very well, I use this combo myself with great success, including IR remote control or over the serial and Ethernet

     

    You can run several hundred LEDs if needed but if you use too many you may have to go for a MEGA with more memory and or speed

     

    Peter

    • 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 Robert Peter Oakes

    Great,

     

    I already own an Uno R3 and a Mega however I was thinking about expanding my microcontroller collection with either an Arduino Mini or Nano V3.0 Would either of these be sufficient to drive these LEDs or would the Uno be required as a bare minimum?

     

    I am wanting to design a controller box to contain the Raspberry Pi, a twin relay board, an external power supply for the LEDs and obviously the Arduino attached to the Pi, so would ideally like to use the smallest Arduino possible.. I antisipate requiring no more than 20 of these LED's to illuminate the bed.

     

    Nathan

    • 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 Robert Peter Oakes

    Great,

     

    I already own an Uno R3 and a Mega however I was thinking about expanding my microcontroller collection with either an Arduino Mini or Nano V3.0 Would either of these be sufficient to drive these LEDs or would the Uno be required as a bare minimum?

     

    I am wanting to design a controller box to contain the Raspberry Pi, a twin relay board, an external power supply for the LEDs and obviously the Arduino attached to the Pi, so would ideally like to use the smallest Arduino possible.. I antisipate requiring no more than 20 of these LED's to illuminate the bed.

     

    Nathan

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

    Driving the LEDs will work with almost any of the micro controllers as long as it is running at least 8Mhz clock, the issue you will run into is when you start adding other capabilities like Ethernet, IR, RF etc and you start eating up memory, even programming a bunch of patterns will eat away at the memory slowly the more you add.

     

    If you are using the PI to send out the patterns or selecting from a range of pre-programed then that should be ok. You can always add an SD card then you could have a very large number of patterns to select from

    • 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