Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
Hello all,
I was messing around with my Chinese 165W LED lights last night, and the drivers use 3.3V through a pot to control the PWM dimming. The shutoff is about 0.3V, and 3.3V for 100%. I was able to control the PWM with an external variable power supply. Is there a way to use the controller to output 3.3 instead of 5 or 10v? Other options might be to shunt the excess through a zener, use a stamp or something to translate, or just use the 5v and hope nobody else in the house pushes it above 3.3v?
Thanks!
Posts: 3,250
Threads: 90
Likes Received: 163 in 120 posts
Likes Received: 163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
Hi Skwerl77, only 3.3v max is a surprise, seems like there's a lot of varieties of these lights out there. I would think you could also make a voltage divider using resistors to drop it down.
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
Oh yeah! Perfect, nice and easy, thanks!
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
Hi Rob, quick question. Are the LED outputs of the new board (ie ports 25, 26, etc.) a PWM output or a straight voltage?
Posts: 3,250
Threads: 90
Likes Received: 163 in 120 posts
Likes Received: 163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
Hi Skwerl77, the 16 LED outputs are still a 0-5v PWM signal.
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
I kinda figured on that right after I posted lol. I need an analog 0-3.3V to control my dimmers, so I'll have to come up with an RC filter.. Hey google....
Posts: 3,250
Threads: 90
Likes Received: 163 in 120 posts
Likes Received: 163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
Wouldn't it be a wonderful world if all drivers used the same voltage... I use the LM358D op amp to convert 5v pwm to 0-10v analog and it should be able to put out 3.3v as the datasheet says good down to 3v. Here's a page I found explaining how it works if you want to play around. The board I have would probably work with the correct resistor and voltage applied, I could do some testing however it would be 2 weeks before I could do it as I'm away right now.
http://henrysbench.capnfatz.com/henrys-b...converter/
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
It sure would!
I decided to try a LTC2644 PWM to DAC chip.. Probably a little more expensive than the op amp and RC filter, but I can give it a 3.3V reference for the output and pretty much be done with it. It has 2 channels, one for my whites and one for blues which is all I need. I'll post something when it all gets here and I can breadboard it up. I doubt it really matters but it should have better ripple than a RC filter..
Posts: 3,250
Threads: 90
Likes Received: 163 in 120 posts
Likes Received: 163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
That looks like a nice find, one thing that stuck out to me is it's available in 8, 10 or 12 bit, hopefully you ordered the 12-bit as that's what the controller puts out, sorry I wasn't clear about that. I use the PCA9685 which puts out 12-bits ranging from 0-4096, the 8 bit is only 0-255. I looked at the datasheet and I think the IC references that, so if its only 8-bit IC when the PCA9685 is set to 255 the DAC would be putting out full power as it expects 255 to be max, I could be wrong though and it actually reads the voltage coming in and the bits is for the output which would make a little more sense. Hope it goes well for you.
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
From what I understand, the resolution of the PWM controller is the resolution of one duty cycle, or how precisely you can define the edges of one cycle. So a 12 bit PWM controller can have the ON portion of the cycle from 0-100% in 0.0244% steps, while an 8 bit controller is still 0-100%, but in 0.392% steps. So if the PCA9685 is set to 255, it will put out 5v for 6.23% of the frequency cycle. The DAC measures the frequency of the pulses (leading edges I think?) as well as the width (trailing edges?), so it will still measure the 5v as being on for 6.23% of the cycle, but if it's 8 bit it just won't measure it as precisely (somewhere around 6.27% if my math is right?). The PCA will be on for its counts 1-255 and off for 256-4096, and the DAC will read the input as on for its count 1-16 and off for counts 17-255, because the input from the PCA turns off somewhere between counts 15 and 16, or between 5.88 and 6.27%. The PCA count #4096 and the DAC count #255 still end up at the same time because the frequency is the same, it's just the spacing in between that's different.
The PCA9685 has a programmable PWM frequency of 24-1526Hz, and the LTC2644 accepts frequencies from 30Hz to 25kHz (for the 10bit version I got..). Assuming you didn't program the PCA to 24-29Hz, I think it will work?
Or there's always a good chance I'm completely full of crap. We'll find out in a week or so lol!
Posts: 3,250
Threads: 90
Likes Received: 163 in 120 posts
Likes Received: 163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
That all sounds like it could be right, looking forward to hearing how it goes, you can change the frequency of the PCA in the controller sketch if needed.
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
So far so good. On a breadboard, I can get an analog output voltage of 0 to 3.3 volts using the controller LED output on port 25. Now I just have to mount it all up a little more permanently (perf board for now).
Posts: 3,250
Threads: 90
Likes Received: 163 in 120 posts
Likes Received: 163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
Nice work, are you using the LTC2644 you pointed out?
Posts: 59
Threads: 11
Likes Received: 0 in 0 posts
Likes Received: 0 in 0 posts
Reputation:
0
Joined: Apr 2018
Country:
Yup, and I pretty much just used the example in the datasheet, except that they added an opto-isolator. But I think it inverted the output so I got rid of the opto.
|