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 2039 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
  • johnbeetem
    johnbeetem over 13 years ago

    The RasPi Hardware Wiki has information on the GPIOs: http://elinux.org/RPi_Low-level_peripherals#General_Purpose_Input.2FOutput_.28GPIO.29 and http://elinux.org/RPi_BCM2835_GPIOs.

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

    If you're looking to maximise your IO, please check out the board I designed:

     

    https://github.com/Guzunty/Pi/wiki

     

    The standard configuration offers up to 25 IO pins using only four of the Pi GPIO pins via the Pi SPI interface. It can be configured to provide a few more without much work and the other Pi pins can still be used for still more I/O if need be.

     

    You can also program it to use up to 8 of the outputs as zero CPU load pulse width modulated, which may be useful in a model railway configuration. PWM does require one additional Pi GPIO pin to provide a clock.

     

    It is also very easy on the budget, only £3.20 for the bare PCB. Total parts cost is under a tenner.

     

    Perhaps the best bit is that it protects your Pi GPIO from the higher voltages that are present in a model railway layout. If you should make a mistake and allow damaging voltages onto this board, the CPLD at the heart of it is socketed and can be replaced for less than £3.

     

    This board doesn't provide high current drives, but I'm assuming as a model railway enthusiast you'll have the downstream high current stuff already.

     

    HTH,

     

    DC.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • bad_boy_y
    bad_boy_y over 13 years ago in reply to guzunty

    You can add lot of I/O whit arduino like Due see the roadtest.

    http://www.element14.com/community/roadTests/1144

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • guzunty
    guzunty over 13 years ago in reply to bad_boy_y

    Looks pretty good depending on its price. When is it going to be available though?

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

    You can expand (and actually protect) the limted GPIO of the Raspi using GPIO expanders that can be interfaced via I2C or SPI, you can find them in DIP packages easy to put on a prototype board and they can handle higher current than the Rpi pins the ones from Microchip are pretty cheap and easy to use, you can even get some free samples from Microchip.

     

    If you use two of the 16bit, you will have 32 GPIOs to play with, I'd suggest you power them from your external power supply and not from the Rpi onboard regulator.

     

    My 0.2

    -Jorge

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

    You also have the ability to connect to Arduino with storage and RTC at a pretty good price.

    http://wyolum.com/shop/25-alamode.html

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • bad_boy_y
    bad_boy_y over 13 years ago in reply to guzunty

    Derek

     

    for the arduino due realy cheap see the link (not the green guy on Zelda)

     

    http://www.newark.com/arduino/a000062/eval-board-arduino-due/dp/47W2961

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

    I think the MCP23017 is going to be my best bet. I am thinking of placing a minimum of 4 chips on a card connected to the Pi. The only issue I am seeing is how to isolate the Pi from the 5V returm signals through the chip. With having 4 chips on the board I was thinking of powering the chips with an external 5V power supply. Will the MCP23017 use 5V to return the signal back to the Pi or will it use what every voltage is powering the chip?

     

    Or would I be best to have a regulator circuit on the board to drop a 5V input down to 3.3V to power the chips?

     

    For higher voltage interfacing, like what is present on a model train layout, I plan to use opto-isolator chips to keep the 5V or 3.3V side away from the 12V to 24V side.

     

    Terry

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