Author Topic: Ergodox Foot pedal  (Read 3257 times)

0 Members and 1 Guest are viewing this topic.

Offline zarquon

  • Thread Starter
  • Posts: 17
  • Location: Hungary
Ergodox Foot pedal
« on: Sat, 10 January 2015, 03:54:19 »
I discovered this whole new world of mechanical keyboards a few weeks ago. Since then I sourced and built an ErgoDox and I'm trying to getting used to it.
The potential in this thing just blew my mind. After some more research I learned about foot pedals, and thought it might be awesome to hook some pedals directly to the ergodox. This way it would be possible to use it for layer switching among other things.

I tried to find some information about it, but couldn't find anything besides some posts mentioning a similar idea, but nothing of practical use. May be foot pedals / foot switches aren't that popular. I'm myself isn't sure about the practical value of them, but I'd like to try it out.

Obviously I'm very new to all this, I don't know C (yet) and know nothing about the hardware part, but I guess it could be done.
Could anyone point me to the right direction, how to start such a project?

I'm planning to use an FS3 (http://www.pcsensor.com/index.php?_a=product&product_id=153) pedal.
Any help is really apprechiated.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #1 on: Sat, 10 January 2015, 05:02:25 »
Essentially you just need to run two wires from a suitably tough and good quality switch (low resistance - keyboard signals are small) to an unused gap in your key matrix then treat it the same as any normal key.  As you're using it for layers it doesn't matter if it bounces (records two presses) or anything like that.   

The only problem might be if there's a wire length limit - hopefully someone will know, if not I'd be willing to experiment...

The pre-made switch is not ideal as you'd be paying for all the circuity which you don't need, I suggest looking into what DIY'ers use to make guitar pedals.

Interesting idea :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline zarquon

  • Thread Starter
  • Posts: 17
  • Location: Hungary
Re: Ergodox Foot pedal
« Reply #2 on: Sat, 10 January 2015, 15:09:17 »
thank you for your reply, I haven't thought wiring it directly to the matrix.
It sure is the easiest way, and I do have unused keys, as I'm having two 2x keys at the thumb cluster, instead of four 1x.
That means I can hook up 4 pedals, that's nice.

Initially I thought, that it would be nice to connect the pedals via a TRRS cable or something similar. I believe that could be done with this method you suggested, right?

the best part is: I guess even the firmware doesn't needs much alteration.

DYI guitar pedals, that's something I haven't thought of :)

thanks!

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #3 on: Sat, 10 January 2015, 22:21:19 »
No problem, random questions are my speciality :D

Wire is wire so you could connect three pedals to a TRRS cable and have a socket on the keyboard as long as the switch gaps are connected to the same row or column - I'm not familiar with the Ergodox matrix so can't say for sure.  For the 4th pedal you need another wire even if they're all connected...

The firmware won't need any modification, just tell it you have extra keys and it will never know ;)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Findecanor

  • Posts: 5038
  • Location: Koriko
Re: Ergodox Foot pedal
« Reply #4 on: Sun, 11 January 2015, 01:21:27 »
This is the matrix for the right hand (copied from ergodox-firmware/src/keyboard/ergodox/matrix.h)
Code: [Select]
                            k57,k58,k59,k5A,k5B,k5C,k5D,                \
                            k47,k48,k49,k4A,k4B,k4C,k4D,                \
                                k38,k39,k3A,k3B,k3C,k3D,                \
                            k27,k28,k29,k2A,k2B,k2C,k2D,                \
                                    k19,k1A,k1B,k1C,k1D,                \
                        k07,k08,                                        \
                        k09,k17,k18,                                    \
                        k0C,k0B,k0A
The first digit in each symbol above is row, the second is column.

The matrix on each half has two unused positions, but most ErgoDox keyboards also have 1×2-sized thumb keys and the keyboard design allows each of these to be divided into two 1×1keys.
So, if you use 1×2-sized thumb keys then there are 2 unused keys to be used: These are k17 and k18. Both are on row 1, so you would need three wires to hook them up.
There are also two unused positions in the matrix: k37 and k0D. k37 is in the same column as k17 which would be already connected so you would need only one additional wire to connect that one too.
🍉

