Reef Pi dimming test problems and Raspberry pi native two hardware PWM vs PCA9685

OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Hummm... I see what you are saying, but the 10K resistor there will be in parallel with the already existing led and 4K7 resistor from the board witch will lower even more the resistance.
Let's calculate more or less:
1 / 1000 ohm (new resistor) + 1 / 470 ohm (one from the board plus the led, not counting with led value since will be near 1 ohm or a lot lower) = 1 / 0.003 = 319 ohm rounded final value


If I remember correctly from my old DIY driver design a simple circuit like this I had it working with my first DIY led lamps using a direct PWM from an Arduino:

1669731211735.png


Then I connected the lamp power supply positive straight to the lamp and control the negative trough this circuit.
I had 4 lamps, 2 for blue light and 2 for white so the four exits on the chematiq two for each color channel, just ignore the MOSFET name, since that one is not a 5V logic level one, that one has a RDS(on) for @10V. ; )
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Hummm... I see what you are saying, but the 10K resistor there will be in parallel with the already existing led and 4K7 resistor from the board witch will lower even more the resistance.
Let's calculate more or less:
1 / 1000 ohm (new resistor) + 1 / 470 ohm (one from the board plus the led, not counting with led value since will be near 1 ohm or a lot lower) = 1 / 0.003 = 319 ohm rounded final value


If I remember correctly from my old DIY driver design a simple circuit like this I had it working with my first DIY led lamps using a direct PWM from an Arduino:

1669731211735.png


Then I connected the lamp power supply positive straight to the lamp and control the negative trough this circuit.
I had 4 lamps, 2 for blue light and 2 for white so the four exits on the chematiq two for each color channel, just ignore the MOSFET name, since that one is not a 5V logic level one, that one has a RDS(on) for @10V. ; )
Well, if you omit the 10k load resistor, you would only drive the LED+4.7K resistor at about 2mA. The D4184 Module's Pin 2 would then show an inverted PWM, but I think this would only go from GND to about 9V, since the LED has a huge resistance when the voltage over it drops below ~1-1.5V.

You should probably try this out. Simply measure the DC voltage on Pin 2 for a 10% PWM input on the PWM port. If the DC voltage on Pin 2 is at ~8.1V instead of 9.0 my thinking is correct and your output PWM signal isn't actually 10V PWM, but 9V PWM.

The solution to this would then be to connect the 10k resistor as a load, as I have suggested. This would only add a maximum of 1mA of load current. Your total current would then be 3mA @ 10V, for a total resistance of about 3300Ohm, as you have calculated. This amounts to 30mW of power which is nothing, since the proposed DC/DC converter is made for up to 7W. In fact, your DC/DC converter might actually become slightly unstable when the load is this low. You will have to test that out by measuring how stable your 10V are at 0% PWM and 100% PWM.


Driving LEDs with a PWM, like in the drawing you provided is slightly different than generating a PWM signal itself.
 
Last edited:
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
You are right, I totally forgot that in this scenario I have a new driver inside the lamp and this driver works with 10V PWM.
My previous schematic was a driver itself to switch directly the LEDs.

Ok waiting for some free time so I can wire everything on the table as you suggested and start the tests.
Thanks.
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Well I just wired everything and I'm afraid this is not working, the light is always flashing/flickering even I tried PWM frequency for the PCA9685 board from 100 to 1500.
Anyway I was reading the board specs and looks like that only reach a maximum of 1000 Hz so don't know how it still works when I use 1500. maybe ignores and works at the 1000 max. Don't know here.

I think Nicrew send me the wrong information and this will not work with a 10V PWM signal but should be 0-10V analog like everyone else is talking about.

If I put 1% on Reef pi I get a slow on and off, like goes quickly on when the PWM cycle jumps to 10V them off after the square signal goes down, since the multimeter doesn't peak this it shoes normal DC voltage from 0v to 10V when I raise the Reef pi value on manual test mode.
The speed of the on and off varies with the frequency I setup which is normal.

Another info is that everyone is using it with the Kessil Spectral controller, and can't see any information what type of signal that controller has on his 0-10v port.
 
