Author Topic: Building 2-switch keyboard  (Read 7737 times)

0 Members and 1 Guest are viewing this topic.

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Building 2-switch keyboard
« on: Sun, 26 April 2015, 06:43:33 »
Hi! I would like to build my own keyboard for osu!
Can u match components and recommend software for me? Available here: http://allegro.pl/

To the best of my knowledge i need: 2 switches (have 2x Cherry MX Red already) + Teensy 2.0 (not available here, in Poland, need counterpart) + some Zener diodes + wires

Look around and i'm ordering:
http://allegro.pl/przewody-kable-zworki-meski-zenski-m-f-40szt-20cm-i5032615063.html
http://allegro.pl/arduino-pro-micro-atmega-32u4-leonardo-micro-hit-i5014242447.html
http://allegro.pl/zyscom-dioda-1n4148-55szt-i5235852170.html

Can someone tell me how to connect controller with switches, and then how to make it works on PC? I perused a lot od guides, but every guide isn't clear for me.
Will try to use it: http://imgur.com/a/I5RQD#4 and http://kimondo.co.uk/smallest-usb-mechanical-keyboard-world/

But after soldering, completely dont know how to set my keyboard in motion. ;)

Greetings from Poland. Thank you guys!

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #1 on: Sun, 26 April 2015, 08:05:59 »
Welcome :)

For a 2 switch board you don't need diodes, and there's not much point buying fancy wires.  You'll need to solder the pins to the controller so you'd may as well solder some thin wire you have hanging around and save yourself some money!

The pro micro you linked is a good choice and has been used for keyboards, so buy that.  I'm struggling to find the pinout with Arduino pin names to say what to connect where but if you can find one I will suggest where to connect the switches.

For the software you can probably use Easy AVR (very easy to configure) or TMK (this has more features which you don't need) depending which one works, which you'll have to test.  If not there are other options :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #2 on: Sun, 26 April 2015, 13:17:55 »
Don't know exactly what is pinout, but this is it: https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro ?

Ok, seems not hard :D And one more question, what have i to do when will i want add RGB diodes, working constant, but with adjustable color and brightness level?

Thank you!

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #3 on: Sun, 26 April 2015, 14:07:23 »
That's close but you need one that maps the pins to port numbers on the actual controller chip - they are called things like PB4, PC3 and PD5 (I said Arduino names which you found, but that was wrong...) I think this is it.

If you want RGB LEDs with brightness controls you'll be needing the TMK firmware - that's one of the features I thought you wouldn't need.  I just checked and it does run on the Pro Micro so all good.

You'll need 3 pins to manage the switches and 3 PWM pins to manage the RGB LEDs, the Pro micro only has 5 PWM pins so both LEDs will have to be the same colour brightness.  I'm not sure how you will be able to change the settings though - usually some keys on the keyboard are programmed to do it, but you won't have enough.  You might be able to add some other switches (small ones, not MX) underneath or on the side of whatever case this will be in?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #4 on: Sun, 26 April 2015, 15:51:32 »
Ok, thank you master.

&
Controller with 6PWM pins on allegro.pl?
For osu! do you know how to make diodes color change with increasing ClicksPerMinute? It would be super, just asking ;)

Ordering today, will try my best, and if it won't succed i'll come back. :D

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #5 on: Sun, 26 April 2015, 16:39:24 »
Sorry I don't know many controllers and as I can't read Polish you're probably in a better situation to search than I am.  You could post here requesting controller options, then try and find them - I'm sure someone can help :) 

Or if you can make do with less colours you can use less PWM pins - red, green and orange or red, purple and blue or would only need two pins.

Also I have never heard of osu! to know how to link to it, but I do know that if you want the LEDs to interact with software running on your computer you won't be able to set it up as a keyboard.  Instead you'll have to run something on the computer which connects to the game and your controller, and this program must convert switch presses into keyboard input and send out the clicks per minute from the game to the controller so it can set the LED brightness.  This would be fun to do but probably not easy...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline rowdy

  • HHKB Hapster
  • * Erudite Elder
  • Posts: 21175
  • Location: melbourne.vic.au
  • Missed another sale.
Re: Building 2-switch keyboard
« Reply #6 on: Sun, 26 April 2015, 18:06:34 »
"Because keyboards are accessories to PC makers, they focus on minimizing the manufacturing costs. But that’s incorrect. It’s in HHKB’s slogan, but when America’s cowboys were in the middle of a trip and their horse died, they would leave the horse there. But even if they were in the middle of a desert, they would take their saddle with them. The horse was a consumable good, but the saddle was an interface that their bodies had gotten used to. In the same vein, PCs are consumable goods, while keyboards are important interfaces." - Eiiti Wada