Offline hoggy

  • * Ergonomics Moderator
  • Posts: 1502
  • Location: Isle of Man
Re: Ergodox Foot pedal
« Reply #5 on: Sun, 11 January 2015, 02:42:27 »
Interesting project. Just so you know, you can get USB foot pedals that you can program to effectively press any key on a keyboard or a mouse.  (They won't be able to trigger a layout on an ergodox, though.)
GH Ergonomic Guide (in progress)
http://geekhack.org/index.php?topic=54680.0

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #6 on: Sun, 11 January 2015, 04:41:54 »
This is the matrix for the right hand (copied from ergodox-firmware/src/keyboard/ergodox/matrix.h)
Code: [Select]
                            k57,k58,k59,k5A,k5B,k5C,k5D,                \
                            k47,k48,k49,k4A,k4B,k4C,k4D,                \
                                k38,k39,k3A,k3B,k3C,k3D,                \
                            k27,k28,k29,k2A,k2B,k2C,k2D,                \
                                    k19,k1A,k1B,k1C,k1D,                \
                        k07,k08,                                        \
                        k09,k17,k18,                                    \
                        k0C,k0B,k0A
The first digit in each symbol above is row, the second is column.

The matrix on each half has two unused positions, but most ErgoDox keyboards also have 1×2-sized thumb keys and the keyboard design allows each of these to be divided into two 1×1keys.
So, if you use 1×2-sized thumb keys then there are 2 unused keys to be used: These are k17 and k18. Both are on row 1, so you would need three wires to hook them up.
There are also two unused positions in the matrix: k37 and k0D. k37 is in the same column as k17 which would be already connected so you would need only one additional wire to connect that one too.
Excellent :)  Just need to be careful with the diodes and connection points as two will be in the pedal on one of the shared wires, that one needs connecting behind the PCB diodes, not to the switch hole.

That looks like an easy mod to the firmware to add K37 to the matrix, is it easy enough to make it do something?

Also, don't suppose you know the max wire length for a switch?  I hope it's pretty long...

@zarquon - how much do you want that 4th pedal?  It would mean another two wires so you'd need a 6 pin connector.  These came to mind but they are expensive (look around, that was the first link I found) and fiddly to solder.  Or you could use two TRS connectors, not as tidy but would work?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline zarquon

  • Thread Starter
  • Posts: 17
  • Location: Hungary
Re: Ergodox Foot pedal
« Reply #7 on: Tue, 13 January 2015, 04:25:28 »
@hoggy Thanks for the suggestion. Hooking the pedal directly to the ergodox would give it more flexibility. I'd like to map layer switching to the pedal.

@suicidal_orange I don't really understand how the wires are supposed to connect and where the diodes should be soldered. I guess, because of the shared wire, it's not that simple that I solder the diodes to the PCB and connects the wires to the switch holes where otherwise the cherry mx switches would go.
Please mind, that I'm very new to electronics:)
I do very much want the fourth pedal, and willing to find a 6 pin connector or add a second trrs.

@Findecanor Thanks for pointing out the other two unused positions, I wasn't aware of them. I'm completely lost on where should I connect the wires if I'd utilize them.


Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #8 on: Wed, 14 January 2015, 02:28:58 »
@suicidal_orange I don't really understand how the wires are supposed to connect and where the diodes should be soldered. I guess, because of the shared wire, it's not that simple that I solder the diodes to the PCB and connects the wires to the switch holes where otherwise the cherry mx switches would go.
Please mind, that I'm very new to electronics:)
I do very much want the fourth pedal, and willing to find a 6 pin connector or add a second trrs.

You can think of it as each wire being shared - one set of wires (either columns or rows) are all directly connected to one pin on the controller, while on the other set there is a diode between each switch and the pin.

So for the invisible switch you would need to connect one leg on the switch to the non-diode leg of another switch in the correct row/column (depending which it is) and the other you'd need to trace the circuit from the switch in the same row/column to a diode and connect a second diode with the same polarity to that solder point.

For one of the shared wires in the pedal you would need to connect a long wire to the back side of the diode on the PCB and in the pedal connect the two switches to their own diodes, then those diodes to the wire.