Last edited:

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Too bad, I was afraid of that. It still uses the frequency you put in, put the signal get's distorted, e.g. the rectangle pulses become more like a trapezoid. Important here are the switching speeds of the Optocoupler and the MOSFET. As well as whether you connected the 10k load resistor as discussed.

All of this can of course influence the lamp’s behavior, but I would tend to agree with you there, that it’s probably not 10V PWM, especially since dimming actually worked before with an analog DC signal, right ?
Did you test whether it responds as expected with the previous circuit if you give it 1-10V , e.g. gives about 10-100% brightness ?

All is not lost, however. You can probably still use this module to generate a precise and clean 0-10V analog voltage signal and see if that works better than the other module. I’ll think about that and get back to you, but it will probably look very similar to the proposed Arduino PWM filtered to a DC with a resistor and a capacitor.
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Yes using the 0-10V analog I get normal dim and I can say from 10% to 100%, since has having that problem I said before for the lower values and I say it again, they only work with 2% for example if I started at 10% or other higher an then come down, but here even the DIM works and gets lower brightness.

I have more of this 0-10V analog boards so going to test now others to see if all have this behavior with the lower values to rule out problems on the boards and it's really a bug or faulty on the lamp drivers.

EDIT: Forgot to say that I use your suggestion with the 10k load resistor and the inverted option on Reef Pi.
 
Last edited:
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Ok, result of some further tests with the PWM to 0-10v analog board:

- First voltage to turn the light on is 0.82V which is 3% on Reef Pi
- After the 3% I can go back to 2% minimum still having the light on which gives 0.39V and this changing is notable since I get lower dim visually.
- 1% independent being as initial value or as a going back value after having the light on gives always 0V so light always off as expected.
- 100% gives 10v until 84% so 83% lowers giving 9.97V.
- In between the previous value until reaching 50% I get jumps of +/- 2V.
- 50% gives 7.49V, and so on in small steps.
 
Last edited:

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
Ok, result of some further tests with the PWM to 0-10v analog board:

- First voltage to turn the light on is 0.82V which is 3% on Reef Pi
- After the 3% I can go back to 2% minimum still having the light on which gives 0.39V and this changing is notable since I get lower dim visually.
- 1% independent being as initial value or as a going back value after having the light on gives always 0V so light always off as expected.
- 100% gives 10v until 84% so 83% lowers giving 9.97V.
- In between the previous value until reaching 50% I get jumps of +/- 2V.
- 50% gives 7.49V, and so on in small steps.
The numbers don't seem so good, I'm wondering how good that converter is. On mine 1% is about 0.14v and 50% is 5v and no weird swing when lowering from 100%. Is the PWM signal from the pca9685 3.3v or 5v at 100%?
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
The numbers don't seem so good, I'm wondering how good that converter is. On mine 1% is about 0.14v and 50% is 5v and no weird swing when lowering from 100%. Is the PWM signal from the pca9685 3.3v or 5v at 100%?
It’s 5V as far as he mentioned. I agree, this sounds very strangely nonlinear.


Ok, result of some further tests with the PWM to 0-10v analog board:

- First voltage to turn the light on is 0.82V which is 3% on Reef Pi
- After the 3% I can go back to 2% minimum still having the light on which gives 0.39V and this changing is notable since I get lower dim visually.
- 1% independent being as initial value or as a going back value after having the light on gives always 0V so light always off as expected.
- 100% gives 10v until 84% so 83% lowers giving 9.97V.
- In between the previous value until reaching 50% I get jumps of +/- 2V.
- 50% gives 7.49V, and so on in small steps.
Interesting, did you calibrate the circuit to 10V@ 100% PWM or 5V @ 50% PWM ?

I would expect that this might make a difference and would lead you to a much nicer output of e.g. 9.0V @ 90% PWM for example.

