P1090856 by
dork_vader_exe, on Flickr
Circuit ready for sense line wiring. I will be soldering these across the rows. Since only one column of switches is powered at a time, I can measure the rows and get NKRO (unpowered switches don't output anything.) This is how it *should* work. This prototype is really a proof-of-concept. If it doesn't work I will modify it.
P1090858 by
dork_vader_exe, on Flickr
P1090857 by
dork_vader_exe, on Flickr
Circuit with sense wires connected. The black heatshrink is actually crucial to the operation, to insulate the crossing points. *note* for this circuit it's not really required to wire it this way, I could have modified the ribbon cable or soldered to the solder points on top. This was easier though
P1090860 by
dork_vader_exe, on Flickr
P1090859 by
dork_vader_exe, on Flickr
everything wired to teensy. I chose 6.8K resistor, hopefully that will be fine... I picked the pins at random, so they were convenient to solder.
P1090861 by
dork_vader_exe, on Flickr
P1090862 by
dork_vader_exe, on Flickr
Sorry for blurry photos, I cranked the ISO up so shutter speed would be better, but I still wanted a narrow aperture so more would be in focus (longer depth of field) but I shook too much. Pro tip: do *not* have caffeine before soldering or photographing.
OK so circuit description: First of all that switch there connects power from the VCC of the teensy OR the red wire into the busbar of the transistors. I have it this way so I can power the system from the PSU and measure current draw, etc. and measure the outputs with the scope. This way I can test the system electrically with the teensy in place, and then test it with the teensy just by changing the switch. I might keep it there in the "final" since it fits and the switch was also manufactured by microswitch.
Secondly, this operates in the standard strobe / sense model of KB operation. The teensy strobes the columns, which are powered through a transistor (teensy does not have enough current to power them directly) to turn "on" one column of switches at a time. Any switch pressed in the column will send 5V back to the teensy on the sense line (across the rows). any switch not powered will not send anything, whether its pressed or not. The teensy then depowers that column and powers the next one, thereby strobing the columns.
In theory you can use any standard KB firmware for this, but "debouncing" might be an issue, you may have to add a delay between powering and depowering the columns, sensing should be fine without debouncing, but since it outputs power in a linear way, you might have to modify the sense. I will keep debouncing in place to act as a delay, and because then I don't have to modify the firmware.
Then in practice I'll crank up the scanrate until it quits working. I might have to play around with other things. the teensy has internal pull up resistors (I think?) but I might want to put a pull-up on the strobe lines, if I do that I'll have to change to PNP transistors, but I have 2n3906 for that.
OK all in a days work! I have a Kentucky derby party to attend, then I want to work on the car tomorrow, so it'll probably be next week before I have another update, or maybe later depending on how I'm feeling.