Configuring SPI circuit design for use in 485 transceiver for long range data transmission (50 meters plus)

So quickly getting out of things I have previously done however trying to send SPI controller signals across long ranges using either 18 AWG cable or based on all the recommendations we have been reading, using two way max485 or rs232 transmit/receive with cat5/6 cable. The initial phase 1 of our build is to stay with the SPI controllers for the LEDs and later on move to programmable so adding in Pi or Arduino based and removing the SPI controllers. We don’t want to do that for this phase if we can help it.

I’m using several different SPI LED controllers such as the btf lighting sp108e and 602e(pictured), we also have 608es for music integration (trigger input into the SPI controller):

Which have an output signal of nominally 1.5 to 2 volts :

We want to use transmit receive modules on both ends of the cable with direct input from the SPI controller to the transmit and the receive end terminates to a led strip (ws2815).

The modules would be something like these:

For the TTL to 485 conversion, when I hook up my circuit though my output to the LED side for the receive is no longer clean, and I’m looking at a 200mv output at a completely different waveform:

My question is :

1. the 485 states it can only work with 3.3/5v data so do I need to shift my SPI voltage data to one of those and what would be the best way to do that?

2. will shifting the voltage affect the data phase? Will it also take care of the issue with the A and B transmission lines as right now I am not getting the inverse of A on the B line.

3. do I need a terminator on the receiver side of this circuit? I have read on a lot of these circuits you do?

I thought that this circuit would be a more straight forward with the TTL output from the SPI controllers, but there is something being lost during the transmit/receive - my suspect is the voltage trigger for the circuit but really don’t understand this circuit well enough and looking for help.

UPDATE :

So this is the current setup that is working but I have a few questions regarding the ground RS485 setup. The front side 485 has the one of two grounds tied to the RXD, as when it was hooked up to the actual ground, it caused a doubling of voltage and increase in the LED brightness.

Based on another recommendation, the Transmit(TXD) on the receiver end RS485 is grounded which once done, allowed control to the WS2815 strip.

The termination resistor was causing issues with the LED's flickering when the power was turned off via the controller, the 120 ohm was worse then changed to a 100 ohm, which reduced the flickering. Once removed, the LED strip had no more bleed over. I cannot find an actual spec sheet for these particular RS485's, however they do say that they have shorting for the A+/B- (120 ohms) set, particularly for long distance transmission added into the controller.

Lastly looking at the schematics and recommended circuit for the WS2815, the secondary data (BI) is recommended to be attached to ground for the first run, then additional runs to data out from primary lines.

For the grounding setup on this, this sounds abnormal especially on the front side 485 to me, although the second ground is still grounded to the PSU for the 485 5v in.

Is this going to cause me issues in the long run ? Its actually running perfect in this configuration with the SP602E directly input to the data line in to the 485.

Using the UART to 485 module like it this video : https://www.youtube.com/watch?v=Oq019vxRj54

• Welcome to the site. Can you post the links to the datasheets, wiring diagram, etc.?
– jay
Aug 31, 2021 at 19:03
• Would you please explain what SPI means in your case, because I suspect most people here don't share your definition of SPI. Do you mean the serial data signal that connects to the WS1215 LEDs? You want to extend that data over 50 meters, with RS-485 transceivers? Aug 31, 2021 at 19:16
• The LED protocol also requires data rate of at least 800 kbps. Which chipset is the RS-485 transceiver using, can it do 800 kbps or more reliably? Which also means, RS-232 is almost certainly out of question here. Your photos are so small they are practically useless for seeing any details. Aug 31, 2021 at 19:36
• I am trying to pull the data on the chipset as the order specsheets dont have them. Literally we are ordering from multiple manufacturers as it seems to depend on who makes them ? Aug 31, 2021 at 20:01
• The boards have a MAX485 and 74HC04 chipset, specs on the MAX485 put it up at 2.5 mbps for maximum so I dont think the data rat ewould be an issue going through the modules ? Aug 31, 2021 at 20:14

It sounds like your assumption is correct and the voltage from the LED controller is not high enough to provide usable edge transitions to the TTL-RS485 converter. Specifically, the HIGH voltage from the controller is below the Vih of whatever line driver is on that converter. You'll need to use something like a SN74AVCH1T45 to bring the levels up.

For termination, that depends on whether there's a terminator built into the board you're using but it should match whichever cable you're using. Regular old ethernet cable is 100 ohms.

• From thedscription it has a 120 ohm which should match the cat 6 ? We has a SP901E which was an amp for the LED input which we thought was suppose to ouput the 5v TTL but it did not actually perfrom as thought ( superlightingled.com/…) Aug 31, 2021 at 20:18
• 120 ohms will not match cat6 cable; cat5 and cat6 are both 100 ohms. For low data rates and short runs, you can usually get away with the mismatch, but I'm not bullish on your specific application. You're welcome to try, of course, ethernet cable is cheap and you can always reuse it for a patch cable.
– vir
Aug 31, 2021 at 21:28
• We have cat5e, cat 6 and cat7 cabling we can use, but have also run 18awg initially for the power and data 1 data 2 lines. Prefer not to use the cat7 as we actually use that in the house but can definitely swap for the 100 ohm for the cat6. The board description says it has a 120 ohm (R0) shorted for long cable runs and to leave it that way for long runs ? Do I need to change that on the board depicted ? Sep 1, 2021 at 4:39

