Latest from Analog

ID 393626347 © Marian Vejcik | Dreamstime.com
evcharging_dreamstime_l_393626347
ID 29734637 © Kjetil Kolbjornsrud | Dreamstime.com
bladeserver_dreamstime_l_29734637
ID 339690856 © Asliyuce | Dreamstime.com
opamp_dreamstime_l_339690856web
Dreamstime_Brooke-Becker_14980958 and University of Nebraska–Lincoln
dreamstime_brookebecker_14980958
Dreamstime_Yulia_Ryabokon_294380101
dreamstime_yulia_ryabokon_294380101
ID 267663329 © Chabkc | Dreamstime.com
batterymonitor_dreamstime_xl_267663329

Hex-Switch Decoder Uses Weighted-Capacitor Network to Reduce I/O Pin Count (.PDF Download)

May 24, 2017
Hex-Switch Decoder Uses Weighted-Capacitor Network to Reduce I/O Pin Count (.PDF Download)

A pulse-width-modulated (PWM) signal and the RC-charging characteristics of a weighted-capacitor network can be used along with a CMOS Schmitt inverter to generate a pulse whose width is linearly proportional to the 16 combinations of a hex (thumbwheel) switch. The decoding is implemented using the Arduino Uno and requires only two pins (OCRA and INT0), leaving all of the other pins free for alternate functions.

The theory, which is the basis for this design idea, is the well-known capacitor-charging equation:

Vt = V(1 ‒ e‒t/RC)

Time T required to reach a voltage k × V is given by:

T = RCln[1/(1 ‒ k)]

which shows a linear relationship with C for a fixed value of R.