Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




42 posts

Geek


# 250818 27-May-2019 08:48
Send private message quote this post

Hi all

I posted last week about my LED strip having issues,
I have now figured out its to do with the length between the controller (raspberry pi) and first LED as when I run it on my test bench I have 0 problems, but when I put it outside where im going to be installing it I get glitching

The distance between Pi and first LED is aprox 8-15m (using existing cable so not sure about exact length)

I found this blog online
https://www.teknynja.com/2014/02/driving-ws2812neopixels-rgb-leds-over.html
Where they use a serial to rs232 converter to run it over a length of cat5 cable.

 

I jumped onto jaycar where I get my components from, and searched the part they used, but nothing came up.
so I searched the name and found one of these
https://www.jaycar.co.nz/1488-rs-232-line-driver-ic/p/ZZ8148

 

Is this the same part? / will do the same job?
Or is there something else that will do what I need?


Create new topic
4078 posts

Uber Geek
+1 received by user: 1768

Subscriber

  # 2246290 27-May-2019 08:55
One person supports this post
Send private message quote this post

Might be a silly comment, but is there no method where you could stick the Pi closer to the LED strip? Then you can just pump DC out to a waterproof enclosure and run the LED strip straight off the Pi.




42 posts

Geek


  # 2246292 27-May-2019 09:04
Send private message quote this post

chevrolux:

 

Might be a silly comment, but is there no method where you could stick the Pi closer to the LED strip? Then you can just pump DC out to a waterproof enclosure and run the LED strip straight off the Pi.

 



Been asked that a few times
Sadly not. well not easily at least.

I have a few sensors around which go to the Pi as well, and im using existing wiring to get to the led strip (used to have a RGB led which im changing to the addressable one)
So if I was to move the pi to the LEDS, i would have to dig up the garden to run more wiring for my other sensors + power + ethernet

so yes, i can do it, but it would be a million times easier to "boost" the signal.
Which I know works following on the blog post.

It was more of a question of
A) Do I just buy the same chip online and have to wait a month or so for it to get here
or B) get a different chip locally which does the same thing

Sadly Im a little new to this stuff so dont know what chips are the same as others.


 
 
 
 


neb

1048 posts

Uber Geek
+1 received by user: 233

Lifetime subscriber

  # 2246413 27-May-2019 12:20
Send private message quote this post

pomtom44:

The distance between Pi and first LED is aprox 8-15m (using existing cable so not sure about exact length)

 

 

You'll need to provide a bit more information for us to provide useful advice, "serial" to me means RS232 or RS422 which will have no problems doing that. I assume this is some TTL-level or even 3.3V serial protocol, possibly at high speed? In that case you'll need to convert it to something capable of handling the distance, at an appropriate data rate. If you can provide more details (protocol type, signalling level, speed) we can play peanut gallery. Even basic RS232 will handle that easily, max cable length is 50ft/2500 pF capacitance at the design rate of 20Kbps, or to the next suburb if you drop the baud rate down far enough.



42 posts

Geek


  # 2246459 27-May-2019 13:09
Send private message quote this post

neb:
pomtom44:

 

The distance between Pi and first LED is aprox 8-15m (using existing cable so not sure about exact length)

 

You'll need to provide a bit more information for us to provide useful advice, "serial" to me means RS232 or RS422 which will have no problems doing that. I assume this is some TTL-level or even 3.3V serial protocol, possibly at high speed? In that case you'll need to convert it to something capable of handling the distance, at an appropriate data rate. If you can provide more details (protocol type, signalling level, speed) we can play peanut gallery. Even basic RS232 will handle that easily, max cable length is 50ft/2500 pF capacitance at the design rate of 20Kbps, or to the next suburb if you drop the baud rate down far enough.


Im not sure of specifics sorry.
iv been following tutorials online and know that im using the python neopixel library to control the led strip
And I also know that the Pi is putting out 3.3 and the led strip runs on 5v for data.

im just following the blog post here
https://www.teknynja.com/2014/02/driving-ws2812neopixels-rgb-leds-over.html

To quote the post
"Since the pixel data is really just serial data, I figured using RS-485 balanced transmission lines to send the data would work perfectly."

and this post
https://www.teknynja.com/2016/06/using-sn75176a-in-neopixel-other.html
Talks about using the SN75176 for sending and receiving the long run data.



2883 posts

Uber Geek
+1 received by user: 1420

Lifetime subscriber

  # 2246464 27-May-2019 13:17
One person supports this post
Send private message quote this post

You need to understand a little more about signal transmission.

 

Essentially, what you *want* is to put in a square wave, with nice crisp voltage changes, and have that wave come out the other end. What happens is *two* things; the voltage at the output end is lower than the input, due to resistance in the wire. Switching to a higher voltage will address this.

 

