Hacking an Illumagic light for reef-pi control

  • Thread starter Thread starter mawhins
  • Start date Start date
  • Tagged users None
Ok so I checked the ground and I had lost continuity, replacement results in some interesting outcomes.

The dimming now works. Changing duty cycle from 0 to 100% dims accordingly. However, the leds now strobe, not flicker. Full on and full off multiple times a second. I've tried frequencies from 10 to 3000. Took me a while to realise you have to reload reef-pi for the changes to take effect!

Should I take this setting higher? How does frequency in reef-pi translate to Hz? Could the strobing be the result of the wrong signal voltage? I'm thinking not.

Getting closer! Thanks for the input all.
Yes, it required reload. Can you try 80-400 range at more rigorously, i generally do a 50hz increment and then once i find a sweet spot, i go for 10hz fine tuning, generally thats really not required, but I have only tested 3-4 different lights :-/
 
Ideally, the average LED driving current is in linear proportion to the duty cycle of the PWM control signal in spite of the frequency. However, due to the inherent propagation delay of the chip and the rising/falling time of the driving current, the deviation of the actual current from theoretical value will become larger when the PWM frequency gets higher. That is, if the PWM frequency exceeds certain recommended value, the effect of the fixed propagation delay and the rising/falling time of LED current on the linear relationship between the duty cycle and the average current will become more apparent. On the other hand, if the PWM frequency is too low, the flicker will become observable. Therefore, it is important to choose a suitable frequency for the PWM signal. Please refer to the following timing chart & table for the limitation of maximum dimming frequency. It is determined by the minimum duty ratio, DMIN, and the minimum LED “ON” time, tON,MIN. The maximum dimming frequency, fPWM, can be calculated by the following formula:
Spec sheet tells you how to calculate what frequency to use (well more like what not to use really) but to be honest.. it's beyond me ATM..
http://product.ic114.com/PDF/H/hs711.pdf
Yea the more I dug the less likely it was voltage related.
Engineers are too obtuse..;)

Try 100Hz...spitballing here..
 
Last edited:
Opps
 
Update. Shut everything down including the Pi. Restarted a couple of hours later and it now seems to be working like a bought one!
 
@Michael Lane I'm curious if we can use a snpn transistor circuit to generate 12v pwm output from pi's 3.3v pwm. Employe a voltage divider circuit to generate 12V from the 15V input (or another buck converter)
The boost converter will draw more current from Pi, if I understand correctly, which is a concern.
I'll be updating you all with my pi pwm frequency verification on 2.4 releases. I had tested it on my end, but I'm hearing same issues fr0m new builds, so I'll double verify.
@Bigtrout @theatrus any advice?
Translating 3.3v to 15v pwm is exactly what my mosfet modules do in effect, although the ebay type are not fast enough to do more than 500hz because they were not designed properly.
Im still in the midst of designing a circuit using a real mosfet driver ic, and a pcb to match. (SUMMER is my busy time,I make alot more progress in fall and winter for hobby stuff) My plan is to make this thru hole so easy to solder. I want to design this so the mosfet driver can be used with an n channel mosfet for lowside switching(pwm on the ground side), or a p channel mosfet for highside switching(pwm on the V+ side) because aquarium led lights use both configurations depending on the brand etc.
 
Yea! to all.. ;)
 
Update. Shut everything down including the Pi. Restarted a couple of hours later and it now seems to be working like a bought one!
What frequency did you end up with?
 
100. I played around with a few different values but couldn't detect any difference. Might be different when it's over the tank. I'll dial it in later. Now just have to get hold of a PCA9685 so I can control all three channels. Was tempted to make the channels common and run it that way till the breakout board arrived but not sure if that would cause a problem.
 
Depends on the current drain of the driver chip I suppose. Meanwell LDD's pull little so the pi "should" be able to take it (for example) BUT just check the mA draw one the one PWM pin at 100%.
Aduino's limit is like 40 mA
Could always add a current limiting resistor.

You need to verify my advice though. Don't want you blowing the pi
 
Depends on the current drain of the driver chip I suppose. Meanwell LDD's pull little so the pi "should" be able to take it (for example) BUT just check the mA draw one the one PWM pin at 100%.
Aduino's limit is like 40 mA
Could always add a current limiting resistor.

You need to verify my advice though. Don't want you blowing the pi
Yeah I had an inkling that the current draw might be too much. Is it as simple as using the multimeter to check?
 
Depends on the current drain of the driver chip I suppose. Meanwell LDD's pull little so the pi "should" be able to take it (for example) BUT just check the mA draw one the one PWM pin at 100%.
Aduino's limit is like 40 mA
Could always add a current limiting resistor.

You need to verify my advice though. Don't want you blowing the pi
my vague recollection is 700ma across all GPIO, what i try to ensure is to keep any single GPIO draw is less than 20ma. But every build is different as the entire thing depend on source (GPIO powered or micro usb powerd) other consumer (sometime i daisy chain pca9685 input from pi, ds18b20 often powered by pi etc).
 
Yeah I had an inkling that the current draw might be too much. Is it as simple as using the multimeter to check?
As far as I know.. yes...
Using Meanwells as an example (driver chips ARE different) the current draw does change w/ dimming % but like most "stuff" like this I think it's an averaging thing..

Current draw now isn't apparently too much.. Your pi still works.. ;)

Data sheet lists supply current at 7mA
 
Last edited:
I'm doubtful that it would draw any important amount of current. These kinds of circuits usually use something similar to an op-amp or comparator to pwm dimming. Those are usually high input impedance.

To measure the current, switch your meter to mA or uA and move plug the red probe into the appropriate port. Then connect your pwm signal to the red probe and connect the black probe to the pwm pin on the light. You should be able to read the current if you set the pwm output to 100%. I'd be surprised if you get anything close to or above 1 mA. I'm pretty sure you would be fine connected all 3 inputs together, but @oreo5457 is correct that you should test first - especially when the datasheet doesn't specify the value.
 
Hey guys, have had the light running with the channels ganged up without a problem for the past two weeks while I waited for the pca9685 to arrive. Now that it has I haven't been able to get it setup. I have:
- given the breakout it's own power
- triple checked the connections sda and scl
- made sure the ground is connected
- checked the pi setup i2c enabled etc per the adafruit reef-pi instructions.
- checked enable pca9685 on reef-pi interface
- tried various frequencies

What's happening:
- no signal on breakout pwm pins with channels set to 100% when tested on multimeter
- nothing registered when I run sudo i2cdetect -y 1

pi@reef-controller:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@reef-controller:~ $

It's like the pi doesn't know about the breakout board. Have I missed a step?
 
The pca9685 isnt running or you would see it on i2c. You need 4 wires from the pi to the pca9685. You mentioned gnd, sda and scl. You still need vcc to the pi.

Can we see how you have it wired?
 
Last edited:
Yep got vcc connected to 3.3v out on pi. Will take pics when I get home.
 
Should the power led on the breakout be red? Just wondering if maybe it should be green?
 
Here are some pictures of the way I have it wired.
149670420073928841b288bb4b5e52da.jpg
6a05918f6805ac0c28d440cc2b5d5749.jpg
 
That looks like an old rpi. Your i2c bus may be on port 0. What do you get with the following?

Code:
sudo i2cdetect -y 0
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%

New Posts

Back
Top