Interfacing input switches to 74HC165 Shift Register

Discussion in 'General Electronics Chat' started by Leigh, Mar 13, 2016.

  1. Leigh

    Thread Starter Member

    Feb 11, 2010
    20
    3
    Hi,



    I have a project that uses the ATTiny167. I have 7 input switches. To read the state of the switches I poll them in a loop. To reduce the use of pins on the 167 I use a 74HC165 shift register ic. I tie the inputs of the 165 High, and have the switches connected to GND to take the input Low when activated. In the final application the switches will be located many metres away from this circuitry. What would you wise folk suggest I need as a buffer (if any) to the switched inputs of the 167?



    I appreciate any comments / suggestions.

    Leigh
     
    Anmar Abbas likes this.
  2. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    Unless you are a very electrically noisy environment, I don't think you will need any added circuitry.
    At most, a small capacitor to ground at the input, would suppress any noise.

    Note that mechanical switch contacts generally bounce for several tens of milliseconds when activated.
    Will that cause any problem in your application?
     
  3. Leigh

    Thread Starter Member

    Feb 11, 2010
    20
    3
    Thanks crutschow. My reason for choosing to take the input Low on activation is that any "stray voltages" on the line would tend to keep the input tied high (I use resistors there, of course). Maybe I'm wrong. Any switch bounce shouldn't be a prob. I will read the inputs a couple of times with brief delay between, to confirm a meaningful reading.

    I appreciate your response.
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    Noise pickup is AC by nature and so can be either polarity. Whether you tie the lines high or low will likely make little difference as to the noise sensitivity.
     
  5. Leigh

    Thread Starter Member

    Feb 11, 2010
    20
    3
    Ah yes. That exposes my lack of any formal (College / Uni etc) electronic education. :)
     
Loading...