NEC APC-H4100E | Ducky DK9008 Shine MX blue LED red | Ducky DK9008 Shine MX blue LED green | Link 900243-08 | CM QFR MX black | KeyCool 87 white MX reds | HHKB 2 Pro | Model M 02-Mar-1993 | Model M 29-Nov-1995 | CM Trigger (broken) | CM QFS MX green | Ducky DK9087 Shine 3 TKL Yellow Edition MX black | Lexmark SSK 21-Apr-1994 | IBM SSK 13-Oct-1987 | CODE TKL MX clear | Model M 122 01-Jun-1988

Ị̸͚̯̲́ͤ̃͑̇̑ͯ̊̂͟ͅs̞͚̩͉̝̪̲͗͊ͪ̽̚̚ ̭̦͖͕̑́͌ͬͩ͟t̷̻͔̙̑͟h̹̠̼͋ͤ͋i̤̜̣̦̱̫͈͔̞ͭ͑ͥ̌̔s̬͔͎̍̈ͥͫ̐̾ͣ̔̇͘ͅ ̩̘̼͆̐̕e̞̰͓̲̺̎͐̏ͬ̓̅̾͠͝ͅv̶̰͕̱̞̥̍ͣ̄̕e͕͙͖̬̜͓͎̤̊ͭ͐͝ṇ̰͎̱̤̟̭ͫ͌̌͢͠ͅ ̳̥̦ͮ̐ͤ̎̊ͣ͡͡n̤̜̙̺̪̒͜e̶̻̦̿ͮ̂̀c̝̘̝͖̠̖͐ͨͪ̈̐͌ͩ̀e̷̥͇̋ͦs̢̡̤ͤͤͯ͜s͈̠̉̑͘a̱͕̗͖̳̥̺ͬͦͧ͆̌̑͡r̶̟̖̈͘ỷ̮̦̩͙͔ͫ̾ͬ̔ͬͮ̌?̵̘͇͔͙ͥͪ͞ͅ

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #7 on: Mon, 27 April 2015, 14:49:45 »
Micro Pro controller is cheaper than 2x enabler 1x1 with shipping ;)

I would like to build something like this:
Some info: http://vk.com/wall-6590565_69272

Components will be tomorrow in my parcelmachine. :3

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #8 on: Tue, 28 April 2015, 02:22:24 »
Good to see someone's done this already, that means the game output is available :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #9 on: Wed, 29 April 2015, 11:10:50 »
Ok, order arrived. ;)
http://i.imgur.com/khxZL61.jpg

Can u explain, how to connect Cherry MX switches with controller?
That way: http://i.imgur.com/M15xRkK.png or http://i.imgur.com/fbfjKMy.png ? I leaned on http://i.imgur.com/YATfsgF.png
« Last Edit: Wed, 29 April 2015, 12:38:47 by Pitrek »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #10 on: Wed, 29 April 2015, 19:02:42 »
Ok, order arrived. ;)
http://i.imgur.com/khxZL61.jpg

Can u explain, how to connect Cherry MX switches with controller?
That way: http://i.imgur.com/M15xRkK.png or http://i.imgur.com/fbfjKMy.png ? I leaned on http://i.imgur.com/YATfsgF.png
Actually neither of those is correct if you're using keyboard firmware made for a lot of switches :)

If you open EasyAVR and choose "Handwire Matrix" you get a pop-up text file, about half way down is "pin assignments."  This lists which pins are used for rows and columns, with the PB[number] style names I mentioned before - you need to connect one leg of each switch to a pin from the Row section and the other leg to a Column pin.  You'll need to use pins which aren't connected to LEDs (e.g. PD5 on the bottom right of the diagram) and if you might want to add LEDs later avoid the PWM pins.  It's also easier if you don't use pins next to each other so you don't accidentally solder them together.

It's late and I'm on a small screen so struggling to work it out, but I think PB1 is marked 15 on your controller and PF4 is marked A3 - this should map to row 4 column 8 which is one of the Zs in the pic below (the first row and column are 0 and I can't remember if the rows count from the bottom or top :-[).  Before you solder anything put the letters in as below, compile the hex and flash it.  Then you can carefully touch the pins suggested above with a bit of wire to check it types a Z.


For the second switch I think PF6 is marked A1 and PB2 is marked 16 so this should map to row 3 column 10, one of the Xs.  Again, test these pins with a wire before soldering.

If both work you can solder the switches to these pins - don't forget to put them through the case first :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Building 2-switch keyboard
« Reply #11 on: Wed, 29 April 2015, 20:08:28 »
You should hack it to be the same as the sixshooter.  For such a small device, you don't need the full matrix.  Have you already wired it?  I could give you some diagrams
« Last Edit: Wed, 29 April 2015, 20:12:15 by metalliqaz »

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #12 on: Thu, 30 April 2015, 00:05:41 »
Nope, waiting for confirm. ;)

EDIT1: Awaiting for your call :3
http://i.imgur.com/Afn6EFu.jpg
http://i.imgur.com/gPBY3Yg.jpg
« Last Edit: Thu, 30 April 2015, 06:35:14 by Pitrek »

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #13 on: Fri, 01 May 2015, 04:06:33 »
Guys?  :rolleyes:

