Hello community - I've put together a system using an Arduino Nano to control two strips of DotStars installed in a vehicle. They function as brake lights and sweeping turn signals. The setup works great while the car is off, but to my surprise, when the engine is running I observe a strange flicker when the strips should be performing a sweeping sequence. The strips try to start the sweep sequence (which starts each time a turn signal light illuminates) but only a couple LEDs light and it flickers at the same time. When I set the LEDs to be illuminated all at once and stay on they look fine regardless of the engine being on or off.
I've included a diagram of my wiring and the various components making up the system. A quick walk-through:
A 4 channel optocoupler takes 12V input from the vehicle's parking lights, L and R turn signals, and brake signal and drops it to 5V for the Arduino Nano to use as digital inputs.
A buck converter capable of taking 12V input and converting it to 5V @ up to 10A is powering the optocoupler, Arduino Nano, and two DotStar strips. It claims to do a good job of taking a vehicle's 12 - 14.4V and conditioning it to a cleaner 5V output.
Per the recommendations of Adafruit I've installed a 330 ohm resistor along the data wire for each of the DotStar strips. Also per their recommendations I have a 10,000 uF capacitor across the 5V (+) and (-) wires supplying each DotStar strip. They recommend that it is best to have the capacitor and resistor nearest to each strip. Due to packaging tightness, I have installed the resistors and capacitors about halfway down the wires running to each strip. The wire run length from Arduino to each strip is about 5 ft so the resistors/capacitors are about 2.5 ft down the line.
I've been doing my best to understand interference causes and have come across several discussions about ringing or standing waves developing in the clock/data lines.
Knowing that everything works great with the engine off, could it still be a "ringing" issue? Or is is more likely that I'm picking EMI from somewhere nearby? Looking for some suggestions to try to diagnose the cause.
OK, you have the 5 V going to "Vin". It should go to "5V" on the Nano. "Vin" is the input to the on-board regulator, which is useless.
The resistors and capacitors should be at the start of the LED strips. All the wires from one part to another should be bundled tightly together so that no open loops are formed.
Paul__B:
OK, you have the 5 V going to "Vin". It should go to "5V" on the Nano. "Vin" is the input to the on-board regulator, which is useless.
The resistors and capacitors should be at the start of the LED strips. All the wires from one part to another should be bundled tightly together so that no open loops are formed.
Paul__B - Thank you for taking some time to respond on this; I certainly appreciate it! This is my first Arduino project so it makes sense I've missed something obvious like inputting to Vin instead of 5V.
Tonight I will start pulling out the fancy wire loom I made and move the capacitors/resistors as close to the strips as possible.
Regarding bundling the wires, I've currently got everything wrapped tightly together with electrical tape down the full distance of each run.
Last night I found some ferrite cores off of some old RCA cables and tried adding them in different spots as an easy idea to try, but no luck with them.
I did also order a higher quality isolated DC-DC converter last night to try (Mean Well SD-50A-5.) I've been reading that cheaper, non-isolated bucks like I've got now can propagate dirty electrical signals through them. Upon review, my current converter has essentially no technical documentation on noise or filtering so that could be a weak link.
Ferrite cores are to suppress radiation of radio frequency interference. While these microprocessors operate at radio frequencies, the ferrites are not going to reduce pickup of ignition impulses.
The length of the cabling is in general, a concern but not much you can do about it apart from the bundling. I suspect the correct power supply connection will be the fixer.
Paul__B:
I suspect the correct power supply connection will be the fixer.
Thanks, Paul__B, for pointing me in that direction. It makes sense now that I read deeper into the powering options on the Arduino.
I mistakenly understood that either 5V or Vin would be options, but that Vin was regulated and therefore "safer." I was worried the dirty alternator power and unknown quality DC-DC converter could harm the Arduino or cause interference issues, so the regulated option seemed better. Ironic if it turns out to be the cause of my troubles despite the best of my (naive) intentions.
Here is another helpful quote I found after digging more into this that explains why I should use 5V over Vin:
cmiyc:
If you have a regulated 5V supply, you should just connect to the 5V pin / node.
Vin has a regulator which supplies 5V to the 5V pin / node. The regulator needs >7V to properly regulate down to 5V. Putting 5V in will get you less than 5V out, leading to unstable operation.
I'll try switching the power supply connections as soon as I am home. It is only a matter of 1 screw terminal so I would be elated if that's all I end up needing to do. I'll report back, successful or not.
I changed the +5V input from Vin to 5V but it had no effect on the flicker. Darn; was reeeeally hoping that would work.
While messing around some more I found that just holding the wire bundle heading to each strip seemed to cause the sweep sequence to sweep a little further down the strip before cutting out. The bundle contained the left turn, brake, and park light signals from the car's tail lamp along with the 5+, 5-, data, and clock wires to the strip. It was noticeable and repeatable. What does this indicate? Am I somehow acting as a sink for EMI or RFI?
I do have a roll of copper foil tape and based on this observation I am tempted to start wrapping wire bundles in it for a shield and then grounding the foil wrap. Maybe even the Nano and optocoupler, too.
If I can find the time this weekend I will be removing all the wires from the car and trying to move the resistors/capacitors nearer to the strips.
Probably yes. You are a large capacitor to ground.
Just screening is not going to do much unless you also ground the screen but only at one end of the bundle.
This weekend I had some time to try a few more things out.
I made a new temporary run of wires going to one of the DotStar strips that was shorter (it ran outside of the car directly to the strip rather than through body panels,) and the 1,000 uF capacitor and 330 ohm resistor were right at the beginning of the strip. Upon trying the lights with the engine off they ran great as expected. Once the engine was on they only flickered, no nice sweep.
I also tried running a long wire straight from the (+) terminal of the battery all the way to the DC-DC converter to bypass the fuse panel with it's many bundles of wires. Again, the LED strips performed great when the car was on accessory power, but flickered when the engine was running.
The isolated power supply I purchased last week is coming today, so I'll be giving that a shot this evening. This new converter has an actual datasheet with a block diagram (attached) indicating an "EMI Filter" in the input side and a "Rectifier & Filter" on the output side.
No luck with the alternate DC-DC converter; problem persists.
However, I did see something very interesting that may be pointing me a little further down the road of diagnosing this problem. I set up serial.print to read the voltage output of my optocoupler on one of the turn signal channels, both when the engine was off and on. The differences in the plots are stark. I've attached the resulting voltage plot for each condition.
With the engine OFF I see a nice clean digital +0V...+5V...+0V...+5V output from the optocoupler. +0V corresponds to the turn signal being off and +5V corresponds to the signal being illuminated.
When the engine is ON the optocoupler output seems to bounce between +0V and +5V three or four times sporadically during each turn signal cycle.
Do either of these observations give any thoughts as to what should be tried next?
I think this observation along with the test I did earlier to run new wire bundles to the DotStars (that showed no improvement,) tells me that my issue is somewhere on the input side of my system. Either before the optocoupler, within the optocoupler, or between the opto and the Nano.
Might it be worthwhile to try adding a 0.1µF capacitor across the opto input and ground? Or between the Nano input and ground?
Might it be worthwhile to try adding a 0.1µF capacitor across the opto input and ground?
Depends what you call ground. I would try something across the LED side of the opto.
Looking at the graph I would have thought that the detection circuit is not feeding the input side of the opto with enough current to turn it on hard enough. Again capacitors on what ever that detection circuit is.
Grumpy_Mike:
Depends what you call ground. I would try something across the LED side of the opto.
Looking at the graph I would have thought that the detection circuit is not feeding the input side of the opto with enough current to turn it on hard enough. Again capacitors on what ever that detection circuit is.
Late last night I added a 10K ohm resistor and 0.47µF capacitor in a couple places to see what they would do. The time constant for this combo is 4.7 ms. See the attached diagram for specific locations they were tried.
They were placed in parallel to each other. I focused only on the Right turn signal for this testing. When I added the R and C across the Right turn signal input pin and GND on the Nano the LED strip would not blink. When I removed just the capacitor and left the resistor I saw the same flickering (no change.) With just the capacitor the strip would not blink.
Since I had the R and C in hand, I also tried placing them across the signal input side of the optocoupler. I saw essentially the same performance as when the R and C were placed on the Nano side.
That diagram makes no sense at all. You have connected the -5V output as a signal ground and the -12V as an other sort of ground symbol.
I simply don’t understand it sorry.
Why do you have a 10K resistor across the capacitor? That just reduces the effect of the capacitor and increases the loading on the signal source.
Grumpy_Mike:
Why do you have a 10K resistor across the capacitor? That just reduces the effect of the capacitor and increases the loading on the signal source.
Well, that's embarrassing... it makes no sense why I connected them in parallel. Thank you for taking a look and pointing that out.
Grumpy_Mike:
That diagram makes no sense at all. You have connected the -5V output as a signal ground and the -12V as an other sort of ground symbol.
I simply don’t understand it sorry.
My apologies on this, too. -5V and -12V were my attempt to indicate that they are separate grounds. Still not sure if this is proper terminology, but I've re-labeled them as "chassis GND" and "converter GND." I'm trying to use the right words here, but I'm still learning the alphabet. For context, my background is chemistry.