The IR transmitter toggles up to 4 channels of the littleBits AC Switch accessory using an pulse modulation infrared LED. An ATTINY25 microcontroller, U1, swtiches the current through the IR transmitting LED in 600 us long bursts of 38 kHz.
The timing patterns of these bursts are unique for each of the 4 channels. Channels 1 through 4 are individually enabled using the DIP switch, S1, on the top of the module. S1 controls a network of resistive dividers connected to U1 pin 1. U1 measures the voltage on pin 1, and depending on which combination of DIP switches are open or closed, determines which channels should or should not be enabled.
The input signal determines when to transmit, and which channels to transmit, depending on the input voltage. 1V at the input will activate channel 1, 2V activates channel 2, and so on. If a 5V pulse is input to the transmitter, it broadcasts every channel which is enabled by S1. U1 inverts and conditions the input signal before it is passed to pin 7 of U1, and A/D converter. The U1 firmware then decides which channel to transmit based on what the voltage on U1 pin 7 is, and also taking into account if that channel is enabled based on the voltage at U1 pin 1. U1 also detects latching input signals of 3 seconds or longer, such that a when the latching signal is removed, another toggle signal is beamed out.