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 Requesting help w/ RPi Project.
  • 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 23 replies
  • Subscribers 677 subscribers
  • Views 2162 views
  • Users 0 members are here
  • helpme
  • raspi
  • pi
  • raspberry_pi
  • learning
  • raspberrypi
  • rpi
Related

Requesting help w/ RPi Project.

peter_ambos
peter_ambos over 12 years ago

New to RPi. I plan on building a lighting setup consisting of ~ 64 Panels, which I want to control via the RPi. Is there a way to do that with the limited amount of pins the RPi supplies?

  • Sign in to reply
  • Cancel
Parents
  • guzunty
    guzunty over 12 years ago

    The RPi has 17 available IO pins. So driving 64 panels is going to be a challenge.

     

    You could arrange them in an 8x8 matrix, but there is another potential problem. The amount of current you can draw from the IO pins of a Raspberry Pi is very limited, you may not be able drive 64 panels.

     

    We need more information:

     

    - What kind of light source are you going to use?

    - How large/bright do these panels need to be?

    - Are they each going to be a single colour or do you need them to change colour?

    - Do you just want to turn them on and off or do you want to control the brightness?

    - How far from the RPi will they be mounted?

    - Is there any thing else the application needs to do beyond control the lights? 

     

    If you want advice on any of the above that's fine, but some of these I suspect are already fixed by what you want to do.

     

    - Derek

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

    Derek Campbell wrote:

     

    The RPi has 17 available IO pins. So driving 64 panels is going to be a challenge.

    Look up the Microchip GPIO Expanders MCP23017 / MCP23S17, these are 16bit expanders and you can daisy chain 8 of them per i2c bus or SPI chip select. By my count that lets you have 256 IO pins using just 5 on the Pi.

    As with any GPIO expanders, you're going to be limited in some way on the frequency you can update them, but as Peter didn't specify what his lights are we have no way of knowing if that's a problem.  Simple number of GPIO pins isn't a problem.

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

    The lights in the panels are regular LED-Tubes, like one might find as a Christmas decoration. They should be individually controllable, and some kind of brightness control would be nice, but not necessary. The panels will be used as regular room lighting.

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

    @selsinork: Yes, that is a possibility, but depending on exactly what Peter wants to do, that may not be the cheapest or best solution.

     

    I did not want to be recommending IO expansion without knowing the requirements.

     

    Let's see what he needs to do. :-)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • guzunty
    guzunty over 12 years ago in reply to peter_ambos

    Peter,

     

    So you mean like a skein of LEDs in series? Do you know how many LED's are to be controllable together?

     

    It sounds like you will definitely need some kind of I/O expansion, even if it is just current drivers. You can't draw that much current from the Pi GPIO.

     

    best,

     

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • peter_ambos
    peter_ambos over 12 years ago in reply to guzunty

    I'm not planning to pull all the current from the GPIO, i'm will be using transistors to amplify the current. I just need it for the on/off.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • peter_ambos
    peter_ambos over 12 years ago in reply to guzunty

    I'm not planning to pull all the current from the GPIO, i'm will be using transistors to amplify the current. I just need it for the on/off.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • guzunty
    guzunty over 12 years ago in reply to peter_ambos

    Yup, that'll work. Just checking, not everyone appreciates the current draw limitations of the Pi.

     

    If you don't need maximum output, you could consider multiplexing them, but I think Selsinork's suggestion will give you the maximum flexibility with respect to adding brightness control later.

     

    Those expanders are pretty low cost and four will cover your needs.

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

    Peter, we're talking about something like this http://www.adafruit.com/products/887  yes ?

     

    There are various different versions of these as seen under 'Know Your LED Strips' here http://learn.adafruit.com/digital-led-strip some of which have individually addressable LEDs which would mean you could daisy chain them all and control everything with just a couple of pins.

     

    As Derek suggests there are also various multi-channel PWM controllers like the TLC5947 24 channel device that could help, many of which will considerably reduce both pin count and complexity since you can tell the controller what you want and it'll take care of the hard stuff for you.

     

    How you proceed maybe depends on whether you have your lighting strips already, or not. Either way there are lots of choices, for how to proceed.

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

    Derek Campbell wrote:

     

    If you don't need maximum output, you could consider multiplexing them, but I think Selsinork's suggestion will give you the maximum flexibility with respect to adding brightness control later.

     

    Those expanders are pretty low cost and four will cover your needs.

    The concern would be that doing software PWM with them becomes limited by SPI clock speed, so perhaps a purpose designed multi channel PWM controller would be a better starting point.

     

    You're still right that more information is needed to help Peter get the best out of what he's trying to do image

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

    selsinork wrote:

    The concern would be that doing software PWM with them becomes limited by SPI clock speed, so perhaps a purpose designed multi channel PWM controller would be a better starting point.

     

    Yes, definitely something to think about. SPI can be driven at 16MHz and even beyond with some care. A 100Hz rate would keep the PWM pulses invisible to the human eye, so I think there's a comfortable margin there to allow a usable brightness range.

     

    I think I2C might be a better bet than SPI, given the need to connect 4 devices. That has a typical 100KHz bus speed which might be a bit closer to being limiting, though still useable I think.

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

    Derek Campbell wrote:

     

    Yes, definitely something to think about. SPI can be driven at 16MHz and even beyond with some care.

    Assuming still talking about those MCP23S17's they have a max SPI rate of 10Mhz according to the datasheet, the BCM2835 arm peripherals data sheet suggests a theoretical 125MHz max for SPI but then goes on to say that's not actually possible, but without giving enough info to tell what is.

    I think I2C might be a better bet than SPI, given the need to connect 4 devices. That has a typical 100KHz bus speed which might be a bit closer to being limiting, though still useable I think.

    MCP23017 can do 1.7MHz i2c, Pi can do 400KHz.

     

    The need to connect 4 of those to SPI shouldn't be a problem, you can configure 3 bits of addressing for each chip allowing 8 on a single spi chip select, they are quire nice that way image

     

    Anyway, I think we've come to the same conclusion - it's certainly very possible to do it. Exactly how is up to Peter, but help is available here if he needs/wants it !

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • peter_ambos
    peter_ambos over 12 years ago in reply to guzunty

    Just a short follow-up question. How do I control those chips (using code) then?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • guzunty
    guzunty over 12 years ago in reply to peter_ambos

    Here is a link that looks useful for I2C.

     

    http://www.raspberrypi-spy.co.uk/2013/07/how-to-use-a-mcp23017-i2c-port-expander-with-the-raspberry-pi-part-1/

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • peter_ambos
    peter_ambos over 12 years ago in reply to guzunty

    Thank you! Do you know where I can find a diagramm of how to hook up multiple MCP23017 chips up to one pie?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • guzunty
    guzunty over 12 years ago in reply to peter_ambos

    http://en.wikipedia.org/wiki/I²C#Design

     

    Google is your friend ;-)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • peter_ambos
    peter_ambos over 12 years ago in reply to guzunty

    Thanks! Do I need those pullup resistors or does the RPi have internal ones?

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