The second thing that happens is that the shape of the signal degrades due to capacitance. The sharp rising edge turns into a curve, and the sharp falling edge turns into a curve. The shape of these curves relative to the 'switching point'; the voltage below which the receiver says it is a zero, and above which it calls a 1. Depending on this voltage, capacitance may lengthen the 1 bits at the expense of 0 bits, or vice versa. The voltage may never even get to the switching voltage within the time of one bit. So, for long cables, you have to have slower speeds. Or better cables, with less capacitance. (Soil moisture, incidentally, affects the capacitance of buried cables).

 

What the link points to is NOT RS-232 (but then very few devices claiming to be RS-232 actually meet the standard, yet they still work (mostly)). All he's doing is bumping up the voltage swing to 0 to 12V. That will adequately address the loss due to resistance, but will only do a little about any capacitance issues. It is significant that he's using CAT-5 cable, which is low-capacitance. If what you have buried is similar, and well waterproofed (Cat-5 isn't waterproof), then a similar solution would work.

 

@neb WS2811 is a 0/5V serial protocol. There are two speeds, 400Kbps and 800Kbps. Most LEDs seem to be preset to 800Kbps. Timing for 800Kbps is:

 

Transmitting a 1:
Time for the signal to remain high (T1H): 0.8μs
Time for the signal to remain low (T1L): 0.45μs

Transmitting a 0:
Time for the signal to remain high (T0H): 0.4μs
Time for the signal to remain low (T0L): 0.85μs

 

So 1.25us per bit, but a switching rate of about 2MHz needed. In comms talk, aka 2M bps or 2M baud. Make sure your transmitter and receiver chips are up to that spec. You really want to look at the signal at the LED end of the wire with an oscilloscope.

 

What I would do is to use the buried wire just as a power supply, and put an ESP8266 or similar device at the end of the LED string, in a pill bottle or similar waterproof container, and send commands to it via WiFi (assuming it's within range of your Wifi network). An ESP8266 board will cost you about the same as one of those RS232 chips. Even if it's outside your Wifi range, maybe use a Wifi dongle on the RPi to create a small WLAN of just those two devices. Then replace all your sensors with ESP8266 devices so that they're WiFi too.

 

 




42 posts

Geek


  # 2246486 27-May-2019 13:33
Send private message quote this post

frankv:

 

You need to understand a little more about signal transmission.

 

Essentially, what you *want* is to put in a square wave, with nice crisp voltage changes, and have that wave come out the other end. What happens is *two* things; the voltage at the output end is lower than the input, due to resistance in the wire. Switching to a higher voltage will address this.

 

The second thing that happens is that the shape of the signal degrades due to capacitance. The sharp rising edge turns into a curve, and the sharp falling edge turns into a curve. The shape of these curves relative to the 'switching point'; the voltage below which the receiver says it is a zero, and above which it calls a 1. Depending on this voltage, capacitance may lengthen the 1 bits at the expense of 0 bits, or vice versa. The voltage may never even get to the switching voltage within the time of one bit. So, for long cables, you have to have slower speeds. Or better cables, with less capacitance. (Soil moisture, incidentally, affects the capacitance of buried cables).

 



I understand the basics of how serial communication works, just not enough to answer his questions


 

frankv:

 

What the link points to is NOT RS-232 (but then very few devices claiming to be RS-232 actually meet the standard, yet they still work (mostly)). All he's doing is bumping up the voltage swing to 0 to 12V. That will adequately address the loss due to resistance, but will only do a little about any capacitance issues. It is significant that he's using CAT-5 cable, which is low-capacitance. If what you have buried is similar, and well waterproofed (Cat-5 isn't waterproof), then a similar solution would work.

 



That makes sense thanks :) so the jaycar link wouldn't work for what the original link used?

As for the cable, i believe its cat5 running though pvc conduit 
As the two ends are PVC where it comes out the ground


 

frankv:

 

What I would do is to use the buried wire just as a power supply, and put an ESP8266 or similar device at the end of the LED string, in a pill bottle or similar waterproof container, and send commands to it via WiFi (assuming it's within range of your Wifi network). An ESP8266 board will cost you about the same as one of those RS232 chips. Even if it's outside your Wifi range, maybe use a Wifi dongle on the RPi to create a small WLAN of just those two devices. Then replace all your sensors with ESP8266 devices so that they're WiFi too.

 

 

That was my original plan was using nodemcu which I have used for other projects.
The issue is (and why im moving to rpi) is I seem to be having issues with the esp on my wifi and only with the esp's
Where as a pi running on ethernet i have had 0 problems with
(plus I can load more on the pi then I can with the arduino such as complicated animations and such)


3885 posts

Uber Geek
+1 received by user: 1757

Subscriber

  # 2246487 27-May-2019 13:36
One person supports this post
quote this post

True RS232 uses -12V as well as +12V as its voltage levels. The larger driving voltages help to get reliable transmission over long wires.





 
 
 
 


neb

1048 posts

Uber Geek
+1 received by user: 233

Lifetime subscriber

  # 2246626 27-May-2019 18:21
Send private message quote this post

frankv:

What I would do is to use the buried wire just as a power supply, and put an ESP8266 or similar device at the end of the LED string, in a pill bottle or similar waterproof container, and send commands to it via WiFi (assuming it's within range of your Wifi network). An ESP8266 board will cost you about the same as one of those RS232 chips. Even if it's outside your Wifi range, maybe use a Wifi dongle on the RPi to create a small WLAN of just those two devices. Then replace all your sensors with ESP8266 devices so that they're WiFi too.

 

 

That points out another consideration, if you're running this outdoors you may not want to have a direct connection via low-level signal-sensitive devices to things inside your house. The WiFi link will provide the necessary electrical isolation between a mesh of EMI absorbers and the things inside your house.

 

 

You don't necessarily need the WiFi on the controller for the LED string, just use one of the endless matchbox-sized WiFi router/bridge devices, a.k.a. travel router, e.g. the TP-Link N300, and plug that into whatever you're using as a controller, all powered from a UBEC hanging off the 12V LED supply. Put it inside an IP65 case from Jaycar and locate it close to the LED strings.

1 post

Wannabe Geek


  # 2247672 29-May-2019 12:13
Send private message quote this post

pomtom44:

 

The distance between Pi and first LED is aprox 8-15m (using existing cable so not sure about exact length)

 

As I understand, you need a tiny network connection:


Raspberry Pi <-----------------> 5V RGB LED.

 


You will need to add some more devices between Raspberry Pi and RGB LED.
It can be this way:

Raspberry Pi <--> RS485 <-----------------> RS485 <--> Arduino Nano <--> 5V RGB LED.
or
Raspberry Pi <--> Ethernet W5100 <-----------------> Ethernet W5100 <--> Arduino Uno <--> 5V RGB LED.
or
Raspberry Pi <--> CAN <-----------------> CAN<--> Arduino Nano <--> 5V RGB LED.

And yes, it is a good idea to have isolated power source.
You will need some more help in making Arduino scatches, but there are some on Youtube.


22260 posts

Uber Geek
+1 received by user: 4784

Trusted
Subscriber

  # 2247691 29-May-2019 13:01
Send private message quote this post

Put a single neopixel close to the pi, and allow for that in your code. It will regenerate the signal and it will go a lot furthur.

 

 

 

edit:

 

 

 

also if you do want to go the way of putting an esp8266 at the strips and send stuff over wifi to it, look up artnet. there are arduino librarys for the recieving end to make that really easy and sending from python took a friend about 20 mins to get working when copying some example code from a library





Richard rich.ms

982 posts

Ultimate Geek
+1 received by user: 622


  # 2247746 29-May-2019 14:50
One person supports this post
Send private message quote this post

pomtom44:

 

https://www.jaycar.co.nz/1488-rs-232-line-driver-ic/p/ZZ8148

 

Is this the same part? / will do the same job?
Or is there something else that will do what I need?

 

You have linked looks like a TTL-232 driver, which is what you need to the transmit end, but you usually also need the reciprocal MC1489 232 receiver at the LED end to convert the +/- 12v RS232 serial levels back down to the original 0-5v levels. You can sometimes get away with dirty circuit of resistor droppers & blocker diodes but it isn't technically correct & eats into the reliability of the 232 link, potentially putting you back at the original problem.


982 posts

Ultimate Geek
+1 received by user: 622


  # 2247748 29-May-2019 14:57
Send private message quote this post

P.S. have you checked the insulation resistance of the that the existing cable you are using for signalling? Being an existing buried cable in the garden it could have some dodgy water filled connections in it, that have minimal effect of the power supply side of the things, but pulls your small signal down to un-usable levels.  

 

Edit: or the cable could also have other old lights, water-feature pumps, outdoor speakers, transformers etc etc connected to it which would also short out the small serial signal.


Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Dunedin selects Telensa to deliver smart street lighting for 15,000 LEDs
Posted 18-Jul-2019 10:21


Sprint announces a connected wallet card with built-in IoT support
Posted 18-Jul-2019 08:36


Educational tool developed at Otago makes international launch
Posted 17-Jul-2019 21:57


Symantec introduces cloud access security solution
Posted 17-Jul-2019 21:48


New Zealand government unveils new digital service to make business easier
Posted 16-Jul-2019 17:35


Scientists unveil image of quantum entanglement
Posted 13-Jul-2019 06:00


Hackers to be challenged at University of Waikato
Posted 12-Jul-2019 21:34


OPPO Reno Z now available in New Zealand
Posted 12-Jul-2019 21:28


Sony introduces WF-1000XM3 wireless headphones with noise cancellation
Posted 8-Jul-2019 16:56


Xero announces new smarter tools, push into the North American market
Posted 19-Jun-2019 17:20


New report by Unisys shows New Zealanders want action by social platform companies and police to monitor social media sites
Posted 19-Jun-2019 17:09


ASB adds Google Pay option to contactless payments
Posted 19-Jun-2019 17:05


New Zealand PC Market declines on the back of high channel inventory, IDC reports
Posted 18-Jun-2019 17:35


Air New Zealand uses drones to inspect aircraft
Posted 17-Jun-2019 15:39


TCL Electronics launches its first-ever 8K TV
Posted 17-Jun-2019 15:18



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.