It would be easier for you to use two TRRS connectors (or a different 8 pin connector), that way you could wire each pedal to an existing switch hole, but if you want to learn about how keyboards work you should try and get it to work with 6 wires, when researching just forget you're using foot pedals as the circuit is the same. 

If this doesn't make sense say so and I'll try and work it out from some photos and explain it without all the "ifs and buts" :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline zarquon

  • Thread Starter
  • Posts: 17
  • Location: Hungary
Re: Ergodox Foot pedal
« Reply #9 on: Wed, 14 January 2015, 04:18:07 »
If this doesn't make sense say so and I'll try and work it out from some photos and explain it without all the "ifs and buts" :)

Thank you for your effort, I really appreciate it. I'd like to learn more about everything, it always fascinates me how things works:)
I'll try to figure out what you said with the schematics of the ergodox, but if you could show it on a photo or a mock up that would be awesome!

If I take a handful of wires, diodes and a switch and start to experiment, can I irreversibly damage the ergodox somehow?

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #10 on: Wed, 14 January 2015, 15:12:55 »
Thank you for your effort, I really appreciate it. I'd like to learn more about everything, it always fascinates me how things works:)
I'll try to figure out what you said with the schematics of the ergodox, but if you could show it on a photo or a mock up that would be awesome!

If I take a handful of wires, diodes and a switch and start to experiment, can I irreversibly damage the ergodox somehow?
This explains how a switch matrix operates complete with animations which is better than I'd be able to knock up.  Have a read and hopefully it will make sense :)

Unlike most electronics projects where a short can damage something the worst you can do playing around in a switch matrix is to make the controller think you're holding a switch down, which obviously does no damage - have a play!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline zarquon

  • Thread Starter
  • Posts: 17
  • Location: Hungary
Re: Ergodox Foot pedal
« Reply #11 on: Thu, 15 January 2015, 07:51:17 »
I looked at the schematics for some time and I guess I understand what is going on.
I traced which row and which column is connected to which leg of the teensy. Can I connect the foot switches directly there instead of soldering them to the switch holes, and put all the extra diodes which are required for the foot switches in the pedal? That would mean the diodes would be at the end of a ~2 meter long cable (assuming it tolerates the cable length at all)

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #12 on: Thu, 15 January 2015, 09:52:39 »
You can solder directly to the Teensy but the pins are quite close together so you have to be careful not to short them, the switch holes and diodes are much more spaced out so it's easier (but messier) to solder there.  The Teensy wont know either way, the nice labelled layout is just so you can easily work out which switch doesn't work if it goes wrong.  I don't think you'll be confusing the pedal with a normal switch though :))

The location of the diodes also doesn't matter - either the signal is strong enough to be noticed through a long wire, a switch and a diode or it isn't.  Only one way to find out and my Teensy still isn't here so I haven't done so.  Hopefully tomorrow...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline zarquon

  • Thread Starter
  • Posts: 17
  • Location: Hungary
Re: Ergodox Foot pedal
« Reply #13 on: Sat, 17 January 2015, 08:51:25 »
I can confirm, that it's working with a cable slightly longer than 2 meters.
Today I successfully tested it, now I only need to find a 6 pin connector and four pedals:)

I'll try to make a detailed tutorial when it's ready and working.
Thank you for the help, it was a fantastic experience to figure out how it could be done. I learned a lot and am very happy now.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Ergodox Foot pedal
« Reply #14 on: Sat, 17 January 2015, 11:06:29 »
No problem, I'm just glad to hear it works :)

The connector I linked above is solid and locks in place so if there is a risk of pulling the keyboard off the desk I don't recommend it, but other than that they are very nice and small and you can get panel mounted one for the keyboard end.  See here for size comparison with a TRS (it's the one in the balanced IC).  But did I mention soldering it is not fun?  Can't say that enough times, unfortunately...

I can't think of any other options but I guess there must be some, happy hunting :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline hoggy

  • * Ergonomics Moderator
  • Posts: 1502
  • Location: Isle of Man
Re: Ergodox Foot pedal
« Reply #15 on: Sun, 18 January 2015, 02:02:57 »
In case it helps, you can glue to Velcro to the underside of the pedal to stop it hiding from you.  Only works on carpets of course.
GH Ergonomic Guide (in progress)
http://geekhack.org/index.php?topic=54680.0