Computing stuff tied to the physical world

New Input Plug

In Hardware on Feb 16, 2010 at 00:01

The plug rage continues. Sixteen inputs, analog and digital in any mix:

Screen shot 2010-02-15 at 12.58.04.png

I haven’t routed the connections yet so the layout and dimensions might still need to change.

This plug is an experiment. It does not use I2C, so it will need a dedicated port. The trick is that an on-board ATTiny45 is used to decode a pulse train of four pin selection bits from just the DIO pin.

Here’s the schematic:

Screen shot 2010-02-15 at 13.08.55.png

The 16 inputs are multiplexed into the AIO pin. By defining this as an analog input, you can have up to 16 analog pins, using the 10-bit ADC built into the ATmega. But defining AIO as a digital input, you can use it as a digital pin. Even works with pull-up, but the pull-up will only be active as long as the same input remains selected. Unselected inputs return to a high-impedance state.

Needs some more work though, including some firmware for the ATtiny.

    • Ah, thanks! That code will come in handy – see http://talk.jeelabs.net/topic/59 – but not for this particular board.

      The problem here is that I want to leave AIO free to tie to the mux. That means the 4-bit selection needs to be transmitted with only the DIO pin – my thought was to send a 4-bit pulse train (short pulse = 0, long pulse = 1). No pulse for a while resets the logic so another pulse train can be sent. It’s a hack, but I couldn’t figure out another way.

  1. Does this setup have an advantage over doing the A/D conversion in the ATtiny45 (or an ATtiny44 with its 8 ADC inputs and no external mux) and connect it to the JeeNode as an I²C slave?

    The ADCs of these newer ATtinys are more flexible than the ones in the ATMega*8 series, as they additionally support differential mode with 1x or 20x input gain.

    • The diff mode and gain are nice indeed. What you lose is simplicity – with this setup, you pick a channel, then do the standard ADC thing. Small amount of code, whereas doing it on the ATtiny would require defining and implementing a little protocol. More work on the ATtiny, which I don’t know too well yet.

      Bit of a toss-up, I suppose. There’s still the Slave Plug (see link above) to try things like this out, though. It’d be really nice to get some more “smart plugs” going.

  2. Nice plug rage! Don’t forget the LED driver plug! ;-)

Comments are closed.