Trying to remotely switch between 7 serial connections. - Page 1
Forum section: electronics / projects

author: Treehouseman
author_rank: Unknown
timestamp: March 05, 2016, 05:37:27 am
content: I've been working on an overly complicated clock project that has resulted in it containing 7 arduino pro mini's, an arduino mega, and an ESP8266 for wifi. I came across the ESP-Link firmware that would give me a wifi based serial link and I'm wanting to add it to the clock to manage programming of the arduinos and configuration of the wifi ESP by adding a second ESP (I already have a handful as well as a handful of extra pro mini's). The original idea was that I would have configuration dip switches on the back, a tedious and clunky thing that while it would work would be annoying to install and use, but someone mentioned to me that I could use an analog switch IC, so I started looking into those. From what I can see so far it looks like they're designed for this type of use but I can't find any information on any successful/unsuccessful attempts of using one with this style setup. I'd need to be able to control the reset, tx, and rx, pins of each device and transfer them over from the normal wiring to go to the second ESP, so I've been looking at SPDT IC's. And after a few hours I just feel hopelessly lost, there's plenty of IC's that look like they'll work but I can't justify spending $30+ on a whim for something that if it doesn't work I'll probably not have an alternative use for. Ideally in the end I'll have the second ESP have a web interface to select the device to connect to, then I can just telnet in and reprogram or send direct commands as needed without needing to change wiring or switches. I'm less concerned with getting the ability to control the gpio on the second ESP when using ESP-link since I could just use one set of dip switches instead of 3 and a bunch of headers for an external programmer. If anyone has advice or experience with these IC's it'd really be appreciated.Also for those curious why a clock needs 7 microcontrollers, the main display is made up of 6 viewfinders that each need a composite video feed.

author: MK14
author_rank: Super Contributor
timestamp: March 05, 2016, 06:11:30 am
content: I'm finding it partially difficult to understand how exactly, you have got things wired up together, WITHOUT a schematic diagram.But it is beginning to sound like, you may be looking for logic level multiplexers. These (low cost) chips, allow you to connect, e.g. 8 devices (each with 4 signal pins), into one set of 4 signal pins. But I could easily be misunderstanding the situation.Example:http://www.digikey.com/product-detail/en/texas-instruments/CD74HCT251EE4/CD74HCT251EE4-ND/1507740CD74HCT251EE4-ND $0.26 Each Digikey.It has three pins with a binary number (0 .. 7), which selects which of the 8 pins is sent to the output. You would need one of these chips, for each signal, you want to transfer.Called S0, S1 and S2 on the datasheet. Here:http://www.ti.com/lit/ds/symlink/cd74hc251.pdfBut there are potential technical problems, with some types of signal (because they need to idle low or high, and other stuff). I don't understand what is required well enough yet, to advise.There are different multiplexers available, depending on your exact requirements.If they are NOT low voltage logic level signals, then a different method would probably need to be used. I.e. I am a bit confused as to why you wanted to use analogue multiplexers, rather than digital ones ?There may be better/easier ways of doing this ?

author: Treehouseman
author_rank: Unknown
timestamp: March 05, 2016, 06:26:12 am
content: between the slaves and the master (the arduino mega) there's 1 wire common to all, they look for a designator character and then get their data, what I need is something to let me connect a second ESP setup as a link/programmer to each one of the atmegas independantly, it needs the TX, RX, and RST pins, technically the only thing this circuit would modify is the single serial out from the master, which it would disconnect to switch over to the serial out from the ESP.In the picture, the lines in red is as wired now, in blue is the pattern for what I'm wanting, though it'd also have to break the RX connection in red, I can't use software serial on the slaves while using tvout at the same time. Digital multiplexers are fine, there's no need for analog, I was just finding more promising results under the analog field than digital. Realistically the only pins that need to be SPDT are the RX pins on the slaves and the TX and RX on the main ESP, the rest could be SPST.

author: MK14
author_rank: Super Contributor
timestamp: March 05, 2016, 06:55:38 am
content: Quote from: Treehouseman on March 05, 2016, 06:26:12 amThanks, the schematic has improved my understanding of the situation.When you say, you are wanting SPDT (single throw, double throw) switching.It sounds like you want to use these:http://www.digikey.com/product-detail/en/texas-instruments/SN74HC157N/296-1578-5-ND/277224SN74HC157NExact type, depends on what your I/O and supply voltages are, and maybe other stuff.Basically there is a select pin (please see datasheet:http://www.ti.com/lit/ds/symlink/sn74hc157.pdf).Which chooses between the two (switch if you like) inputs, A and B. Y is the output (switch common if you like).G = enable = active low = ground 0V.There are basically four sets of these (switches) digital multiplexers, per chip.My understanding is still only partial. As the other poster has also said. The signals may need some work to do, to keep it all working, in addition to the multiplexing (switching).

author: dwpatter53
author_rank: Contributor
timestamp: March 14, 2016, 07:19:48 am
content: You could connect all the arduino boards together on a 2 wire data bus such as I2C or RS-485.There are modules or shields for RS-485 and Arduios have I2c built in.https://arduino-info.wikispaces.com/SoftwareSerialRS485Example?responseToken=7eeff6c13928a87679edfeac90003f8fhttps://arduino-info.wikispaces.com/RS485-Moduleshttps://www.sparkfun.com/products/12965https://www.arduino.cc/en/Reference/Wirehttp://tronixstuff.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/Good luck