WS2801 LED's appear to affect IR sensor

I've been working with Ken Shirriff's IR library and WS2801 Sparkfun as well as FastSPI code.

Issue: When the LED's are on, the IR controls to change light sequences are very unreliable/non-responsive.

Setup is:

  • Arduino UNO
  • IR receiver is KSM-603LM
  • IR receiver output (pin 1) goes to Arduino input on pin 7
  • WS 2801 Clock is connected to Arduino Pin 13
  • WS 2801 Data is connected to Arduino Pin 11
  • I've also tried the clock and data on different pins
  • I get valid data when using Ken's library with my IR remote
  • I can create lots of light sequences using the Sparkfun as well as FastSPI libraries
  • I can control which sequence to display, albeit the controls become non-responsive

With the help of a scope, I see that:

  • When the LED's are OFF, pin 7 is almost always high, with just a few 0V spikes.
  • When the LED's are on, pin 7 is has continuous 5V / 0V signals.

What I have done is:

  • Stripped out all unnecessary circuitry and inspected and shortened connecting wires.
  • Wrote some simple test code to duplicate the results.
  • Powered unit with alternately with USB power, AC adapter power and even just a 7.4V NiMh battery (with no USB).
  • Put 10pf through 10uf capacitors across Vcc and Gnd at the IR sensor (pins 2-gnd and 3-Vcc).

After all that, my conclusion is that this sensor is OVERLY sensitive and that I need to find one that's less so. Don't know what though.

Any other thoughts/recommendations or things I could be missing?

PS, what a struggle.

My initial thought would have beenthe capacitor, but you have already tried that.

Another possibility, could be IR from the LED (?), so could you try to shield the WS2801 from shining on the IR receiver and see if you are getting the same interference.

I looked at the data sheet for the IR LED , but it was mostly in chinese.

One other possibility would be to try with the pull up resistor on and then off on the input pin of the Arduino (7).

Hope this helps!

If you are looking at other IR receivers, I have had good experience with Vishay (no connection).

Issue: When the LED's are on, the IR controls to change light sequences are very unreliable/non-responsive.

Have you tried this with the LEDs not being connected but being driven by the software. It sounds to me like all that interrupt activity is spoiling the reception of the IR signal.

Thanks for the feedback.

It sounds to me like all that interrupt activity is spoiling the reception of the IR signal.

Interrupt interference with FastSPI was one of my first thoughts. This is why I quickly reverted back to the Sparkfun bit banging method.

try to shield the WS2801 from shining on the IR receiver

I've since turned the IR receiver the other way, covered it with electrical tape and covered the LED's with a thick blanket. It still received commands from the controller and I saw spikes on the IR output, but not as many.

With all of this, I've been able to reduce the noise on the IR receiver's output to the point that it's more reliable, but I'd really like to 100% eliminate electrical/interrupt issues vs light sensitivity.

My test bench code is at IR test with WS2801 Sparkfun method - Pastebin.com

One other possibility would be to try with the pull up resistor on and then off on the input pin of the Arduino (7).

I will try putting a cap and/or resistor on the output of the IR sensor itself, as well as review everything else from top to bottom.

Good to see some progress...

Just enable the internal pullup..as follows
pinMode(7, INPUT); // set pin to input
digitalWrite(7, HIGH); // turn on pullup resistors

..saves using any external components

AnalysIR:
Good to see some progress...

Just enable the internal pullup..as follows
pinMode(7, INPUT); // set pin to input
digitalWrite(7, HIGH); // turn on pullup resistors

..saves using any external components

Thanks for that, and I've added the internal pull-up to my testbench code.

Covering/uncovering the LED's doesn't seem to affect much, even when I've put an electrical tape 'hat' over top of the IR sensor.

So, I'm back to some form of electrical noise, although one would think it would be reduced when I'm running everything off of a battery.

Having a closer look at the power, and it does indeed appear that the signal is cleanest (and more operationally reliable) when I'm running off the battery. So, I at least have a direction and have thrown a cap across Vin and Gnd as well as the 5V and Gnd. Will have to play around some more.

In the meantime, the AC adapter is 7V @ 1A.

Thank god for the used Tektronix 765B that I bought the other week.

Yes it all sounds strange - if you have it wired up on a bread board maybe try to use 2 different ones.

