Multiplexer question (74LS151)

hi just wondering how to connect a 74ls151 to the arduino to control 8 buttons every combination i try just doesn't seem to work.

thanks in advance

here is the diagram

Pin 7 is the enable line, it has to be connected to ground for anything to come out of the chip.

That will be enough to get it going but you also need pull up resistors (about 4K7) on each of the push buttons. A TTL chip input should float high but the pull ups make it that bit more reliable.


to control 8 buttons

You only "control" output devices the buttons are input devices you "read" them.

i thought i'd reply here instead of starting a new topic. me and hicksy are working on the same project. after playing around with the multiplexer, and not liking it one bit, we're thinking of using a multi turn potentiometer on an analog input pin in conjunction with the digital input pins to increase the total number of possible input combinations.

does that sound reasonable?

Sorry I don't understand, what does:- "in conjunction with the digital input pins" actually mean?

Do you mean that if the pot is to the left you will have one set of push button readings and if it is to the right another set? It is possible to divide things like this but quite honestly it is a rubbish user interface.

Why not use a rotary encoder? Like this:

pwillard, that rotary encoder looks really interesting. i couldn't find anything like that from the local store though. is this the same thing?

mike, i think you got what i mean. they are meant to be for different led animations so i thought the knob could go from the set of slow presets to the fast presets and the push buttons to select the individual animation in each set.

The JAYCAR part is not the same as an encoder but it is a much simpler way of doing what you wanted than what you started doing with the 74151.

I would have used a 74147 myself, by the way.

The Jaycar part generates Binary Coded Decimal while you turn the control... it will give you 16 choices...

The rotary encoder, coupled with some form of feedback (LCD, LED, whatever) would give a much wider range of options but would mean you would resolve your input choices more with software.

For a sample sketch, there is always the playground...