EDIT1: Ok, made .hex file, now can't go trough flashing firmware. How to "install" my .hex file on board? Flip-USB doesn't detect device.
« Last Edit: Fri, 01 May 2015, 05:49:17 by Pitrek »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #14 on: Fri, 01 May 2015, 14:55:24 »
I don't know what the sixshooter is so can't help with that, but what I posted above should work.  You need to put it in bootloader mode then run the flash command, in the command prompt something like
Code: [Select]
avrdude -DV -p atmega32u4 -P SERIAL_PORT -c avr109 -b 57600 -U flash:w:PATH_TO_FIRMWARE.hex:i should work.  I use Linux so you'll need to find an avrdude tutorial to find what to put as SERIAL_PORT :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Building 2-switch keyboard
« Reply #15 on: Fri, 01 May 2015, 16:05:06 »
The sixshooter is bpiphany's board for the 6-key CM switch tester.  It has no matrix but simply 6 direct keys.  He could just pick any two inputs, then wire up his switches and use the sixshooter firmware.   I'll try to remember to post a pinout, but you can find it on geekhack by searching

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #16 on: Mon, 04 May 2015, 15:28:38 »
You need to put it in bootloader mode then run the flash command, in the command prompt something like
Code: [Select]
avrdude -DV -p atmega32u4 -P SERIAL_PORT -c avr109 -b 57600 -U flash:w:PATH_TO_FIRMWARE.hex:i should work.  I use Linux so you'll need to find an avrdude tutorial to find what to put as SERIAL_PORT :)

Tried, doesnt' work.

In Flip occures error: "atlibusbdfu.dll" not found, then: could not load library.
My friend has helped me, and somehow install drivers, and made Micro Pro works, but he programmed it by Arduino software writing own code.  It's ok as long as dont want to build sth like GH60.
Any tips?

Offline metalliqaz

  • * Maker
  • Posts: 4951
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Building 2-switch keyboard
« Reply #17 on: Mon, 04 May 2015, 21:39:43 »
You need to put it in bootloader mode then run the flash command, in the command prompt something like
Code: [Select]
avrdude -DV -p atmega32u4 -P SERIAL_PORT -c avr109 -b 57600 -U flash:w:PATH_TO_FIRMWARE.hex:i should work.  I use Linux so you'll need to find an avrdude tutorial to find what to put as SERIAL_PORT :)

Tried, doesnt' work.

In Flip occures error: "atlibusbdfu.dll" not found, then: could not load library.
My friend has helped me, and somehow install drivers, and made Micro Pro works, but he programmed it by Arduino software writing own code.  It's ok as long as dont want to build sth like GH60.
Any tips?

That error means you don't have the DFU driver installed.  The driver comes with Flip.  What controller are you using?

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #18 on: Tue, 05 May 2015, 09:12:11 »
Arduino Pro Micro clone with Atmega 32u4.

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #19 on: Wed, 06 May 2015, 16:21:15 »
Any tips?  :) Researched Google, and I am in fix.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Building 2-switch keyboard
« Reply #20 on: Wed, 06 May 2015, 16:48:55 »
Sorry but no - I've been spoiled by not having to worry about drivers for years due to using Linux.

You could download a live CD of Lubuntu, boot from it, install AVR dude, and then use the command above but that's like using a sledgehammer to crack an egg :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline berserkfan

  • Posts: 2135
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: Building 2-switch keyboard
« Reply #21 on: Thu, 07 May 2015, 08:58:35 »
While we're on this topic, I have an atmega Arduino Pro Micro (the blue chip) that I couldn't get to work. I thought I had the Soarer flashed correctly (and scwr.exe was able to detect Soarer's firmware and load more scwr files on it). But the atmega still didn't seem to pass through any keyboard signals. HIDlisten didn't work - totally no responses from a Model F keyboard that was 100% working.

Any suggestion on what I can do? At this point am thinking of abandoning Soarer's firmware, but have no idea how to get EasyAVR to work with a model F/ M.

I use win7 with 64bit.
Most of the modding can be done on your own once you break through the psychological barriers.

Offline ROFLmonstar

  • Posts: 17
Re: Building 2-switch keyboard
« Reply #22 on: Fri, 08 May 2015, 08:08:38 »
Any tips?  :) Researched Google, and I am in fix.

Try using Cygwin. I flashed a Pro Micro without Flip and with no drivers installed other than the ones that are installed with a standard installation of Cygwin.

It's the same command to flash, too.

Offline Pitrek

  • Thread Starter
  • Posts: 196
  • deskpads gallery
    • deskpads gallery
Re: Building 2-switch keyboard
« Reply #23 on: Tue, 12 May 2015, 15:15:12 »
I am going to try tomorrow. Thanks for advices. ;)