Also have a look at this data sheet for a Vishay IR receiver - page 1. They also use an optional resistor along with a capacitor on the IR receiver, which I believe helps with noise (?). It may also help with your receiver. I did have one situation about a year ago where I needed these optional components, but most of the time I find they are not required.

maybe worth a try!

The KSM-603LM's specs are pretty ugly. For example, relative reception distance vs. carrier frequency still has 50% sensitivity between 20KHz and 50KHz. Pretty much any light in the 10KHz to 60KHz range is going to trigger it (e.g. fluorescent lights). Compare that to a Vishay part where the sensitivity is 50% at 36KHz to 40KHz.

ksm-603lm.png

So, I'm back to some form of electrical noise, although one would think it would be reduced when I'm running everything off of a battery.

Batteries are often worse than bench supplies at noise pickup because of the high internal impedance.

I at least have a direction and have thrown a cap across Vin and Gnd as well as the 5V and Gnd

Step in the right direction, what value and type. Ceramic are best in this case.

even when I've put an electrical tape 'hat' over top of the IR sensor.

Often electrical tape is not very opaque at IR wavelengths. Try something more substantial like aluminum foil.

@Chagrin

......good spot! sounds like a real contender.

Thanks very much for your superb responses. I'm going to go find that Vishay part.

In the meantime, yep, I'm already using a couple of small breadboards (one is a shield) and will play around with the caps. I have 33pf and .01uf in ceramic. My 1uf and larger are electrolytic.

Since my current part runs at 40kHz, and that pin 3 is currently Vcc, it appears that TSOP34840 is my best bet. The 'very noisy' version is not available from Digikey.

Bear in mind there is nearly an IR receiver model for every different application & type of remote.

So if you see the 40 at the end of the model no, it means a modulation frequency of 40kHz (typical for SONY).

So before you order, try to check the type of protocol with IRremote and that will give you an indication of the likely modulations frequency (search for ir receiver vishay).

38Khz is more common (NEC and others).

36Khz(Philips RC6/RC5)

The manufacturer doesnt always match the IR protocol as often even the big players supply kit from competitors.

Bear in mind there is nearly an IR receiver model for every different application & type of remote.
So before you order, try to check the type of protocol with IRremote and that will give you an indication of the likely modulations frequency (search for ir receiver vishay).

I'm retasking an IR controller from a Chinese made 12V LED strip. In looking inside the LED driver module, the IR receiver looks a lot like the Vishay. Time to get out the screwdriver again.

Think I'll follow your suggestions and do more research. I'll also see about kicking $20 into your Kickstarter project. . . oops, Indiegogo. Done.

You're a star!...tnx....We are doing some amazing things with AnalysIR & IR. We believe we have achieved some firsts with the Arduino platform & IR and plan to publish all the Arduino code, if successful (which is looking likely).

...all inspired by Arduino, IRremote & IRlib etc....

IRremote reports that both my Chinese made IR remote use NEC codes, and that this uses a 38KHz carrier.

As a result, I've ordered a few Vishay 38KHz receivers from a store on Aliexpress.

In the meantime, I've been looking at the WS2812B SPI controller, which I'd love to re-program to use my own light sequences. Turns out it's got a Megawin MA803AS - 8051 Microcontroller inside. Methinks that re-programming that chip will not be easy. At all.

So next update in 3+ weeks, if delivery times are anything like we get in Ireland from AlieExpress. :slight_smile:

Although, to be fair - I have never been let down by them.

AnalysIR:
So next update in 3+ weeks, if delivery times are anything like we get in Ireland from AlieExpress. :slight_smile:

Although, to be fair - I have never been let down by them.

LOL. Amazingly, I've had stuff shipped here (to Vancouver) in under a week.

Even bought some books (on digital logic) from India that arrived pretty quickly.

Nothing surprises me any more.

I just wanted to let you know, you're not the only one.
I'm using the IRremote library, a meter worth of strip lights, an IR receiver and an old stereo remote.
Keep getting invalid code errors which eventually crashes the whole thing and the chip has to be rest.
Tried it on a breadboard, same results. I thought I was getting noise through the voltage, and with your readings, I'm sort of correct. I'm out of ideas myself.

@WeeBo
What IR receiver are you using & what is your circuit/code like. ?

USing TL1838/VS1838B for IR on pin 3
Three IRLB3034 FETs for R-G-B control. Hooked up to pins 9,10,11 respectively.

AnalysIR:
@WeeBo
What IR receiver are you using & what is your circuit/code like. ?