Raspberry Pi B+ Hat Template

I just finished creating a template for Raspberry Pi B+ Hat extender boards. You can find it here. It includes:

  • the curvy PCB outline,

  • slots and cutouts,

  • positioned RPi GPIO socket (both feed-through SMD and through-hole versions),

  • and mounting holes (with soldermask pullbacks),

  • schematic symbol and PCB footprint for the GPIO socket.

1 Like

The 3D footprint of the pin-header is not quite where it should be.

Note: I use the latest KiCad libs, so maybe they fixed something.

I tested and it looks its just the model is not center. position should be set to 0,0,0.
Also, “Select one of these board edges depending upon the type of socket that is used.” why dont you make two file with that two differences… it is confuse to use / clear the edges…

Samtec defines their SMT connector using the centroid as the origin and it’s positioneded on the PCB using the centroid, so I defined a 20x2 through-hole connector that also uses the centroid as the origin. That makes it easy to position it identically to the SMT connector.

I assume you’re using the 3D file for the standard 20x2 connector with the origin on pin 1, so it’s being drawn in the wrong place.

(model Pin_Headers.3dshapes/Pin_Header_Straight_2x20.wrl
  (at (xyz 0.05 -0.95 0))
  (scale (xyz 1 1 1))
  (rotate (xyz 0 0 90))

There is an offset defined in your file, if set to (0,0,0) it renders correctly.

is these files for the linux version of KiCad? windows versions are they available?
Thanks in advance for the help!

It’s just a KiCad template, so it should work with whatever OS you’re using. (I developed it on Windows 7.) There’s a link to the Git repository in the initial message of this thread.

My first post. I took a five hour KiCad class on the same day you posted and I was very happy because I want to make a simple hat as a learning experience. I created a new project with template. It looks wonderful. I want through holes on the pins. Where do I delete the surface mount. So far I have deleted the sch file symbol. Are there other other files? Also the connector is in a separate page. I learned how to name a wire. Is naming wire the same on two pages enough to connect between pages? Do you know of an an example with the eeprom? Thank you

Hi, Paul. Thanks for trying my Hat template.

To use the Raspberry Pi Hat template with the through-hole connector, do the following:

  1. Open the schematic. Remove the SMD connector, J1.
  2. Generate the schematic netlist.
  3. Generate the .cmp file. (The J2 connector will be the only component in it.)
  4. Open the PCB. Hover your mouse over the connector and hit e to edit it. Select the J1 SMD connector. In the Move and Place section of the Footprint Properties window, select the Free radio button. Then click OK. The SMD connector should now be unlocked so it can be removed.
  5. Read in the netlist from the schematic. In the Extra Footprints section of the Netlist dialog window, select the Delete radio button. Then click Read Current Netlist. The J1 SMD connector should disappear. Then click Close.
  6. Finally, delete the upper two arcs and edge of the board outline.

Placing a local name on a wire is not enough to create a connection between two schematic pages. Local names are local to a schematic sheet, so a wire with the same local name on two different sheets does not connect between the sheets. For the smallish designs I do, I just attach a global label to wires that go between pages.

As for the EEPROM, I assume you’re asking what gets loaded into that to tell the Raspberry Pi about the attached HAT? I don’t know. I’m just getting to that part myself.


Thanks. It’s a tutorial on how to remove a component and it filled a lot of gaps in my leanings.

Someone said it isn’t a Hat if there is no EEPROM. I needed a symbol, footprint and if the Hat spec requires a specific location. I found the spec so I am good to go. OSH Park give 3 copies of their boards so I would populate them differently depending on the function. The EEPROMs would be programmed differently, then. OSH Park will be at the next DorkbotPDX meeting so I hope I can learn some about that side of the process.

Yes, it needs the EEPROM to be called a Hat. I’m using the one they recommended: the ON Semi CAT24C32WI. There isn’t any requirement on where it has to go on the PCB, just that it has to be connected to the EEPROM clock and data pins of the I/O header.

FYI: OSH Park says:
2.56x2.21 inch (65.10x56.11 mm) 2 layer board.
3 boards at $28.30 per batch of three. $28.30

Thanks, can hardly wait.

Hi, Paul. Glad the template was useful for you. What is your Hat going to do?

FYI, if you get to the point where you need a dozen or so of your board, Itead, Seeed and Dirty PCBs can all do that for about $25. There’s also a site called PCB Shopper that will provide fairly accurate estimates for a bunch of low-cost PCB fabricators.

This is part of a learner project.

  • Install dev tools on the PI 2 and build Rockbox done
  • Learn KiCad and add iPad style scroll wheel done
  • Add eeprom done
  • Write gpio keyboard code
  • Program eeprom and learn device tree

The eeprom was the major time item in the hat.
I only plan on one board. I picked Laen’s OSH Park because I live nearby here in Portland.

About 23 minutes into this video Laen says KiCad is outpacing Eagle in his shop.

Sounds like fun, Paul!

As for KiCad outpacing Eagle, I remember Laen saying that happened once a few years ago, but then Eagle went back to being far in the lead. He couldn’t explain the one-time bump. I couldn’t find the date of the video, so maybe KiCad is surging again. Regardless, I’m glad I made the move from Eagle to KiCad.

Fixed or broken, depending on how you look at it. In the past the unspoken convention was to place the center at the geometric center for symmetrically arranged pins; this makes sense especially for SMD since the IPC standards recommend to do it that way. With the reworking of the pckages, the THT components like that header were redefined so that the (0,0) reference is Pin 1. I haven’t checked to see what has been done with the SMT components. There is no approved standard for specifying placement of the THT components so it doesn’t matter so much except of course that your older projects will require an offset to correctly position the new models. On the manufacturing side no one really cares since the specification of positions is such a mess that an operator often needs to instruct the automated assembly software how to deal with each component anyway.


But in what way is Eagle ahead? Eagle requires a ULP just to export IDF; KiCad exports IDF with no such extra software. Soon KiCad will export IGES solid models of the PCB and its components; to export IGES from Eagle you need to pay an annual license fee for third party software. With KiCad if you want to view the IDF models and don’t want to install FreeCAD, or if the FreeCAD IDF importer fails, you can create a VRML model with the idf2vrml tool and then view the model with free software. KiCad has 32 copper layers (and 32 technical layers), Eagle is limited to 16. KiCad lacks an autorouter but thanks to Alfons, freerouter works very well with KiCad. Kicad supports slots, and if you wish even slotted arcs. Eagle represents slots as multiple drill holes, something which no mechanical engineer or manufacturing engineer would ever consider a good idea.

By “ahead”, I was referring to the percentage of boards done using Eagle versus KiCad in Laen’s OSHPark panels. That’s just a (biased) sample point to get a feeling for how many people are using Eagle versus KiCad, not a judgement of which package is technically better.

I forgot to mention I removed the slot in the template and later found out the fabs OSH Park uses do not do that narrow a slot anyway

I meant iPod scroll wheel, above, of course.
Footprint from ShareBrain git for the portapack hack_rf add on project.
https://github.com/sharebrained/portapack/tree/master/portapack_hackrf Thanks to Jared Boone of ShareBrain, my KiCad instructor.

A new PI hat project showed up on OSH Park. I didn’t do the slot because I didn’t think it met the OSH Park Specs. This guy has an interesting way to do the slot and notch.