One thing you should check, because I’m not sure if you have done this:
- Turn the light off with 0% PWM
- Set the PWM to a non light value, e.g. 2% and measure DC voltage
- turn the light on with a high enough PWM
value
- go back to 2% PWM and check if the voltage is the same.
If it is the same voltage both times, I’m afraid that the circuit is working correctly and it’s your light that has a strange offset correction to prevent a noisy 0V signal from turning the light on sporadically. The Reefbreeder photon v2 light has a similar feature with the right adapter, where you can set this offset value manually by pressing a certain button when input signal is at „0“
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Hi, as I said some post ago the board is now calibrated to 7.50V @ 50% because only with this I can start having light with 3% on Reef Pi.
If calibrate it correctly for 5V @50% I only start having light with 10% on Reef Pi.
I shifted down so to compensate this problem, but the voltages are different as I said here on my previous post and I quote here that part again having the 7,50V calibrated:
- First voltage to turn the light on is 0.82V which is 3% on Reef Pi
- After the 3% I can go back to 2% minimum still having the light on which gives 0.39V and this changing is notable since I get lower dim visually.

- 1% independent being as initial value or as a going back value after having the light on gives always 0V so light always off as expected.

The PWM signal from the pca9685 is 5v at 100%, so this is ok.

The problem is at the lamp itself that only turns on at first with 0,82v and after this accepts a lowest 0,39V.
But I say again with 0,39v only works if the light is already on, from an off state it does nothing.
So I don't know if this is the normal behavior or mine has really some defect.

@Sral choosing 2% on Reef Pi either having the lamp on or off gives always the same 0,39V.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Okay, this realy sounds like your lamp is the origin of the problem. My thoughts on this:
- Your lamp has an offset of just short of 1 V (~0.8V), e.g. when it's off it waits until the voltage rises above that
- If you calibrate your 0-10V board to 5V @ 50%, it works "correctly" and gives this ~1V @ 10%, as it's supposed to.
- If you calibrate it to 7.5V @ 50% you already get ~1V @ 3%, but lose accuracy:
----> in your calibration minimum dim @ 2% is ~0.4V and start-up @ 3% is ~0.8V, so you only get 1 dim step between them
----> with the "correct" calibration minimum dim @ 4% is ~0.4V and start-up @ 10% is ~0.8V-1.0V giving you 6 dim steps between them

I'm currently thinking about a method to remedy that ... either through software or hardware:
----> use a macro to shortly activate a "start-up" light with a constant 10% and turn it off again so that another light that's already at the minimum of 4% can take over
----> I could also write the same thing in Python or C, if that works better

----> One could also build a latch circuit that does the same thing in hardware, e.g. offset the DC voltage when input is below 0.4V and remove the offset when the input is above that. I could probably design this using a MOSFET and an OP-Amplifier
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Yes, your correct on the numbers and values from your conclusion and the work around is sort what I did now.

I calibrate the 0-10v analog boards back to 5v @50% PWM and did a pre-sunrise light/timer that starts at 10% with a 2s duration that when finishes catches the normal one starting with 3% and like this I have sort of only 2s with 10% and after returns to the lower DIM possible and ramps normally from there. I'm also trying here how to lower the timing for 1s, but 2s it's almost unnoticeable for now. ;)

Anyway I'm not happy with the lamp just because this, but I'm trying to see if anyone having the Nicrew official controller to give ne some feedback how it behaves and voltage has on the lowest program value that turns the lamp on so to compare.

Going to reach also the seller and Nicrew and expose my problem to see if they can say if this is the normal for this lamp or mine has some kind of defect.

Seriously thinking in returning the lamp and going to another brand, but I like the design and being so powerful enough for my tank. I have to see other options sort of identical.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Well I just wired everything and I'm afraid this is not working, the light is always flashing/flickering even I tried PWM frequency for the PCA9685 board from 100 to 1500.
Anyway I was reading the board specs and looks like that only reach a maximum of 1000 Hz so don't know how it still works when I use 1500. maybe ignores and works at the 1000 max. Don't know here.

I think Nicrew send me the wrong information and this will not work with a 10V PWM signal but should be 0-10V analog like everyone else is talking about.

If I put 1% on Reef pi I get a slow on and off, like goes quickly on when the PWM cycle jumps to 10V them off after the square signal goes down, since the multimeter doesn't peak this it shoes normal DC voltage from 0v to 10V when I raise the Reef pi value on manual test mode.
The speed of the on and off varies with the frequency I setup which is normal.

