Starscream205
Posts: 4
Joined: Thu Feb 28, 2019 9:58 pm

Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Thu Feb 28, 2019 10:10 pm

I am working on a robotics project and I need to attach a Speaker phat and also a Picon zero to the same Pi Zero. I am aware that hats don’t use all of the gpio pins but they usually come with an header which covers all the gpios. I was wondering if it would be possible to attach individual wires to the gpio pins and lead them to the corresponding socket on the hat.

pcmanbob
Posts: 6451
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Fri Mar 01, 2019 10:50 am

Hi.

I don't see why you cant do this, I mounted a RTC on on a remote pcb that was connected to the pi gpio via cables in a project that did not have room to stack things on top of the pi gpio.

You can also buy this for example which givers you multiple sets of gpio pins for connecting hats to.

https://www.modmypi.com/raspberry-pi/io ... w-hat-area
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

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

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Fri Mar 01, 2019 11:25 am

"....if there's a will.....there's always a way...."

....just be sure to do all connections while the whole system is powered down from the power source...

then review again the connections (at least twice) before powering up the system ...

...having the connections re-checked by a third person (must be knowledgeable of the system) before applying back power .....is always a good practice...
"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!"

klricks
Posts: 6510
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Fri Mar 01, 2019 1:39 pm

Look for Dupont wires with male and female ends: https://www.ebay.com/itm/NEW-40-Pcs-Mal ... :rk:1:pf:0
Note that the 40 wire bundle can be separated into smaller bunches or even single wires.
You can also get them with F--F and M--M ends.

Another option is ribbon cable with 40 pin IDC connectors attached.... male to female ends. Might be hard to find........
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
thagrol
Posts: 1722
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Fri Mar 01, 2019 4:58 pm

Starscream205 wrote:
Thu Feb 28, 2019 10:10 pm
I am working on a robotics project and I need to attach a Speaker phat and also a Picon zero to the same Pi Zero. I am aware that hats don’t use all of the gpio pins but they usually come with an header which covers all the gpios. I was wondering if it would be possible to attach individual wires to the gpio pins and lead them to the corresponding socket on the hat.
Yep. This can certainly be done however there are a couple of caveats:
  1. You need to know the pinout of the HAT. Many can be found here: https://pinout.xyz
  2. If you want the autoconfigration magic to work you also need to connect the ID_SD and ID_SC pins.
  3. This doesn't allow two HATS with eeproms. Their onboard eeproms will conflict so neither will configure corrcetly.
    Of course, you could skip connecting ID_SD and IDSC and configure things manually.
  4. It's up to you to resolve pin conflicts between hats. Some can be shared, some can't.
This space unintentionally left blank.

Andyroo
Posts: 3864
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Fri Mar 01, 2019 5:10 pm

thagrol wrote:
Fri Mar 01, 2019 4:58 pm
...
If you want the autoconfigration magic to work you also need to connect the ID_SD and ID_SC pins.
This doesn't allow two HATS with eeproms. Their onboard eeproms will conflict so neither will configure corrcetly.
...
Never understood this, detection is via an I2C bus but its hard coded to look for address 50 - why not allow cards to have alternate addresses as normal I2C devices often have jumpers / pads to change their addresses.

I know some sites sell 'shims' that are very small HATs that allow stacking and you can get pHAT Stacks - I assume these have the Eprom lines disabled / not connected?
Need Pi spray - these things are breeding in my house...

User avatar
thagrol
Posts: 1722
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Fri Mar 01, 2019 5:49 pm

Andyroo wrote:
Fri Mar 01, 2019 5:10 pm
thagrol wrote:
Fri Mar 01, 2019 4:58 pm
...
If you want the autoconfigration magic to work you also need to connect the ID_SD and ID_SC pins.
This doesn't allow two HATS with eeproms. Their onboard eeproms will conflict so neither will configure corrcetly.
...
Never understood this, detection is via an I2C bus but its hard coded to look for address 50 - why not allow cards to have alternate addresses as normal I2C devices often have jumpers / pads to change their addresses.
Sure, but that's not the same use case.

If you allow random addresses for the eeprom you then have to probe every address on the I2C bus to see if there is a device there. Then you have to probe every device you found to see if it's an eeprom. That's before you can even attempt to read its contents.

Then how do you know which eeprom is the right one? Which order the contents of multiple eeproms should be applied in? Etc.

Those are hard problems to solve and doing so will slow boot and make things a lot more complicated.
I know some sites sell 'shims' that are very small HATs that allow stacking and you can get pHAT Stacks - I assume these have the Eprom lines disabled / not connected?
"shim" != HAT

As for pimoroni's products, you'd have to ask them but I doubt it. I didn't see anything in the documentation that said HATs with eeproms* can only be used in a specific slot. Or that they aren't supported at all.

The one HAT at a time constraint has been around since RPF launched the HAT spec. Which, TBH, is probably what most users do anyway. Don't forget that not everything HAT shaped is actually a HAT.

* Yes, I know. If it doesn't have an eeprom it's not actually a HAT.
This space unintentionally left blank.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Is it possible to wire hats to GPIO pins instead of attaching them through a header?

Thu Mar 14, 2019 7:20 am

Starscream205 wrote:
Thu Feb 28, 2019 10:10 pm
I am working on a robotics project and I need to attach a Speaker phat and also a Picon zero to the same Pi Zero. I am aware that hats don’t use all of the gpio pins but they usually come with an header which covers all the gpios. I was wondering if it would be possible to attach individual wires to the gpio pins and lead them to the corresponding socket on the hat.

USB Sound Stick

But you don't need a speaker hat. You can use a USB sound stick for speakers and microphone.

viewtopic.php?f=91&t=224976#p1383138
I am an electronics and smart home hobbyist.

Return to “Troubleshooting”