Close

v4.2 hardware update

A project log for Pro Trinket USB Keyboard

A USB keyboard for custom shortcuts based on the Pro Trinket and Pro Micro

stefan-lochbrunnerStefan Lochbrunner 12/11/2015 at 00:219 Comments

It's v4 with I²C ports. Lots of I²C ports. GitHub.

While the original premise of this project was that it could be easily redesigned to fit ones individual needs, @Craig Hissett convinced me to make it modular after all, just like its 'role model' Palette. Therefore, the I²C ports are for slave modules that can attach to this (master) module and extend it's functionality.Like v4 it should work with the Pro Trinket as well as the Pro Micro. But since they have their I²C pins on different pins I added solder jumpers that can be set according to the mounted MCU board.
Since there are already buttons and rotary encoders the first idea for an accessory module was a sliding potentiometer, which is obviously heavily inspired by Palette again. However, I found it difficult to find commonly available sliding pots and not to mention Eagle footprints. So I had the idea to implement them as capacitive inputs as done by @CNLohr on his glass PCBs or similar to #Capacitive touch wheel by @bram. This also made me think if I should make a version with only capacitive inputs but I'm still not completely set on this. I'd appreciate some feedback on these last thoughts.

Discussions

davedarko wrote 12/11/2015 at 10:01 point

Next up - full keyboard :D Took me a while to see that it's not the VCC connection that's missing but the GND plane that isn't shown. I totally like the I2C idea! There could be some 'scanning after start' to check for new devices and a general device with predeclared inputs 'digital/analog'. I have an old notebook touchpad I could hook this up to. Interesting. 10x10 boards from dirtypcbs.com would make a good size for 4 little tiles to test with. Voelkner.de has some sliders I bought for my unfinished #Sonic Screwdriver project - http://www.voelkner.de/search/fact-search.html?keywords=schiebe+potentiometer&x=0&y=0 

The solder jumpers are awesome too. I'm not so much into capacitive buttons, I've seen projects where that didn't really work well. 

  Are you sure? yes | no

Craig Hissett wrote 12/11/2015 at 10:43 point

Glad you like the i2c idea :-)

What I was thinking was to run check of the i2c line in setup() and create an array of attached device addresses, then in the main loop the attached devices could be stepped through and polled just as the onboard buttons are.

I'm toying with two methods for the data transfer between slave and master:

1) The slaves poll their onboard controls and send the requested command as a string string to be taken by the master and sent straight to the PC as is.

2)The master has all possible necessary combinations in an array with an ID number. The slaves then only need to send the corresponding ID to the master, wqho can then send the related combination.

I'm open to any ideas on this one Davey Baby!

  Are you sure? yes | no

Stefan Lochbrunner wrote 12/11/2015 at 11:47 point

We talked about some of this before but just so everybody is on the same page:

Re 1): This would require reprogramming of the slave(s) which inconvenient when it has to be done via ISP or USB. Having the master reprogram the slave(s) over I²C might be possible but seems like a huge undertaking.

Re 2): The master would know the ID anyway since it's polling that specific address. I was thinking if the slave just returns one or more integers (one per input; e.g. if a slave board has 4 buttons) the master could act on that. 1 and 0 would be a pressed and released button respectively, an encoder would send 1 or 2 depending on the direction of rotation and in the case of a slider (or maybe capacitive encoder) the value could go up to let's say 255.

  Are you sure? yes | no

Stefan Lochbrunner wrote 12/11/2015 at 11:35 point

lol, full keyboard... I actually dared @Craig Hissett to combine 112 of these boards to fill up the whole I²C address space... I think he's getting around to the idea ;)

Thanks for the link! Seems to be pretty much the same choice as conrad.de and on a second look the footprints between different manufacturers seem similar. Apparently I dismissed them too soon.

Yeah, I'd expect the capacitive touch inputs to require quite some tuning to get it just right which is important since it's missing the tactile feedback. Since you brought up the touchpad: At some point I thought if I make a purely capacitive version it'd probably end up becoming a touchpad where one would just define zones for buttons, sliders etc. but that's probably too far off. Does your touchpad have I²C? As far as I know, and maybe that's only the older ones, they have a PS/2 interface which should be 'easily' interfaceable with a microcontroller.

  Are you sure? yes | no

davedarko wrote 12/11/2015 at 12:06 point

I had the touchpad running but forgot the actual interface... but it must be somewhere in my arduino sketchbook. It was easy to get some x and y commands out. By the way, I think voelkner just buys stuff from conrad... now that you've mentioned it.

  Are you sure? yes | no

Craig Hissett wrote 12/11/2015 at 14:24 point

Once I have a big enough desk I'm definitely up for a massive 10x10 grid of these ha ha!

I wonder if the slaves can be coded up to just send a button/encoder ID (such as e1, b2 etc) and the master can be programmed to execute a particular function when that combination is received.

The master could then have an array of commands:

Address - button - Command

Device1 - b1 - 'Hello World'

Device1 - b2 - 'Hello Stefan'

Device2 - b1 - 'Hello Dave'

The slave's can then just identify the button that has been pressed and then the master can find the command to send based on the i2c address and the button ID. 

  Are you sure? yes | no

Craig Hissett wrote 12/11/2015 at 00:43 point

Beautifully done, Stefan. i2c can bring so much to this already incredibly versatile board.

The ability to daisychain units together (opening the door to various slave board configurations) will allow a truly customisable platform for users to build, craft and code their very own bespoke interface. All at a very low cost in comparison to the Palette.

Another thing is with i2c you can connect small lcd screens for displaying various information; attached i2c device addresses, incoming data, serial data from your computer (if application allows).

Great addition of the solder jumpers too; I hadnt really thougt about the Trinket/Pro Micro pindifferences.

Great work!

  Are you sure? yes | no

Stefan Lochbrunner wrote 12/11/2015 at 00:55 point

As always Craig, you're way too kind :)

I'll take your praise when we get the concept working, I still have my doubts about latency that I forgot to mention above.

For v3.4s I hadn't really thought about the pin differences either and though I looked into it I feel like I'm still in for another surprise ;)

  Are you sure? yes | no

Craig Hissett wrote 12/11/2015 at 01:00 point

Ha ha! Yeah I think potential latency may be the only think hampering the i2c. That being said Im sure any latency can be minimised with a robust polling. I have an idea for the code, but will elaborate tomorrow when it is not 1am :)

  Are you sure? yes | no