Author Topic: Building a keyboard library for Fritzing  (Read 12622 times)

0 Members and 1 Guest are viewing this topic.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Building a keyboard library for Fritzing
« on: Wed, 25 February 2015, 13:15:18 »
I was looking at Fritzing (http://fritzing.org) and it seems like a great tool for learning to make hardware. I love that it allows you to see your project as a schematic, on the PCB, and in a simulated breadboard. It seems like it could also be a great way to build customized keyboard designs. It doesn't, as far as I can tell, have built in support for things like Cherry MX switches, but it would be very cool if there was a Keyboard Design library that we could contribute to it, allowing for various hole-arrangements (with LEDs, without, etc.), the spacing for various key sizes, and several standard keyboard PCB sizes (40%, 60%, Full, ErgoDox, etc.).

This could be combined with the work already done here for KiCAD (https://github.com/geekhack-org/kicad-library) so the spacing would be the same and interchangeable.

This would allow people who are not experienced with hardware design but want to build custom keyboards a real jump start on the process. It would also be a huge educational tool, allowing people to look at the schematic, then check out the breadboard layout, reproduce it on a real breadboard, then output the Gerber file to produce the now-tested design as a PCB. It would also allow the sharing of modifications to existing designs to be much easier to understand.

What do people think of this idea? Is anyone here using Fritzing? Either way, does anyone with experience laying out keyboard PCBs want to help create the library of components and board sizes for Fritzing?

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3981
  • Location: Jo'burg
  • Busy making stuff
Re: Building a keyboard library for Fritzing
« Reply #1 on: Wed, 25 February 2015, 14:24:02 »
Interesting tool, if I have tome over the weekend, I'll definitely play around with it.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Building a keyboard library for Fritzing
« Reply #2 on: Fri, 27 February 2015, 04:39:16 »
Great. I look forward to hearing what you think. For someone like me who has not yet built my own keyboard, it seems much easier to get my head around than KiCAD and other CAD programs.

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #3 on: Mon, 18 May 2015, 02:17:17 »
Hi @trauring, I have been working on creating an ergodox pcb using Fritzing. This is a long term project and I have been making slow but steady progress. The Fritzing library is pretty good, and Sparkfun has a lot of components uploaded, but I have not been able to find mechanical key switches. However, with some effort I have learned to make new Fritzing parts using Inkscape to create the vector graphics. I would definitely be interested in teaming up to work on making the necessary ErgoDox parts for Fritzing. I would recommend installing Inkscape and creating a new test part in order to familiarize yourself with the process. Best regards.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Building a keyboard library for Fritzing
« Reply #4 on: Mon, 18 May 2015, 02:22:31 »
I originally loaded the ErgoDox PCB shapes into Fritzing without a problem. I never tried to make a custom part, which is of course what so had hoped to do in this thread. Glad you've decided to try. Happy to help however I can. One thing I meant to look into was how to create the hole pattern used for the key switches, which includes holes that are never used (i.e. Through-hole diode holes that are placed inside the switch space, outside the switch space and the surface mount pads - basically three sets of connections where only one is used.

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #5 on: Fri, 22 May 2015, 01:41:55 »
That is great to hear that you have already set up the basic ergodox pcb shape in Fritzing. I will try to share some screenshots / tutorial info for creating new parts as soon as I can -- this weekend if possible or maybe sometime next week depending on how my schedule works out. We could start out by focusing on creating a Cherry MX Keyswitch part, and then make the other parts after that. First things first, we would need to get the specs / measurements for the keyswitches, and make a vector image in Inkscape with those measurements. It would mostly be a bunch of little circles. Once the drawing is created, we would need to group the circles into different layers. You can make silkscreen layers for things like holes for drilling. I will follow up with more details soon.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Building a keyboard library for Fritzing
« Reply #6 on: Fri, 22 May 2015, 03:56:31 »
Have you looked at the CAD resources here?

https://geekhack.org/index.php?topic=47744.0

There a bunch of stuff in the dropbox folder, although I haven't gone through it to see if they have PCB hole designs. I posted to the thread to see if someone could direct me to them if they exist.

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #7 on: Sat, 23 May 2015, 02:25:55 »
Hey, that's great -- I found the Cherry MX Switch specs in there.

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #8 on: Sat, 23 May 2015, 16:01:35 »
Hi, I've got a little bit of time today to work on this. Here is what I've noticed at first glance. These are the specs we need to get started on an MX Cherry Keyswitch part for Fritzing:

101466-0

However, as I look at some of the reference images I have downloaded in the past, I notice that there are some extra holes:



It looks like there are extra holes in order to make the PCB reversible. Also, it looks like there is an extra set of holes at the bottom of each switch to make more space for the diode.

101469-2

This third image is part of the GrandPiano PCB design by AcidFire. It looks like he has included some extra holes at the bottom -- possibly to allow space for LEDs, although I'm not sure...

I will start work on making an .svg (vector image) and see if we can get started on making the part for Fritzing, although it surely need lots of fine-tuning and tweaking to get it right. I will try to share screenshots along the way to show how I make the part, so you can see how to make parts in Fritzing. It's a little bit tricky, but it's not too hard.

Offline VinnyCordeiro

  • Posts: 432
Re: Building a keyboard library for Fritzing
« Reply #9 on: Sat, 23 May 2015, 19:00:18 »
Hi, I've got a little bit of time today to work on this. Here is what I've noticed at first glance. These are the specs we need to get started on an MX Cherry Keyswitch part for Fritzing:

(Attachment Link)
Why imperial system? Central hole is 4mm, tab holes for PCB switches are 1.7mm, switch pads have 1.5mm holes and LED/internal diode pads have 1.0mm holes. (Seen on Cherry MX datasheet: http://cherrycorp.com/wp-content/uploads/2014/12/mx_cat.pdf)

(Attachment Link)

This third image is part of the GrandPiano PCB design by AcidFire. It looks like he has included some extra holes at the bottom -- possibly to allow space for LEDs, although I'm not sure...
It could be for SMD or through hole resistors for the LED, but I can't say for sure without looking at the schematics.

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #10 on: Sun, 24 May 2015, 03:31:49 »
Hi Vinny, thanks for the additional reference material on the Cherry MX specs -- I personally prefer Metric over Imperial any day.

I've gone in and done a little bit of work on making the Fritzing part for the switches. There is still a long ways to go, but here is what I have so far:

101576-0

Following is the method I used to place the circles in Inkscape:

101571-1

I'm sure there must be an easier way, but this seems to get the job done. There is still a lot more work to do, but this should get us off to a good start. I ended up using the metric measurements provided by @VinnyCordeiro.

* MX-Switch-PCB-1.svg (8.38 kB - downloaded 319 times.)

The link above is to the .svg file I've been working on, in case anyone wants to download it to help out.

I was looking over Inkscape and Fritzing, and remembering the tricky parts from what I first made a Fritzing part a few months ago. Following are some points that stand out to me as important... If you open a sample Fritzing part in Inkscape, then select the copper areas, and then go to Object-->Object Properties, you will see that the grouping is ID "copper1" and LABEL "#copper1", and then if you go to Object-->Ungroup, the grouping will become "copper0" and "#copper0", and then if you further ungroup it, you will be able to select the individual circles. So, when you're creating a Fritzing part, after you create all the circles, it is important to go back in and group them, first as "copper0", and then again as "copper1". And we will also probably want to set up a separate "silkscreen" grouping. Following is an image which may help to clarify:

101574-3

« Last Edit: Sun, 24 May 2015, 03:37:29 by ml_ »

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #11 on: Sun, 24 May 2015, 16:56:43 »
Well, I have successfully created a new Fritzing part for MX Cherry Switches. It's still pretty rough, and will definitely need some fine-tuning, but it appears to be acceptable.

101626-0


Following is a link to download the Fritzing part, which you should be able to import into your Fritzing library and then you should be able to use the part, as well as being able to edit the part in the Fritzing parts editor, and you should also be able to export the .svg images for each of the respective views (PCB, Breadboard, Schematic, Icon) from the parts editor, in order to check out the different .svg files. Here is the Fritzing part file (.fzpz format):

* Cherry_MX_Keyswitch.fzpz (7.63 kB - downloaded 427 times.)

Hopefully that works for trying it out. If you're not able to download and import the part, let me know and we'll try a different way to share it. I have some stuff I need to do right now, but I will try to share some more insights about creating Fritzing parts soon.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Building a keyboard library for Fritzing
« Reply #12 on: Sun, 24 May 2015, 17:40:41 »
The holes on the bottom generally correspond to diodes and LEDs.

Inside the switch, the two inner holes are for an LED. The two outer holes are for a diode. Obviously, only one of those two pairs can be used at once.

Alternately, all four holes can be used for an RGB LED. That depends on the PCB. If the PCB has four holes then it would presumably be for an RGB LED.

Underneath those four holes, are two SMD pads inside connected to two holes outside, which if the outer holes are used for diodes, would also be connected to those outer holes above. That's the design of the ErgoDox PCB – three options for connecting the diodes - an internal through-hole diode, and external through-hole diode, or an external SMD diode.

The AcidFire PCB you showed, since it has four holes in the internal holes, is presumably for an RGB LED. The pads and holes below them are for the diode.

I would suggest two versions, one that allows an LED or Diode inside the switch, and a second one that allows an RGB LED inside the switch. The only difference would be that the LED/diode version would connect the diode holes inside the switch with the holes and pads below.


Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Building a keyboard library for Fritzing
« Reply #13 on: Sun, 24 May 2015, 19:32:15 »
The holes on the bottom generally correspond to diodes and LEDs.

Inside the switch, the two inner holes are for an LED. The two outer holes are for a diode. Obviously, only one of those two pairs can be used at once.

Alternately, all four holes can be used for an RGB LED. That depends on the PCB. If the PCB has four holes then it would presumably be for an RGB LED.
4 holes are for alternatively an in-switch LED or in-switch Diode. Holes and pads to the front appear to be form the Ergodox project where you also had the option of "in-front-of-switch SMD or Through Hole Diode.

Some Projects have 4-hole RGB support but almost all with 4 holes to the front of the switch are there to support in switch Diodes (of the normal or Light Emitting Variety)

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #14 on: Mon, 25 May 2015, 00:55:28 »
Ya, we can certainly update the part and/or make different versions. Please feel free to pitch in and alter/improve the part as you see fit. This is just a rough start to get the ball rolling, and show how to make parts in Fritzing so that we can work together on making more parts in the future. Additionally here is a decent tutorial on how to make parts with Fritzing: http://jacobfenwick.com/making-a-part-in-fritzing-0-8-7b/ . There are a lot of other parts that will be needed. I have not found the Teensy processor in the Fritzing Library, for example, and there are several other missing parts as well.

Please let me know if you are able to import the part into your library, and if it looks like the measurements are correct. We will still need to double-check and fine-tune the measurements, test the part, and improve the Schematic and Breadboard views.

And now as I think about it, I guess the extra Diode holes at the bottom are actually technically a separate part from the Keyswitch, but it's probably just as well to have it included as part of the Keyswitch part.
« Last Edit: Mon, 25 May 2015, 01:16:56 by ml_ »

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Building a keyboard library for Fritzing
« Reply #15 on: Mon, 25 May 2015, 03:50:24 »
And now as I think about it, I guess the extra Diode holes at the bottom are actually technically a separate part from the Keyswitch, but it's probably just as well to have it included as part of the Keyswitch part.

I would remove it. They aren't part of any other KB and are entirely optional in the ergodox (part of which complexity was made by having one "reversible" PCB for both sides).

I'm definitely going to be checking this out.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Building a keyboard library for Fritzing
« Reply #16 on: Mon, 25 May 2015, 03:53:50 »
I think it's a pretty standard design at this point, so if people actually want to make real PCBs from Fritzing, it will be a big help. I haven't had time to test this out in Fritzing, but I hope to this week. As for the upper holes that are doubled to make it reversible, I agree that it's not necessary for most design and we could skip it, although if it's not too hard then it could always be added as another option. If ml_ wanted to make an ErgoDox in Fritzing, then he'd need that as an option. It seems that once you make one, making the variations is pretty simple.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building a keyboard library for Fritzing
« Reply #17 on: Mon, 25 May 2015, 04:34:36 »
Never heard of Fritzing but I've just installed it and imported the part (by opening it, not using the import button :-\) Quite annoying that it easily moves the switch instead of the trace and then you can't put it back, but other than that it seems to work nicely :)

One improvement that could be made though - make the outline 1u (19.05mm) instead of the size of the switch so you can align the grey boxes for easy design.  I'm trying to work out how to do that but don't want to read a guide as I learn better by experimentation so you'll probably have it done before me!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Building a keyboard library for Fritzing
« Reply #18 on: Mon, 25 May 2015, 06:28:49 »
I installed the part. Looks like a good start. You have the diode holes/pads connected to each other, but not to the pins at the top. One set of pins at the top needs to be connected to one side of the diode. Also, with the pins at the top, I think each side needs to be connected to each other. i.e. you've put in a double layout to make it reversible, but if they're reversible then they must also be connected. Taking a look at the ErgoDox, it seems they connect the pairs vertically, i.e. both left side pins are connected and both right side pins are connected.

Looking at the ErgoDox when positioned for the right hand, the right side of the diode is connected the the column. The left side diode is connected to the left side pins above. The right side pins above are connected to the row. Thus the entire switch should only really have two outgoing connections - to the row and to the column. If you want to add two holes to allow a single-color LED, then that would add two outgoing connections, although technically that is a different object, I'd still want the holes in the PCB there since it would make it easier to set up the PCB with everything in place. In any case, whether two or four connections, right now you have 10 connections without labels, and I suspect they're not actually connected to the places they should be.

Offline ml_

  • Posts: 13
  • Location: Honduras
Re: Building a keyboard library for Fritzing
« Reply #19 on: Tue, 26 May 2015, 03:05:08 »
That's great to hear that a few people have been able to check out the part in Fritzing and provide feedback. It sounds like a lot of fine-tuning is needed, as expected. As I say, this is still pretty rough, and I'm just hoping to help get the ball rolling. To be honest I didn't even create the internal connections that are depicted on the schematic view yet. And I think the schematic view stands to be improved significantly.

For some experimentation, you might open the part in the Fritzing Part Editor and take a look around, as well as possibly creating internal connections in the pcb view if you are inclined. Also you could export the .svg images of the different views (pcb and schematic in particular) and look at them in an svg editor such as Inkscape. One of the main things to be aware of is Grouping, which I described a bit in an earlier post on this thread.

I have noticed that it is common in Fritzing for there to be several variations of the same part, and I feel like this would be a good way to go. It's probably easiest to do all the fine-tuning on just one part, and then add the variations once the initial part is complete.

I am quite busy this week and next, but I will make updates as time allows, and I am hopeful that others will make modifications as well. Thanks for the feedback.

Offline mathieubolla

  • Posts: 13
Re: Building a keyboard library for Fritzing
« Reply #20 on: Mon, 13 June 2016, 07:11:17 »
Hi,

I know this topic is getting a bit old, but as this is the only place I found a Fritzing part for the Cherry MX switches, I'll post my feedback here.

First, thank you for making it. I don't even know where to start making a part in Fritzing. It's a tough job, and you invested your time in it.

I used the part as-is, in a small PCB for "preproduction". I had it made at Fritzing Fab (which is my main driver in using Fritzing: That big green "Make" button) Here are the things I noticed on the received PCB:
- I'm using a Cherry MX Blue for PCB mount (not plate mount), the "stabilizing pins" (small plastic protuberances) align perfectly with some hole "drawing", but there is no real hole there (the big one in the center, and the two smaller ones to its right and left)
- With the same switch, I see the switch has some drillings at the bottom for maybe a standard, one color LED, but it doesn't lineup with something on the PCB. The closest match are two SMD pads (meant for SMD diode maybe?), but these are slighly too wide (the LED pins would fall in between the pads) and too "down" (the LED would fall higher than that)

So, the part is not usable "as-is" on real life PCB (at least for MX Blue PCB mount, no internal diode, no internal LED), but a good start for someone knowing how to adjust it.

I'll fallback to "ghetto wiring" my diodes and jumper cables for this build. It's so more fun...