Author Topic: hand-wire keyboard if pins < cols+rows  (Read 3205 times)

0 Members and 1 Guest are viewing this topic.

Offline variab1e

  • Thread Starter
  • Posts: 9
  • Location: Los Angeles, CA
hand-wire keyboard if pins < cols+rows
« on: Thu, 16 March 2017, 09:45:26 »
I am looking to handwire a keyboard (almost a full keyboard) where the columns + rows will be greater than the 17 pins I have available on my Feather BluFruit 32u4. To my understanding I must have the same (or greater) number of pins on the controller as there are columns + rows. So what solution is there?

A i/o expander?
Or to make 2 columns on a single wire?

Any ideas? I'm sure this has been encountered and solved before. Any help is very much appreciated! Thanks!
-Eric

Offline ishtob

  • Posts: 514
  • Location: Boston,MA
Re: hand-wire keyboard if pins < cols+rows
« Reply #1 on: Thu, 16 March 2017, 11:59:20 »
2 columns on a single wire will increase the number of rows, so that would not really work either. i/o expander is probably the way to go with the feather

Offline joey

  • Posts: 2296
  • Location: UK
Re: hand-wire keyboard if pins < cols+rows
« Reply #2 on: Thu, 16 March 2017, 12:05:56 »
It depends on the layout.

A 60% is 15 columns 5 rows. 15 * 5 = 75. But that's quite a few more keys than you need.

So a 60% can be 8 columns 8 rows. 8 * 8 = 64. That's just enough keys for a 60%

Offline vvp

  • Posts: 887
Re: hand-wire keyboard if pins < cols+rows
« Reply #3 on: Thu, 16 March 2017, 13:06:21 »
If your keyboard has more than 8*9=72 keys then read read this:
http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/
... and select the method you like most.

Offline cribbit

  • Posts: 288
Re: hand-wire keyboard if pins < cols+rows
« Reply #4 on: Thu, 16 March 2017, 14:09:40 »
Why does a 32u4 board only have 17 pins?

As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.

The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.

I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.
I typed this post on my Slanck. I also developed a stronger, cleaner, easier handwiring method.


Offline a-c

  • Posts: 196
  • Location: USA
Re: hand-wire keyboard if pins < cols+rows
« Reply #5 on: Thu, 16 March 2017, 14:53:01 »
Why does a 32u4 board only have 17 pins?

As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.

The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.

I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.

The board he is using has BLE built in and some of the pins are dedicated to that.

Offline cribbit

  • Posts: 288
Re: hand-wire keyboard if pins < cols+rows
« Reply #6 on: Thu, 16 March 2017, 15:26:57 »
Why does a 32u4 board only have 17 pins?

As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.

The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.

I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.

The board he is using has BLE built in and some of the pins are dedicated to that.

Ah, interesting.

OP you may find it easiest to look into using TRRS (check out the Let's Split) and having one controller for BT and one controller for actually reading the matrix. This would give you plenty of pins.
I typed this post on my Slanck. I also developed a stronger, cleaner, easier handwiring method.


Offline variab1e

  • Thread Starter
  • Posts: 9
  • Location: Los Angeles, CA
Re: hand-wire keyboard if pins < cols+rows
« Reply #7 on: Thu, 16 March 2017, 15:31:34 »
Why does a 32u4 board only have 17 pins?

As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.

The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.

I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.

The board he is using has BLE built in and some of the pins are dedicated to that.

Correct - I'm using this board for the Bluetooth capability.
Would you happen to know of a GPIO expansion option for the greater?

Offline variab1e

  • Thread Starter
  • Posts: 9
  • Location: Los Angeles, CA
variab1e
« Reply #8 on: Thu, 16 March 2017, 18:29:54 »
Why does a 32u4 board only have 17 pins?

As others have pointed out, for a standard grid matrix the most pins you can have is to get as close to a square as possible aka FLOOR($pins / 2) * CEIL($pins / 2) - for 17, that can be 8 * 9. This can require some funky wire routing but is functional.

The issue with more advanced input scanning methods is that they require additional hardware - resistors, chips.

I would just spend $5 to buy an Arduino Pro Micro from Aliexpress. That'll have enough pins.

The board he is using has BLE built in and some of the pins are dedicated to that.

Ah, interesting.

OP you may find it easiest to look into using TRRS (check out the Let's Split) and having one controller for BT and one controller for actually reading the matrix. This would give you plenty of pins.

Ah, maybe using the Teensy2.0++ with an SPI bluetooth module? Would something like the Adafruit SPI bluetooth work?

Offline a-c

  • Posts: 196
  • Location: USA
Re: variab1e
« Reply #9 on: Thu, 16 March 2017, 18:56:55 »

Ah, maybe using the Teensy2.0++ with an SPI bluetooth module? Would something like the Adafruit SPI bluetooth work?

That board is the same module that is on the feather. It should work the same connected to the SPI bus. The feather is nice though since it also incorporates the lipo charger. If you can fit your matrix in 17 pins or add an io expander you could still use the feather.

Offline variab1e

  • Thread Starter
  • Posts: 9
  • Location: Los Angeles, CA
variab1e
« Reply #10 on: Fri, 17 March 2017, 09:00:17 »

Ah, maybe using the Teensy2.0++ with an SPI bluetooth module? Would something like the Adafruit SPI bluetooth work?

That board is the same module that is on the feather. It should work the same connected to the SPI bus. The feather is nice though since it also incorporates the lipo charger. If you can fit your matrix in 17 pins or add an io expander you could still use the feather.

a-c have you used the feather? Any recommendations for an i/o expander?
Right now I'm at 18 rows and 6 columns. So I need a few more...

Maybe something like this, 40 I/O over I2C
« Last Edit: Fri, 17 March 2017, 13:18:22 by variab1e »

Offline a-c

  • Posts: 196
  • Location: USA
Re: hand-wire keyboard if pins < cols+rows
« Reply #11 on: Fri, 17 March 2017, 15:10:51 »
Take a look at https://deskthority.net/wiki/Costar_replacement_controllers

He uses binary to decimal decoders. Very simple and requires little code.

Offline vvp

  • Posts: 887
Re: hand-wire keyboard if pins < cols+rows
« Reply #12 on: Fri, 17 March 2017, 15:21:20 »
The link I posted contains many ways how to do it. I prefer shift registers myself. Cheap chips and easy to handle in firmware.