| Electronics > Beginners |
| Serial Over Long Wire Run |
| (1/4) > >> |
| Seph.b:
Hi! I have been tasked with controlling LED strips in our windows (dumb strips, not addressable) that are max 100ft from our 'control' room. To save cost on wiring, which is much higher than any other cost in the project, we want to run power to the windows with 18awg wire and sending a control signal via cat5 to an atmega that generates the PWM to an LED amp locally. That way we don't have to run expensive 18awg 5p wires to each window. I was thinking I could use transistors to switch 5v serial (just 9600) to 12v and back 5v on the other side to prevent the voltage drop from the long run. Looking at the transistor output on my scope, it looks very sawtoothy instead of square. The atmega does not recognize it at all. I am guessing it is because the transistor takes time to fully switch on. I just tested just sending the straight 5v serial over 100ish ft of cat5 and while there is a lot of ringing the atmega actually reads it. I don't know what kind of packet loss I am getting though and just don't trust it in general. Is there anyway my 5v-12v-5v idea will work with transistors? Doing some googling it looks like opamps my be a better choice, but I have never used them. I know RS232 is probably the proper way to go, but was hoping to keep the control boards as simple/cheap as possible. Theoretically I could use ESP8266 to eliminate the control wires, but there are huge brick walls in the way that make that impossible. Does anyone have any ideas that could help me out? Thanks. |
| Seph.b:
I may have solved my own problem using the two npn transistor solution from this link: https://electronics.stackexchange.com/questions/78170/square-wave-amplifier-5vdc-13vdc Can anyone explain to me how this is any different that just using one transistor? It doesn't look to me like it should really output anything much different than using a single transistor? The explanation in the post is very short just saying it has high gain. I bread boarded it up and it makes nice square wave though. |
| sokoloff:
There are also dedicated line driver chips that you might use. Alternately, with such a low data rate, LoRa or 433 MHz transmission might work through the brick more readily than WiFi. |
| Seph.b:
I didn't think about 433Mhz. I have everything to do some tests with it too. |
| C:
Using todays standards for serial distance you want RS422 or RS485 These are both differential drivers, so you need a pair of wires for each signal path and a common ground. The advantage of RS485 is that these are transceivers and if you use half-dueplex the same pair of wires can be used in both directions. The down side is you have to have logic so that both ends do not try to talk at same time. Old school would be a current loop interface. The easy way is to use an opto-coupler as a receiver. The sender is just turning on the remote led in the opto-coupler. The output of opto-coupler is connected to serial input. You will need a pull-up resistor here. You could try the built in pull-up of the atmega, but if not enough have option of external pull-up. This has a few advantages. You still need a pair of wires but with the opto-coupler you do not need a ground connection to each end that could be at a different voltage level creating a ground loop. Current is not effected by distance. C |
| Navigation |
| Message Index |
| Next page |