ANALOG KEY CLICK PID: MIKROE3409 Weight: 28 g Analog Key Click is an analog keyboard on a Click bo ard. It contains six tacti le pushbuttons, used to select one of six different voltag e levels . The idea behind this cl ick is very simple: six resistors form a voltage divider. The resistors are connected in series between the VCC and the GND. Each button selects one of the six middle taps, allowing six different voltage levels to be selected. The voltage is avai lable at the AN pin of the mikroBUS , which is additionally protected by an operational ampli fier, configured as a buffer. This allows both protec tion and a proper impedance at the analog input pin of the microcontroller. Featuring six highquali ty pushb uttons, a simple debouncing cir cuit, an d the output opamp buffer, this Click board is an i deal solution for different applications controlled by discrete voltage levels, but also f or appl ications which have re stri cted number of free pins . This type of keyboard can be used as password terminals for small alarm systems, for selecting an option in various embedded applications, and for all kinds of small DI Y projects where low pin count is a big concern. HOW DOES IT WORK As already mentioned, the working principle of this Click board is very simple: it contains a voltage divider, f orme d by six 1 k resistors. Those resistors ar e connected in series, and each connection point is routed to one pin of the SPST pushbutt on. The KMR2 series KMR221 tactile buttons are highqualit y SPST switches produced by CKSwitches, a company specialized in production of various types of quality s witches. These buttons are rated to endure up to 300,000 switching cycles and have very low ON resista nce of less than 100 m . The buttons are r ubbe rized and have a pleasant tactile f eel when pressed. By pressing a button, the respect ive connection point becomes redirected to t he input of the OPA344, a lowpower operat ional amplifier from Texas Instruments , which is configured t o work with the unity gain, forming a buffer for the input of the microcontroller (MCU). This prevents changes of the impedance at the MCU input pin, as well as a limited amount of ESD protection. By substituting the voltage di vide r resist ors wi th two equivale nt r esistances (RE1 for the upper set of resistors, an d RE2 for the lower set of resistors ) the principle can be understood even better: when the top button is pressed (T1), the equivalent RE1 r esistance will be 0 , so regardless of the RE2 resistance, the voltage a t the AN pin will be equal to VCC. When the second button (T2) is presse d, t he equivalent RE1 resistance will be 1 k, while the RE2 resist ance will be 5K. The voltage at the AN pin can now be easily calculated by using the simple voltage divider formula: VOUTVCC RE2 / RE1RE2