Multiple Serial Inputs

Does anyone know how to allow multiple serial inputs/outputs. I need to use at least 10 IR sensors and still have the ability to have a transceiver. Any suggestions?

Read this:
http://www.arduino.cc/playground/Learning/4051

or search for multiplex/multiplexing/mux on arduino search.

or read multiplexing section here:
http://www.arduino.cc/playground/Main/InterfacingWithHardware#Input

I'm curious when it comes to using the multiplexer. What happens when I have incoming serial information from something like a GPS module but I'm not switched to that pin. The UART has a buffer to just collect it until you read it (I think) but I'm guessing the multiplexer doesn't have anything of that sort? If that's the case, would I maybe have to set up a microcontroller on the other end that acts as a buffer until the right pin is selected and the receiving microcontroller requests data from the buffer microcontroller? Is there a better solution?

I don't think that using the multiplexing IC's will work for serial communication.

I don't know how the IR sensors work, but unless the send out a voltage using the 4051 multiplexer is not the way to go.

Do you have a link to the datasheet / specs for theIR sensors ?

I'm kind of curious why a multiplexer won't work with serial communication. I haven't dealt with them before but to me it looks like whatever port is activated the in and out to that port acts like a simple wire. If that's the case then shouldn't serial communication go through? It makes syncing a pain but possibly with a buffer, query interface with port labels on messages it can be done? Of course the big question is, if it doesn't work with a multiplexer, then how can you do serial connection to multiple components with the single UART that the ATmega168 has?

You can multiplex the physical part of the serial connection with CD4066 CMOS analog switches. They're bidirectional, as they are basically just a FET swtich.

Assuming you switch them on at the right time, you can move the serial port connection from one device to another.

D

Yes, but isn't that assuming that only one device is comunicating at any given time ?

If a device starts sendig data asuming that Arduino is listening and it's busy serving another device, things wil get hairy very fast.

If all the devices are just being polled for data it's probably a good solution.

Yes, but isn't that assuming that only one device is comunicating at any given time ?

If a device starts sendig data asuming that Arduino is listening and it's busy serving another device, things wil get hairy very fast.

If all the devices are just being polled for data it's probably a good solution.

yup- you have to manage the connections by managing the enable pins that direct the serial to different devices.

D

I just wanted to add a resource to this thread. This looked like a great Q&A on the subject: Serial port multiplexing? How to?