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 Raspberry Pi with WS2812b strips
  • 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 20 replies
  • Subscribers 685 subscribers
  • Views 3489 views
  • Users 0 members are here
Related

Raspberry Pi with WS2812b strips

Former Member
Former Member over 12 years ago

Hi

       I am looking for advice regarding feasibility and future errors that I may face for my project. I am trying to control 300 led strips from Adafruit available at http://www.adafruit.com/products/1138

 

These strip require an input at voltage level 5V. I know that I must use a 3.3V to 5V voltage converter  to keep both strips and Pi safe.

 

IS there anything that I should be careful about?

 

Please help.

  • Sign in to reply
  • Cancel
  • Former Member
    Former Member over 12 years ago

    Hello guys, once again thank you for your valuable replies.

     

    First of all :- Yes I am trying to make a display out of this project. So definitely I am using 18000 leds.  Cost is not my problem. I can get a strip from www.alibaba.com for $9/- with 60 leds per meter.

     

    Here is my "theoretical" calculations:-

     

    (Basic assumption is Pi can used to create a delay of 50 n seconds when it is over clocked at 1.2GHz)

     

    To send one bit data to strip (either 0 or 1) time required = 1.25 u seconds

    to send one byte, time required = 1.25 x 8 = 10 u seconds

    to semd 24 bytes i.e. one pixel value, time required = 10 x 3 = 30 u seconds

     

     

     

    • Assume refresh rate = 50 Hz

    time for one frame = 1000/50 = 20 m seconds

    reset pulse time = 80 u seconds (Assume) (>50 u seconds required)

    consider x is max no. of pixels, then

     

    (x*30)+80   = 20000

    x*30          = 19920

    x = 664

     

    So max no of leds per pin on Pi is 664.

    8 pins are available on Pi. So max no of leds per Pi = 664*8 = 5312


    • Assume refresh rate = 25 Hz

    time for one frame = 1000/25 = 40 m seconds

    reset pulse time = 70 u seconds (Assume) (>50 u seconds required)

    consider x is max no. of pixels, then

     

    (x*30)+70   = 40000

    x*30          = 39930

    x = 1331

     

    So max no of leds per pin on Pi is 1331.

    8 pins are available on Pi. So max no of leds per Pi = 1331*8 = 10648.

     

     

    This is my theory. Please tell me if it would work!


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 12 years ago

    OK, wow, big project, I wish you great success with it.

     

    Based on my research in the past and having used and reviewed many other attempts at this.

     

    I would delegate the task of actually running the LEDs to a Micro-Controller, not the PI, this will save you a whole pile of pain. The PI is not good at that tight a data stream, you can ask for 50nS but would be very lucky to get it most of the time.

     

    A Micro-controller of almost any type will be able to handle the strip timing and the choice of controller will be down to how many strings you want on each controller and the overall refresh rate (And how much work you want the controllers to perform outside of the actual display refresh task. If your trying to make them all into a single image then there would also be the issue of synchronization between them if it is animated

     

    The PI or PI's would be used as the masters, deciding what image, performing math and other manipulations etc before instructing the controllers to output the required image.

     

    while I cannot say it is impossible to get 50nS control out of the PI, I have not seen it to-date in a reliable fashion, as long as Linux or other multitasking OS is running on it you will not be able to predict with enough accuracy to meet the requirement of driving the LED chains

     

    Of course now you have confirmed the scope and scale of this project, I will re-iterate one of my other comments

    > 1000 Amps.... your strings will be limited in length due to timing, but even more limited in length due to the power drop through the strips. To mitigate this you will need to feed power at intervals into the strips up to the limit imposed by the timing,  but still need to be aware that there can be quite a drop in volts even through the power cables so getting an even brightness may be an issue if you don't account for it

     

    I do not know enough about getting  PI hardware to do that tight timing for driving LEDs which I assume will involve code running at the core of the OS or even replacing the OS so I will not be able to help much there. On the micro-controller side of things I can provide advice or other encouragement if needed and if you choose to go that route

     

    I have to say, i look forward to seeing this completed, it will be amazing i'm sure.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • iagorubio
    iagorubio over 12 years ago in reply to Robert Peter Oakes

    Wow you will need a hell of a PSU to drive that. Even aiming for high-end Magnaseries  you will need a TSD16-1200 unit or bigger to drive it ... and if I recall that beast needs a 3U rack and is water cooled !!!

     

    Not to talk about the +$12,000 it costs !!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago

    Hi folks.

     

    Many of you guys are still confused with my specification. So Here are they in detail:-

     

    I am trying to make a screen of resolution 180X100.

    So total number of leds = 18000

    At maximum brightness each led can consume 50mA of current.

    Maximum current consumption = 18000x0.05 = 900A

    Maximum power consumption = 18000x0.05x5 = 4.5KW

     

    the screen size would be 3m by 1.33m.

     

    Strips (of length 3m) are connected horizontally in series. Power as well as the signal would also be carried horizontally.

     

    The data of pixel values to be written on screen would be provided serially from another system.

    And that is where the problem in my system lies.

     

    I have a total of 18000 leds. 3 bytes are required for each pixel. One frame requires a data of 54Kb. The refresh rate that would properly stream a video, is 25Hz.

     

    So on serial communication I would require a speed of 1.35Mbps. Maximum speed with any serial comm is 115200 i.e. 14.0625Kbps.

     

    Previously I tried with Teensy3.1 and arduino Mega. Both have the above limitation.

    That is the reason that I want to switch these boards with Pi.

     

    Following is a site were I found something related to "How to patch linux kernel with rt kernel?"

     

    https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO

     

    Let me know would it work with Pi or not.

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

    You have too little experience to fulfill this project. You are making too many mistakes to achieve this project. You are given correct advice and ignore it.

     

    So on serial communication I would require a speed of 1.35Mbps. Maximum speed with any serial comm is 115200 i.e. 14.0625Kbps.

    Serial communication is not limited to 115200. 115200 is not 14 Kpbs.

     

    The ledchips you want to use cannot use any other data transmission speed than 800kbps. If you want a 25Hz refresh rate, you can transmit max 800 /25 = 32 kbits per frame per string. With 24 bits per pixel that means 1300 pixels per string. maximum. You've performed this calculation correctly I believe.

     

    You therefore need at least 13 strings. With "13" being an odd number, I think I'd go for 16 strings of 6 lines each, so you'd get only 96 lines in your display. Or you could chose 7 lines per chain, allowing for 112 lines. 8 lines per chain is already more than 1300 pixels in a chain.

     

    You want to make a 50 ns delay. That's easy. Just call "set gpio ; clr gpio" and look on the logic analyser how long your pulse is. If it is shorter than 50ns add asm ("nop"); between the calls until it is long enough.

     

    In practise if you use something "complicated" like an actual function call, you will very quickly  have times that are already too long.

     

     

    I don't understand how a 50ns pulse on a GPIO will help you with this project.

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

    Hi Roger,

               Yes I am inexperienced. That is a fact that I have to accept. But it does not mean that I am incapable of completing this project,

               I think you still don't understand what exactly I am trying to do (I am not saying this out of any disrespect). So here is my work flow.

     

    PC >>(Communication channel may be anything)>> Controller 1 >> (Wired communication SPI / Serial i.e. RX/TX) >> Controller 2a >> LED matrix

                                                                                        ||--------- >> (Wired communication SPI / Serial i.e. RX/TX) >> Controller 2b >> LED matrix

                                                                                        ||--------- >> (Wired communication SPI / Serial i.e. RX/TX) >> Controller 2c >> LED matrix

     

    I have tried various options as Controller 2 as following

     

    Option 1 :- Arduino :-       (Problem)     :- Low SRAM limits the maximum number of leds that can be controlled with single Arduino Uno.

    Option 2 :- Teensy 3.1 :-  (Advantage) :- Solves the problem of low SRAM. Has DMA. So very fast. Can control maximum of 4000 leds.

                                         (Problem)     :- Communication with controller 1 is slow.

                                                            :- Serial Communication supports maximum baud rate of 115200 i.e. 14.4 KBytes per second. This limits the max no. of leds per                                                             controller.

                                                            :- SPI can give a maximum speed of 24000000 baud i.e. 3 MBytes per second. But there is some problem in setting Teensy3.1 as                                                             SPI slave. After working on it for a long time I decided to go with Pi.

    Option 3 :- Raspberry Pi  (Advantage)  :- Has huge capacity to do many things and a lot faster than both of the above. Has cluster capacity. Can control a maximum of                                                                   10600 leds per Pi. Can also eliminate need of Controller 1.

                                         (Problems)    :- Obtaining real time accuracy is difficult. Might need a router and switch in order to form a cluster.

     

    So this is all I can tell you about. I hope you understand exactly what I am trying to achieve.

    Once again thank you for all your support.

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

    Just a pointer. As Roger said serial communication is not limited to 115200.

     

    AFAIK the maximum baud rate of an UART is UART_CLK/16.

     

    There is even a config param for the raspberry called init_uart_clock to change its clock setting, so you can change it without recompiling the kernel.

     

    I don't know what values you can plug there, but definitely the serial limit - as Roger said  - is not 115200, the limit is in the clock signal frequency and accuracy.

     

    And a one last pointer, if you have signal speed problems I don't think networking the Pi will help at all.

     

    I don't think you are right either with clustering and why you will need a router and a switch. If you have signal speed problems the last thing you want is to add layers and layers of physical links, software and protocols on top of the problem.

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

    Hello Parag Kulkarni, you asked about using a Raspberry Pi, and I think that ultimately you will find that you just don't have low-level enough hardware to drive your pixels. Others have explored the details, and I don't think there is a need to repeat.

     

    What I would suggest is that you use a BeagleBone Black. It has two Programmable Realtime Units, each which run at 200mhz and have full access to the 50+ GPIO ports on the board. Several libraries exist to drive WS2811-based LEDs. I am the maintainer and co-author of a branch of LEDscape designed to drive 48 channels of WS2811 (maximum of about 24k pixels at 30fps): https://github.com/Yona-Appletree/LEDscape This software in combination with 5v level-shifter capes has been used to drive displays similar to the one you're making.

     

    You can either build your own hardware or use the RGB123 24 port cape (BeagleBone Black 24 Output Cape | RGB-123) to shift the voltages to 5v. Driving 18k pixels will require 18k*48ma = 864 amps at 5v. I would pick up 15 60amp 5v supplies from aliexpress: http://www.aliexpress.com/item/5V-60A-300W-Switching-Power-Supply-Driver-For-LED-Strip-light-Display-AC100V-240V-Input-5V/1518514078.html

     

    You could run two lines of 180 pixels off each port of the BBB. Using two BBBs, you could get 180*96 resolution at about 40fps.

     

    My napkin math indicates that this will cost:

    2 BBB @ $45 = $100

    2 Capes @ $40 = $80

    15 supplies @ $45 = $675

    288 meters of 60LED WS2812B @ $11 = $3168

    Wire, connectors, etc: $100

     

    Total cost of about $4200 and countless hours of construction, debugging and testing. Be sure you are comfortable working with the extremely high amperages and that you get those power supplies as close as possible to your LEDs. If you have to go more than a few feet, you'll want to use very heavy wire around 4awg (see this calculator, and aim for <5% voltage drop: Voltage Drop Calculator). I would suggest knukonceptz wire which is cheap, very flexible and of good quality. Have the Chinese manufactures pre-cut and attach your JST connectors to the LED strips so you don't have to deal with that bit to save time. Ray Wu is pretty good about that.

     

    Above all, BE CAREFUL. You're talking about a complex and very power intensive project. Other than that, good luck.

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

    The power supply voltage should be in the range 3.5-5.3v, the data voltage must be in the 4.5-5.5v range. It may be that some WS2812B's will tolerate 3.3v, it is not guaranteed.

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

    typically the data voltages will not be allowed to go above .6V + Vcc this is due to input protection diodes

    • 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.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube