On the design of a PIC ( probably 16c65 or 16c74 ) security system, we need to be able to identify one of the following situations; 1> A unique closed switch out of 128 SW's ( normally open contacts) or 2>A unique open switch out of 128 SW's ( normally close contacts) whichever case is simpler and cheaper. Switchs can be of any type, with cost as the only limitation . Any ideas of designs similar to our need????? thanks in advance juan abba PD. On one of the many possible system versions, a pair of IR emitter and detector that will read a bar code on each of the 128 positions, and will send a signal of the read reflected light changes, plus a signature type of code, self identifying the position appears as an ideal solution, as the environment will not only act as a SW, but also will be able to read bar code information at each station. Can somebody pls. identify a low cost ( below 30 cents on 5K/moth quantities ) pair of ( IR LED PLUS DETECTOR) PLUS A INTELLIGENT CHIP THAT WILL TRANSMIT THE MENTIONED SIGNATURE PLUS IR LIGHT CHANGES, over an SPI or I2C, allowing the PIC that will receive it, not only identify the position but also, reading the IR changes timing, decode the bar code being entered at each station, only one at any given time.