LED Driver acts as a proximity sensor - Page 1
Forum section: electronics / projects

author: fagiano
author_rank: Regular Contributor
timestamp: March 17, 2014, 04:26:16 pm
content: Hi, I have a strange problem, my LED driver board act as a proximity sensor.The board drives 3 strips of 7 leds each(cree xp-r & xp-e) 2 at 1A and one at 700mA with a 21.7V input voltage.The board uses 3 STCS2A and is controlled by 3 PWM signals coming from an MCU board. I pretty much implemented the sample in the datasheet (x3).Two of the strips work fine(the topmost and the one in the center) but the bottom one has a visible flicker and doesn't respect the PWM signal duty cycle.It seems like is picking up some noise. The strangest behaviour is that if I get close with my hand(2/3cm aka 1 inch) to the chip the led intesisty goes to the max. If I touch the chip it will go to max intensity or shut down until I touch it again.I tried to swap led strips and the behaviour is consistent. I also built a second board for fear of a bad component but it behaves the same.I tried with different PSUs. I can get some interference also touching other component(but might just be proximity).I really don't know what to look for, I guess I created some for of antenna or some silly grounding.I attached schematics and the board a layout, if you can give me an idea what to look for I'd be very thankful.ciaoAlberto

author: Niklas
author_rank: Frequent Contributor
timestamp: March 17, 2014, 06:48:03 pm
content: Have you checked the solderings? Sounds like a high impedance input that is floating.

author: tszaboo
author_rank: Super Contributor
timestamp: March 17, 2014, 06:48:33 pm
content: Your Enable signal is not biased if the jumper is not there, that probably is enough for the problems. I would add a weak pull up for any digital pin. Although the datasheet is really crap in this matter. Someone had to put more colors in it, instead of the input type of the digital pins (or some useful information)...

author: fcb
author_rank: Super Contributor
timestamp: March 17, 2014, 06:51:55 pm
content: LED's will generate voltage (solar cell) when exposed to light, it's quite a creepy effect - I've used it in big (8x8) arrays with a lightpen to build a UI many moons ago.

author: fagiano
author_rank: Regular Contributor
timestamp: March 18, 2014, 04:53:14 am
content: Quote from: Niklas on March 17, 2014, 06:48:03 pmI built 2 distrinct boards and both display the same behaviour on the same of the chips but not the others. I also reflowed all pins with my iron to make sure all contacts were fine. The only one that is hard to check is the big ground pad on the bottom of the chip.Quote from: NANDBlog on March 17, 2014, 06:48:33 pmI drive the enable pin directly from the MCU as I need to be able to turn the LEDs off, isn't it enough? I would have to add some kind of drive circuit to pull it up higher than 3.3V.thank you for your helpAlberto

author: fagiano
author_rank: Regular Contributor
timestamp: March 18, 2014, 03:40:27 pm
content: It seems that indeed a 3.3V MCU pin is not reliable enough for the "enable" pin of a STCS2A. If I put a jumper on "enable", short it to VCC at 21.7V and then drive the PWM from the mcu; everything seems much more stable. The datasheet is surely lacking on this and unfortunately the "one chip" prototype I did few months ago didn't show this behaviour. I'll have to add a buffer that swings at VCC. All I can think of implementing a non inverting digital buffer with 1 npn and 1 pnp. Is there any solution with less components?thank you for your timeAlberto

author: NiHaoMike
author_rank: Super Contributor
timestamp: March 18, 2014, 04:39:15 pm
content: A bunch of NPN/N channel transistors or a UN2003 and some resistors, then compensate for the inversion in software.

author: fagiano
author_rank: Regular Contributor
timestamp: March 18, 2014, 05:06:47 pm
content: I'd rather not have to invert in software, this is going in a reef aquarium and as a safety, if the MCU bursts into flames the leds should go off and not burn my corals. now I'm thinking 6 opamps in non inverting configuration, using 3 dual package SOIC should be pretty compact.Alberto

author: fagiano
author_rank: Regular Contributor
timestamp: March 18, 2014, 05:52:00 pm
content: Quote from: AhhhChoomy analog skills are so poor, it's embarrassing.Quote from: AhhhChooI like this solution thank you! man, I'm learning so muchTime to pull out the breadboard!EDIT: Argh, is not going to work, if the MCU is dead there's no bias current and it will turn on.ciaoAlberto

author: fagiano
author_rank: Regular Contributor
timestamp: March 18, 2014, 05:58:57 pm
content: No worries. No offence taken, being embarrassed motivates me to try harder (I should have put a smiley face).Alberto

author: Blechi
author_rank: Newbie
timestamp: March 19, 2014, 01:46:32 am
content: Hi,is the mcu pin driving the oddly behaving part an open drain output?In this case you'd have to add a pullup.hthBlechi

author: fagiano
author_rank: Regular Contributor
timestamp: March 19, 2014, 04:52:10 pm
content: QuoteNo is a push-pull with MCU pull-up (the MCU is an STM32F4)QuoteThank you again AhhhChoo, that's another interesting solution I'll give it a try tomorrow.However, I start to suspect that the real problem is around the "SLOPE" capacitor. Today I tried again to short "ENABLE" to VCC for all 3 chips and just drive the PWM pins from the MCU. initially everything was stable, but after a minute of poking around it started to misbehave again. So I'm not sure is the enable pin. if I get close to the slope cap the thing goes completely crazy. It really looks like closer I get to that cap more it increases intensity.Another very strange thing is that if I do not drive the enable pins from the MCU but set them low(the aren't connected to anything on the board anymore), the signal is much more stable(the "proximity sensor" effect is drastically reduced), maybe some noise on the flat flex. But the thing that makes me feel like something is deeply wrong is that the chips get hot... sometimes(yes that's as far as I can tell) and in my proto boards the never got more than body temperature. Tomorrow, I'll also try to remove the slope cap and see if is a rise time issue(I just tried again and the chip are not getting hot anymore).I'm really confused.

author: Rerouter
author_rank: Super Contributor
timestamp: March 19, 2014, 07:59:14 pm
content: Just a thought with your enable pin to make it inherently safe... AC couple and rectify the PWM as your enable signal, with a resistor pulling it weakly to the turned off state, so whenever the PWM is running the enable signal will be pulled on, if the micro locks up then the pwm stops and the enable signal falls flat, if it keeps on running at the same level thanks to a software bug then it shouldn't matter too much, as you can watchdog it,