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 What would be the total GPIO pins available.
  • 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 11 replies
  • Subscribers 711 subscribers
  • Views 2026 views
  • Users 0 members are here
  • raspberrypi
  • gpio_configuration
Related

What would be the total GPIO pins available.

finian826
finian826 over 13 years ago

Good day,

I am thinking of employing 1 or 2 Rpi's into my model train layout to remote manage my turnouts and other specialty items on my layout.

I know through GPIO-P1 I have 17 available GPIO pins. From some of my other reading I have discovered on the new model B's there was a P5 added that gives 4 more GPIO pins for usage, but it also says in the same document that those pins are used by the system. The available pins on P5 are GPIO28-GPIO31, but those are used as follows: GPIO28-31 are used by the board ID and are connected to resistors R3 to R10.

 

I know that some are also avabile via S5 which from my understanding will eventually be used for the upcoming camera board.

 

So if I read correctly, theorietically I could have 25 possible GPIO pins available or would it only be 21 if I take and use the 4 from S5.

 

Any input on this from others would be great.

 

Thanks

Terry

  • Sign in to reply
  • Cancel
Parents
  • e14 Contributor
    e14 Contributor over 13 years ago

    Terry,

     

    The MCP23017 chips draw almost no current. 4 of them together are much less than a single LED so they can be powered by 3.3v on the Pi.

     

    The optoisoator chips are a nice design but 64 LEDs are quite a load and you may not find opto-isolators that work with only 3-5 mA current available from the 23017 output directly (do let us know). If not, you are likely to need Darlington transistor arrays (e.g.: ULN 2803 A) between your IO expanders and the optoisolators. The Darlington array-connected LEDs can be powered from a separate supply or from the 5V supply of the Pi as long as the Pi supply itself has enough power.

     

    Finally, once you use the Darlington array, I'm not entirely sure the opto-isolators are neccessary. That depends more on the grounds and whether you have inductive loads (motors, solenoids) that could introduce spikes into the Pi power bus.

     

    The PiFace uses MCP23017 and ULN2803's to drive LEDs. I haven't seen a nice schematic for this board but there could be one out there.

     

    Adrian

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • e14 Contributor
    e14 Contributor over 13 years ago

    Terry,

     

    The MCP23017 chips draw almost no current. 4 of them together are much less than a single LED so they can be powered by 3.3v on the Pi.

     

    The optoisoator chips are a nice design but 64 LEDs are quite a load and you may not find opto-isolators that work with only 3-5 mA current available from the 23017 output directly (do let us know). If not, you are likely to need Darlington transistor arrays (e.g.: ULN 2803 A) between your IO expanders and the optoisolators. The Darlington array-connected LEDs can be powered from a separate supply or from the 5V supply of the Pi as long as the Pi supply itself has enough power.

     

    Finally, once you use the Darlington array, I'm not entirely sure the opto-isolators are neccessary. That depends more on the grounds and whether you have inductive loads (motors, solenoids) that could introduce spikes into the Pi power bus.

     

    The PiFace uses MCP23017 and ULN2803's to drive LEDs. I haven't seen a nice schematic for this board but there could be one out there.

     

    Adrian

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • finian826
    finian826 over 13 years ago in reply to e14 Contributor

    Adrian,

     

    I was wondering that to, what I might do is use the Darlington arrays on the outputs controlling devices on the layout. I will be using the opto-isolators on the switch machine circuits for sure. Some will be slow moving tortoise switch motors and some will be solenoids, thse devices I wish to try and keep isolated from the Pi circuits.

     

    I am still planning the circuits out so that I can figure out how many units I will need to employ.

     

    Terry

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jamodio
    jamodio over 13 years ago in reply to finian826

    Terry,

     

    be aware if you want total isolation from the Pi, and if you use for example the SPI interface and the MCP23S17 (SPI) you can put in the middle a digital isolator like the ISO7241 that can support the high speed of the SPI interface and has separate power supplies for each side.

     

    Silicon Labs also has similar products, and as far as I remember you can get samples from both.

     

    -J

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

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube