ImagineZA
Posts: 19
Joined: Thu Oct 11, 2018 10:15 am

The Pi and its GPIO Pins

Thu Oct 11, 2018 1:48 pm

Hello,

New to Pi here,

Just wanted to confirm something with regards to the GPIO Pins on the PI, are we only allowed to use each pin once?
For example: I have an e-ink display using pins and I'd like to attached an LCD, which from what I have read uses some of the same pins. Would it be possible for both to work or not?

If it will work, are some pins able to be used by multiple devices, like the Power and GND pins?

Thanks in advance,

scotty101
Posts: 3723
Joined: Fri Jun 08, 2012 6:03 pm

Re: The Pi and its GPIO Pins

Thu Oct 11, 2018 1:56 pm

Firstly, Not all the pins on the 40 pin header are GPIO pins. Some are power supplies like 3.3v, 5V and GND. Generally speaking these pins can be shared by many devices and can be "split" to go to multiple devices. Just need to bear in mind that there is limit to the amount of current you can draw from each supply.

As for the real GPIO pins, it depends on their function. The I2C and SPI pins will allow connection to multiple devices (providing the other devices support this). With all other pins, you need to be more careful to ensure that they aren't shared by multiple devices and if they are, whether this will cause a problem.

Your e-ink and LCD devices may for example both use the SPI pins, if they do, then you need to ensure that whilst they will share MISO, MOSI and SCLK pins, that they have separate CS (Chip select) lines otherwise both devices will listen at the same time.
With I2C devices, devices will share the same pins, but each device has a I2C address. The address needs to be different for each device. Some I2C devices have fixed addresses whilst others will be configurable, either via software or by changing some pins/jumpers.

https://pinout.xyz/ is an excellent resource for checking for pin conflicts with commonly used Pi accessories.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

ImagineZA
Posts: 19
Joined: Thu Oct 11, 2018 10:15 am

Re: The Pi and its GPIO Pins

Thu Oct 11, 2018 7:40 pm

Thanks Scotty,

So the MOSI, MISO and Clock pins can be utilized by multiple devices as long and as long as the CS lines are different, all should be well?

Are there expansion boards that can double/triple the amount of these pins? Not just clone them but essentially have a 120 Pin Pi?

Cheers,

scotty101
Posts: 3723
Joined: Fri Jun 08, 2012 6:03 pm

Re: The Pi and its GPIO Pins

Thu Oct 11, 2018 8:09 pm

ImagineZA wrote:
Thu Oct 11, 2018 7:40 pm
Are there expansion boards that can double/triple the amount of these pins? Not just clone them but essentially have a 120 Pin Pi?
There are I2C and SPI port expanders. 120 extra pins is probably pushing it a bit but should be possible with a more powerful power supply.

What project do you have in mind? There may be a better way to do what you want.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

LTolledo
Posts: 1963
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: The Pi and its GPIO Pins

Thu Oct 11, 2018 9:25 pm

Maybe this (or similar to this) is what you have in mind....
Attachments
GPIO-MOD - Layout01.jpg
GPIO-MOD - Layout01.jpg (49.08 KiB) Viewed 595 times
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

scotty101
Posts: 3723
Joined: Fri Jun 08, 2012 6:03 pm

Re: The Pi and its GPIO Pins

Fri Oct 12, 2018 8:29 am

LTolledo wrote:
Thu Oct 11, 2018 9:25 pm
Maybe this (or similar to this) is what you have in mind....
I don't think that is what the OP wants. That just clones the GPIO pins. OP mentioned specifically that he wanted more GPIO pins not copies of the existing pins.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

ImagineZA
Posts: 19
Joined: Thu Oct 11, 2018 10:15 am

Re: The Pi and its GPIO Pins

Mon Oct 15, 2018 8:15 am

Hey Guys,

I already have one of those Clone boards attached, but scotty101 is right, I was looking for a way to have more pins rather than just cloning them.

I'm trying to build and code my own home monitoring system, Digital IO sensors (door etc) Temperature, humidity, a few things like that, possibly some sort of power monitoring, I understand I can configure the GPIO pins and will possibly have enough to cover all my bases, but I would also like to add a few displays to the unit which are triggered on event (an LED Hat going red if there is an issue for example) or display a couple of things on a screen (currently doing so on an e-ink display)

I was just curious to know if it was possible to have more than the standard 40 pins for the sake of making things a little easier is all.

Cheers,

scotty101
Posts: 3723
Joined: Fri Jun 08, 2012 6:03 pm

Re: The Pi and its GPIO Pins

Mon Oct 15, 2018 8:47 am

ImagineZA wrote:
Mon Oct 15, 2018 8:15 am
I'm trying to build and code my own home monitoring system, Digital IO sensors (door etc) Temperature, humidity, a few things like that, possibly some sort of power monitoring,

I was just curious to know if it was possible to have more than the standard 40 pins for the sake of making things a little easier is all.
If you want to build a home monitoring system, multiple devices is likely the best way to go. Connecting many devices to a single "central" pi with long wire lengths to the sensors is likely to be problematic and messy to route the wires.

Go for multiple devices, perhaps a mix of Pi devices like the Pi3 as the main device and perhaps some Pi ZeroWs as nodes around the house, maybe one per room. You could also consider ESP8266/ESP32 devices as a low cost/power way to send data back to the central pi.

I'd suggest using MQTT as the protocol for your various devices to communicate back to the central device.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

ImagineZA
Posts: 19
Joined: Thu Oct 11, 2018 10:15 am

Re: The Pi and its GPIO Pins

Mon Oct 15, 2018 9:54 am

I forgot about the PiZero,

Thanks, something to look in to

Return to “Beginners”