20160609

Using the SN75176A in NeoPixel & Other Applications

I have received many great comments and emails regarding my post on Driving WS2812/NeoPixels RGB LEDS over CAT5 Ethernet Cable, and it is in fact one of my most popular posts. A few people have requested that I go into a bit more detail on how the SN75176A chip is used in this application, so in this post I will explain a bit more detail about using this device.

The SN75176A is a Differential Bus Transceiver, which means that it is used to convert back and forth between a normal "single-ended" signal on one side and a "differential signal" on the other. There is a good Wikipedia article that goes into great detail on the benefits of differential signaling, but the quick overview is that it provides lower signal degradation and better noise immunity than single-ended signaling, allowing us to send our NeoPixel data over much longer distances.

There seems to be a bit of confusion with some readers regarding the SN75176A's ability to be used for both to sending and receiving differential signals, so let's see if we can clear things up a bit. This device contains both a single-ended to differential "transmitter" and a differential to single-ended "receiver". Depending on how a couple of control lines on the device are set, we can enable one or both components as needed. The following diagram shows how things are hooked up inside the chip:



The "A" and "B" pins are the differential signal lines which are connected to the long run of cable between devices. The "D" pin is used to send data on the differential pins and the "R" pin has the received data from the differential lines. Finally, the "RE" and "DE" pins are inputs to the device that enable the receiver and/or transmitter, respectively. Notice the "bar" over the RE, indicating that it is "active-low", meaning the a low input enables the receiver and a high input disables it.

If you want to configure the device as a transmitter, you would connect both the RE and DE pins to VCC – this disables the receiver and enables the transmitter so that any data applied to the D line is sent to the differential outputs on A and B. Now if you want to configure the device as a receiver, you would connect the RE and DE pins to ground, disabling the transmitter and enabling the receiver so that data received on the A and B pins is converted to a single-ended signal on the R pin.

You may be wondering what happens if the RE and DE signals are not tied to the same high/low levels. If you connect the RE low and the DE high, both the transmitter and receiver are enabled, and any data sent out using the D pin is "looped-back" or echoed on the "R" pin. This can be useful in some configurations to confirm data being sent or to detect collisions with other transmitters on the differential lines. The other configuration is when the RE pin is high and the DE pin is low. In this configuration, both the transmitter and receiver are disabled, effectively preventing data from being sent or received on the differential pins.

Now it's not needed in my NeoPixel application because data is always flowing in the same direction, but if you needed to both send and receive data over the differential pins, you could connect the RE and DE lines to your microcontroller, allowing it to select the data direction, either transmitting or receiving as needed. Notice that even though you can enable both the transmitter and receiver at the same time, you are not able to send and receive data between two such devices at the same time, as only one device at a time can be in transmit mode, otherwise the data gets corrupted (just like two or more people talking at the same time makes it difficult to understand what anyone is saying).

Hopefully this explanation will help out some of you that have been looking to tweak or modify the circuit in my long-distance NeoPixel post, or just give you a better understanding of how the design works, and maybe inspire you to try applying this idea in your own design. Also, thanks to Leo B. for prompting me to finally get around to writing this post!

5 comments:

Unknown said...

I've been reading your Driving WS2812/NeoPixels RGB LEDS over CAT5 Ethernet Cable thread, and sound like just what I need to do.

I want to control 18 strips each with 10 NeoPixels per strip from a single data line. I noticed a reply to a comment in the thread. as follows
"chad said...
Do you think this system could be modified to control 7 sets of 8 pixels 20ft apart? The big problem is that I need to daisy chain the wiring as the conduit isnt large enough to fit all the cables in.

December 1, 2014 at 8:44 PM
teknynja said...
I haven't tested a daisy-chained configuration, but it seems like it should work just fine. You would simply "bus" the 12 volt power to all of the strip's voltage regulators, and then use the data output from each strip to drive a RS-485 driver feeding the next strip's receiver. Since you are only using a single data line to drive all the segments, you could also use just a single SN75176 at the controller end instead of the quad SN75174.'

When you say use the data output to drive a RS-485 driver feeding the next strips receiver, do you mean SN75176 in transmit mode feeding the next strips receiver or am I totally confused?

Thanks
Andrew

teknynja said...

@Unknown - Yes, I think you've got it. To be more clear what the daisy-chain connections would look like:

Controller -> RS485 Transmitter -----> RS485 Receiver -> NeoPixel Strip -> RS485 Transmitter -----> RS485 Receiver -> NeoPixel Strip -> RS485 Transmiter -----> ...

So basically each NeoPixel strip would have a RS485 receiver feeding its "Data In" and the strip's "Data Out" would drive a RS485 Transmitter for to the next strip.

Unknown said...

Dear all,

i would like to ask, if it did not happened to You, that first pixel was not displaying correctly.

I got 75LBC176, connected to Teensy 4.0 (okay 3V3, but specs of 75LBC176 shows around 2V7 as low to high threshold) and on other side (just few cm away) i got 8 pixels stripe powered from 5V.

Weird, seems like the propagation delay causing me the issues with the first pixel :)

Any idea?

Meanwhile i have ordered other transceivers to test it.
Dusan
Thanks

teknynja said...

Note that each NeoPixel will "clean up" its input signal and will generally output a signal with the correct timing and voltages. What may be happening is that the low input voltage to the 75xx176 is causing the shape/timing of the differential bus output signal to be less-than-ideal, and then that gets cleaned up by the first pixel before being passed to the rest of the chain. Just a guess. I have seen issues driving NeoPixels directly with 3.3V where the first pixel acts strange though. Good Luck!

Unknown said...

I will try to level shift out of Teensy to match 5V supply voltage of 75xx176 and will report :)
Thanks

 
Template design by Amanda @ Blogger Buster