Post Reply 
Generic Calculator Shield for Arduino Photo-journal
03-18-2015, 11:24 AM
Post: #34
RE: Generic Calculator Shield for Arduino Photo-journal
Greetings, well, my personal analog keyboard R&D is mostly complete and I finally have a fully functional single column nine(9) button analog event (interrupt) driven keyboard. The keyboard is comprised of a voltage divider network (shared among all analog lines (4) and an LM339 comparator used to provide a 'falling' hardware interrupt (0) on pin 2. The interrupt handler routine then 'scans' the keyboard converting the analog-to-digital number 0-1023 to an integer in the range 1-9. On the actual keyboard a keyCode will be constructed (col,row) where '47' would represent column 4, row 7. The keyboard is 5x7 landscape, but will be wired logically as a virtual 4x9 portrait. Pics, then comment:

[Image: keyboard-analog-input2.jpg] [Image: keyboard-analog2-input2.jpg]

In the first pic I have just pressed button(s) '3' followed by '7'. The buttons are logically numbered 9-1 as you move towards the IC (LM339). I am retrieving the button code, and then displaying it to the LED display, as well the virtual display console (VT102) on the PC. You'll notice the digital keyboard has been removed from the shield (no longer needed) nouns and verbs can now be communicated via the analog keybutton panel (binary calc only needs five(5) of the nine(9) buttons.

The second hi-res pic is a close-up of the solderless bread board; you can clearly see the voltage divider, reference divider, and LM339 used to trigger the falling edge interrupt on pin 2 of the Arduino Uno (interrupt 0).

The 'zero' button analog-digital signal is '44'. The 'rest' baseline is '24'. The button numbers range from 134 to 875. The LM339 places the '44' on the non-inverting input, and monitors the other buttons as the interrupt line moves above '44'; the falling leading edge of the 339 output triggers the '0' interrupt on pin 2 leading to keyScan routine being called. The rest is display history.

Today I begin work on the actual prototype keyboard, now that I know my voltage divider | monitor schema works fine.

PS In case you were wondering, yes, I had key-bounce problems galore. Some of it I smoothed out by adjusting the pullup resistor on the output of the 339... and the rest I smoothed out with the keyScan and interruptClear routines in the firmware. What a fit. Did I ever mention that I hate contact bouncing switches!


Kind regards,
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Generic Calculator Shield for Arduino Photo-journal - MarkHaysHarris777 - 03-18-2015 11:24 AM

User(s) browsing this thread: 1 Guest(s)