I could be wrong but based on your question I suspect you may be confusing a few things. You mention RS232 but then you also mention 485, which are different "longer range" signal transmission protocols.

In general, what you are trying to do can work - encode the signals on one end, send them across the long wire, and reconstruct them on the other end. But a few things are missing.

You do not specify the details of your "SPI"; typically an SPI protocol has 4 wires, Out/In/Clock/Enable. The Out/Clock/Enable go one direction and the In goes another; however, you mention driving LEDs which typically use an SPI-like protocol with just the OUT and Clock, maybe an enable line as well. The only reason I'm pointing this out is that if you need the "In" line (also referred to as MISO line), you will need to encode it in reverse. What you are showing on the scope could be one of these signals - a differential signal could look so noisy but the idea is that the information is carried across as the difference between the 1st and 2nd wire, and as both wires are affected more or less the same, the difference is immune to noise.

Knowing that, have you put a receiver chip on the far end? You cannot take the RS485/RS422 signal and just feed it to your device (you could actually but let's leave this out for now). You need a matching receiver that will take the two-wire differential signal and convert it back to one signal that you feed into your circuit. Same thing if you are using RS232 - that is a one wire protocol, but the voltage levels swing higher/lower to make them more immune to noise but you still need a receiver on the far end.

And of course, if you need the return line, you will need an encoder chip on the far end and receiver chip on the other side.

Lastly, and that applies if you use RS485 or RS232, you will need to make sure the transmitter and receiver chips can operate at a frequency high enough for your protocol. In RS485/422, it is not uncommon to have chips that can only go to 250 KBps versus others that can go at 10 MBps.

• In this case, the "SPI" means short for "Protocol for addressable RGB LEDs such as WS2815". And while RS-232 transceivers up to 1 Mbps do exist, they allow for about 5 feet distance, so RS-232 is pretty much out of the question here. Aug 31, 2021 at 19:52

There are several reasons why it may not be working.

1. Voltage levels.
2. Termination.
4. The whole system.

Let's address it one by one:

1. Voltage levels. The LED WS2815 with datasheet is a 12V intelligent LED. The digital input considers $$V_{IH} = 0.7 VDD$$ and $$V_{IL} = 0.3 VDD$$.

In your case $$V_{DD} = 12 V$$ $$V_{IH} = 8.4V$$ $$V_{IL} = 3.6V$$

If you use a RS-485 transceiver, those normally work with 0~5 V or 0~3.3 V. It means the output levels are not compatible with your LED. You will need some level shifter between the transceiver and the first LED. For example CD40109B The SW2815 datasheet may have some errors, I really think the communication levels are not VDD but to VCC, so probably you do not need level shifter. 2. Bus termination 100 Ohm to 120 Ohm between A+ and B- at the receiver end (side closed to the LEDs).

1. Timings for your transceiver If you want to recover a waveform which in this case has a pulse width of 220 ns ~ 380 ns, a 1Mbit transceiver may not be enough. For example, the transceiver SN65HVD1792 (Datasheet) shows Driver differential output rise/fall time up to 300ns, which is very close to your limit. This may or may not be a problem.

2. The whole system

This is what your system looks should look like. EDIT:: Not that we know the emitter is a SP601E, it is possible that you need a level converter to adapt the levelt for the RS-485 transceiver, same reasoning that #1, but the opposite way.

simulate this circuit – Schematic created using CircuitLab

• So for the input I would still need the level converter for the system which I could test using my arduino until I get those in, for both the front side and the backside to decrease input to the data on the ws2815 within the Vih and Vil? Could I use the same level shifters for front and back ? Aug 31, 2021 at 22:14
• Any other thoughts on the level converters as the ones you mentioned ti.com/lit/gpn/cd40109b seem to be out of stock in quite a few places. The other level shifters that I’m finding are for mainly between 3.3 to 5v conversions only. Aug 31, 2021 at 22:38
• First the output of SP601, if the signal is 0~5V, then no need lvl converter. If the signal is 0~12V you need it, as the input of the transceiver will accept maximum 5V. * For the first level converter (If you need it) you can try with just a voltage divider. * For the second level converter, I think the LED datasheet is mistaken and probably you do not need it. Aug 31, 2021 at 23:36
• Going to try and use either a different set or 485s or different receiver. I have the setup below, everything is looking better until the decoder/receiver then the output side for the led line is at .03 volts Sep 1, 2021 at 2:14
• UPDATE : swapped with the new set of rs-485 modules and it looks like everything is actually working correctly (ish) with a direct connection from the sp602e we have connected - no voltage connections applied, based on all your help. The only issue I’m having seems to be some ground loop interference - and it appears if I have the ground (bare) for the transmitter connected - I get some out of phase signaling (or see spurious led lighting and some issues with the smart controlling). Do i need to add the resistor to the ground as well ? Sep 1, 2021 at 5:41