I would like to find a good way to interface many UART devices (sensors) to a single PC for data collection and processing. For my use, there may be as many as 100 UART devices each operating at 115200 baud. Currently I am using FTDI UART-to-USB bridges – a separate FTDI for each UART device. This, combined with a USB hub works fine for small numbers of devices, but beyond about 5 or 6 devices, there are problems with data drops over the virtual serial coms. And there seems to be a number limit associated with the computer (12 for one of my computers, 17 for my laptop) beyond which the computer fails to recognize more. In general this does not seem like a workable solution and even if you could hook up 100 UARTs+FTDIs+USB hubs etc., this seems like it would be a very clunky solution.
BTW, I also thought about this netburner module that supports 8 UARTs and could send the data over ethernet for a network interface: http://www.netburner.com/products/core-modules/mod5441x . It's an option, but still only 8 channels.
So certainly I'm not the first person to want to hookup and record data from many UART sensors. What is the best way to do it?
Best Answer
First off, this has been stated before, but: UART is not an appropriate sensor interface here. Pick a different sensor, if possible. I'll assume it's not possible, otherwise you wouldn't be going through all this effort.
I personally think the most important question hasn't really been answered by you:
The first case might be the easier one, because it would allow you to take one UART, and multiplex it between multiple sensors, meaning that you connect TX to the first, talk to it, then reconnect to the second, and so on. RX would be shared between all the sensors on the bus, but because it's a query/answer system, you'd always know who's currently talking (the one you asked).
If it's the second case, well: You'll need something that manages each of these onto a more flexible bus.
Personally:
There's not infinitely many addresses, and not infinitely much bandwidth, so bundle a reasonable amount of sensors via I²C to one bus each. Use a Full-Speed (12 Mb/s) USB capable microcontroller to interface all your translators, and relay the data to your PC. You can have multiple of those.
Also, there might be ready-to-use UARTs that might be usable via I²C as bus extenders.
Another thought:
There's Microcontrollers that have built-in Ethernet controllers. You just need to an Ethernet Phy (there's a standardized interface for that, called MII). Ethernet
I'd go with that solution. The ST STM32F107RC and similar microcontrollers come with said MII interface and up to 5 USARTs. Or go for the NXP LPC1830, which is significantly cheaper, but only has 4 UARTs.
That would be
Firmware: Ethernet example code from NXP, hand-written UART handling
Makes a total of about 13.50€ for 4 sensors, or about 3.50€ per sensor. You need 25 of these to connect 100 Sensors. You need a 24-Port gigabit ethernet Switch, plus another small switch for the rest which adds maybe 50€ to the bill (pre-VAT).
The benefit would be having a system that you can extend arbitrarily. If you're feeling adventurous, use an IP stack on your microcontroller (lwIP, µIP) and make it possible to deploy your devices within any LAN, even across network boundaries such as the internet and so on.
Edit: Turns out NXP ships examples that do the full TCP/IP dance on the MCU. Oh well, all the simpler then.