Another info is that everyone is using it with the Kessil Spectral controller, and can't see any information what type of signal that controller has on his 0-10v port.
I believe I know why you see this flickering. The lamp itself is probably dimmed with PWM using a certain frequency.
If you now input your PWM frequency on top through the signal port, the lamp effectively multiplies both frequencies and you see the beating of the difference between the frequencies, as they are not equal. The closer you get the frequencies, the slower the visible change in light intensity and Vice versa.
When you then change your PWM input to the lowest frequencies (e.g. 100 Hz) you then don’t see the beating anymore, but the flickering from your 100 Hz.
You’re basically screwed both ways, at high Input PWM frequency the difference frequency is low enough to be visible, whereas at low frequencies the PWM itself is low enough to be visible.
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
No, the flickering was because I receive the wrong information from Nicrew and I was testing feeding the lamp with 0-10v PWM instead of 0-10v analog, later they send me new email saying that the lamp really uses only 0-a0v analog.

Also I receive this further information that justifies why the lamp only turns on at 6% but doesn't justify why after this I can lower to 3% and this is noticeable on the intensity being lower as I reported.

Mail from Nicrew:
"
Hello,
Thanks for your update.

Actually, if the voltage is too low, the light will blink, so we set a starting voltage of 0.82 V. If the voltage is between 0 and 0.82 V, the light will turn off, and if the voltage is greater than 0.82 V, the light will begin to turn on.

And here is the link to the HyperReef controller: www.amazon.com/dp/B09QPPJYXL "

They recommended me to use they're controller on another email after, I wonder why? ; )

Anyway going to do further tests and if not good for me I'll order the controller to test it as well, but going to think that the first intensity of the controller is going to be identical as the 6% so the 0,82v and I can't go lower after since that controller doesn't do it.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
No, the flickering was because I receive the wrong information from Nicrew and I was testing feeding the lamp with 0-10v PWM instead of 0-10v analog, later they send me new email saying that the lamp really uses only 0-a0v analog.
[...]
That's basically what I was saying, even though a bit more convoluted ^^

Yeah ... I wonder why they recommend their own controller ... probably because it is much better than the competition and not because nobody discloses what's actually inside :face-with-tears-of-joy:

Best of luck with the testing !
 

kurbanas

Community Member
View Badges
Joined
May 4, 2020
Messages
40
Reaction score
72
Rating - 0%
0   0   0
Hi all
I came across these Nicrew lights and this thread as I am trying to find some reef-pi/RoboTank compatible lights because my Kessil A360X aren't compatible (expensive oversight on my part :oops:)

Most of this thread is a bit over my head so my question is - any idea if these Nicrew lights would be compatible with RoboTank as a controller? Would there be any limitations?
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
Hi all
I came across these Nicrew lights and this thread as I am trying to find some reef-pi/RoboTank compatible lights because my Kessil A360X aren't compatible (expensive oversight on my part :oops:)

Most of this thread is a bit over my head so my question is - any idea if these Nicrew lights would be compatible with RoboTank as a controller? Would there be any limitations?
Ooops, yeah, that's unfortunate ... but I'm pretty sure that you will be able to sell that light at very little loss, especially if it's not used and brand new.

The upper wattage lights should be compatible with Robo-Tank as a controller (I think this thread mentions that the 50W version is different in this regard), if you have the equipment extension. On the equipment extension you can set the output to 0-10V analog with jumpers and feed that to your light, which should be identical to what Nicrew's own new controller puts out. You will only have to furnish a cable connection from a TRS audio connector to the light, not sure what the ligth itself has, maybe that's a TRS audio as well.

Only limitation might be the precise dimming on low settings, as we discussed in this thread, e.g. the light might only start at 8 to 10% of light power instantly, instead of a smooth startup starting already at a lower percentage.
I would however recommend to wait for @SpyLand 's Experience with the Light and Nicrew's own controller before buying in any case.
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
Hi, everyone I ordered the controller and expected it to arrive on next Monday if not soon.
When it arrives my first test will be setting on manual mode and ramp one channel to the first value that can be selected and as I think and Nicrew told me the light should turn on right way, them I'll measure the voltage on controller exit to see what king of value will be so I can compare to all my DIY controller tests.
Also compare intensity and smooth variations from 0 to 100%.

I'll keep it posted as soon finish all these tests and some other that I'm currently executing with other controller options.
 
OP
OP
S

SpyLand

