Digital arduino switch

hey all, I am in need of and IC to add some inputs/outputs for a project i am working on. I have looked into IO expanders and multiplexers but i was wondering if there was just a simple switch to pass data from an addressable pin to the arduino and visa versa as I can do all of the manipulation much more easily on the arduino itself rather than worrying about interfacing with I2c and using wire libraries. Is there something out there that will just switch for me?

i was wondering if there was just a simple switch

That's pretty much what the multiplexers are: the silicon equivalent of multi-position switches.

Of course, the drawback is that only one of those "positions" is connected at a time. That's usually good enough to get extra *in*puts. If, otoh, you need to have many *out*puts that will maintain the last value sent to them, even after the "switch" has been dialed to another "position", multiplexers don't do the job. Most people use shift registers for that. The 74HC595 is very popular. Too popular, really: many people use them for tasks like driving LEDs, even though they're only designed to handle driving other logic chips.

How many extra inputs and/or outputs do you need? There are some solutions that are better for adding a few, and others that are better for many.

dont multiplexers only let data go in 1 direction? if not that may be my answer. Ultimately i need to interface with around 48 1 wire devices but i need to know where this device is coming from as it will be for identification and the devices will not stay the same for each address. is there a simple solution for this many ports to just pass on the data in both directions?

Sorry i thought i was explaining clearly :-[

So basically trying to track connections such as in a data center setting where there would be a need to track where cables go without the need to go through extensive amounts of tracing cables. A 1 wire chip would be attached to the head of each cable (hence why the Id of the chip would never be constant) for tracking on each end. I am trying to use 1 arduino to request IDs from an entire panel where there may be hundereds of connections. from there it will be fed back to a computer where both sides of the cable will be found (from matching IDs, i am thinking of using a small EEPROM) and "linked" together on both ends. I just need to be able to tell the multiplexer that i want to read from panel port 1, 2, 3, etc so i can request the EEPROM data and send it out.

Sorry danman2991 I don't understand either.

With analogue MUXs you can easily select 1 of N in/outputs.

Is this a one-off just to ID cables so you can tag them or a recurring test of some kind?

If one-off there's other simple ways to test.


Rob

Let’s clear at least one thing up…

What chips do you want to interface? Chips from the Dallas “1-Wire” (trademark) family? If so, pit a capital on the “W”. E.g. the DE18B20 temperature sensor. Each chip has a unique internal number, often not used by Arduino fans when they connect a few 1-Wire chips.

If you want to interface 48 1-Wire chips, you need two wires… one for ground, one for the data signal.

The 1-Wire protocol allows you to send out a message out from the controller (e.g. Arduino) saying “chip number 1234234, send me the temperature you are sensing”. That chip then obliges. Ues… the one wire carries data both directions… just not at the same time! (It is for output from the controller most of the time, for input from one of the 1-Wire chips for brief periods after the controller has asked for data.)

See…

http://www.arunet.co.uk/tkboyd/e1didx.htm

… the gateway to lots of information on 1-Wire

I haven't tried it, but I'm pretty sure you could use a CD4051 (8-channel analog mux) and several CD4067s (16-channel) to fan out a single Arduino pin to as many as 128 cable connections. Then you'd need 3 pins to select the channel on the 4051, and 4 to drive the select lines on the 4067s.

There is a small resistance (single-digit Ohms) going through each mux, so you'd have a series resistance of about 10-12 Ohms in the 1-Wire circuit. I doubt that would cause problems. If it does, you can look into the pricier chips made for high-precision equipment.