Community Member
View Badges
Joined
Nov 21, 2022
Messages
34
Reaction score
47
Location
London
Rating - 0%
0   0   0
So finally I had some time to do some tests with the official Nicrew controller and here is my findings.

It's worst than I was thinking, because the first step turns the light on with even higher intensity and a voltage bigger than the 0,82v i can turn it on with Reef pi.
So this is no good for me, I need lower dim intensity's for having a proper sunrise on my aquarium since the 100W from this lamp is too much, so I'm running the 2 channels as a max of 40% for white and 60% for blue.
Going to return this Nicrew controller to the seller.

Anyway here are some images with the voltage measures I did for blue channel when is off, when on with the first line on the bar (5%) them at 50% and finally at 100% so who might need this information and is thinking in buy this control knows what to expect:

IMG20221212153900.jpg

IMG20221212153927.jpg

IMG20221212153946.jpg

IMG20221212154005.jpg


Further more, I regret to say that going to abandum the use of Reef pi.
It has top and extensive features, but my needs are mainly for controlling the lights with some specific timings/intensity I need for sunrise, day, sunset and moonlight.
So with Reef pi this is too complex to achieve and having a good failproof and easy program since it keeps sending the PWM values always even they are out of the setup hours and needed some extra configuration with timers to enable this disable that so they don't overlap and sort of manage to have all effects I want working without stepping on each other. Way too complex and fails easily in case of a power failure.

I'm currently using a simple ESP8266 controller to generate the PWM signal for each of the two channels and the timings are sent to him and controlled by MQTT from Home Assistant. Since this even works for timings with microseconds I'm able to overcome the problem of needing the initial 0,82v to turn the lights on and only after I can lower to a 0,34v value with a quick initial timer turning on and a second one half a second later lowering it down. ; )
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,005
Reaction score
971
Location
Germany
Rating - 0%
0   0   0
So finally I had some time to do some tests with the official Nicrew controller and here is my findings.

It's worst than I was thinking, because the first step turns the light on with even higher intensity and a voltage bigger than the 0,82v i can turn it on with Reef pi.
So this is no good for me, I need lower dim intensity's for having a proper sunrise on my aquarium since the 100W from this lamp is too much, so I'm running the 2 channels as a max of 40% for white and 60% for blue.
Going to return this Nicrew controller to the seller.

Anyway here are some images with the voltage measures I did for blue channel when is off, when on with the first line on the bar (5%) them at 50% and finally at 100% so who might need this information and is thinking in buy this control knows what to expect:

IMG20221212153900.jpg

IMG20221212153927.jpg

IMG20221212153946.jpg

IMG20221212154005.jpg


Further more, I regret to say that going to abandum the use of Reef pi.
It has top and extensive features, but my needs are mainly for controlling the lights with some specific timings/intensity I need for sunrise, day, sunset and moonlight.
So with Reef pi this is too complex to achieve and having a good failproof and easy program since it keeps sending the PWM values always even they are out of the setup hours and needed some extra configuration with timers to enable this disable that so they don't overlap and sort of manage to have all effects I want working without stepping on each other. Way too complex and fails easily in case of a power failure.

I'm currently using a simple ESP8266 controller to generate the PWM signal for each of the two channels and the timings are sent to him and controlled by MQTT from Home Assistant. Since this even works for timings with microseconds I'm able to overcome the problem of needing the initial 0,82v to turn the lights on and only after I can lower to a 0,34v value with a quick initial timer turning on and a second one half a second later lowering it down. ; )
Sad to hear that, but I guess if you really only need this lighting feature, it’s probably for the best right now.
Maybe in the future I’ll have a look into the Reef-Pi code and help @Ranjib with this feature, if I am able to, as I want pretty much the same thing ^^
 
Last edited:

A worm with high fashion and practical utility: Have you ever kept feather dusters in your reef aquarium?

  • I currently have feather dusters in my tank.

    Votes: 73 37.8%
  • Not currently, but I have had feather dusters in my tank in the past.

    Votes: 66 34.2%
  • I have not had feather dusters, but I hope to in the future.

    Votes: 25 13.0%
  • I have no plans to have feather dusters in my tank.

    Votes: 28 14.5%
  • Other.

    Votes: 1 0.5%
Back
Top