reef-pi :: An opensource reef tank controller based on Raspberry Pi.

I'm now thinking about converting the PWM from the PCA9586 into analog, then feed a tiny micro which will do analog to 16bit PWM.
I've done a test with an arduino UNO and a simple sketch and it works with 16bit PWM, I have the very dim intensity..
It's not the best way to do that but at least it works..
 
Maybe the best way to do that is to find an I2C 16bit expander and write a driver for it..
But software side I need some help :downcast-face-with-sweat:
 
Thank both for the comments.
The original driver uses the same driver (LM3409HV)
On the original I've meauser with the oscilloscope a 5V 20KHz PWM signal on the control pin.
On my driver I've setup the frequency output of the PCA9685 at 1KHz and I'm feeding the signal directly into the dim pin.
I'm using the latest version (6.0) of Reef-Pi

First image is the PWM signal on the original AirLink set to "moon light":

SDS00001.png


Second is the signal coming out of the PCA9685 with Reef-Pi set to 1%:

SDS00002.png

Its same, but maybe you are recognize higher frequency as "dimmed"
Why you are not just setting up value lover that 1%?
Its 12bit I2c driver and can go as low as 0.024%
 
Its same, but maybe you are recognize higher frequency as "dimmed"
Why you are not just setting up value lover that 1%?
Its 12bit I2c driver and can go as low as 0.024%
How can I do that in Reef-Pi? The light tab allows me to dim from 1 to 100%
There’s an option to have the raw pwm value from 0 to 4096?
 
How can I do that in Reef-Pi? The light tab allows me to dim from 1 to 100%
There’s an option to have the raw pwm value from 0 to 4096?
I'm kinda give up on reef-pi and move over to Home Assistant.
But you can manually enter value to input field. I just checked it on virtual machine with reef-pi and its working:
Screenshot 2024-05-23 205618.png
 
I'm kinda give up on reef-pi and move over to Home Assistant.
But you can manually enter value to input field. I just checked it on virtual machine with reef-pi and its working:
Screenshot 2024-05-23 205618.png
I’ll give it a try this evening.. does it work also for interval mode? The one you can choose the intensity for each hour?
Thank you!!
 
Checked, no its not :dizzy-face:
So its UI problem and nothing you can do with that.
Thank you!
I don't know how to modify that in reef-pi software...
I'll do some more test with pwm -> analog -> pwm 16bit conversion..
It's not the best way but if we cannot modify the PCA9685 driver is the only solution..
 
Thank you!
I don't know how to modify that in reef-pi software...
I'll do some more test with pwm -> analog -> pwm 16bit conversion..
It's not the best way but if we cannot modify the PCA9685 driver is the only solution..
You have the option to fix reef-pi for your own use, though I am uncertain if the repository maintainers are still actively supporting the project.

Could you clarify how PWM-Analog-PWM might be beneficial for you?

The issue with reef-pi is that it offers 0–100% settings with a 1% increment. Whether using 12-bit or 16-bit, this 1% step will yield similar results. I suspect the developer of this module may not have used it themselves, as such a cumbersome UI suggests a lack of practical experience.
 
You have the option to fix reef-pi for your own use, though I am uncertain if the repository maintainers are still actively supporting the project.

Could you clarify how PWM-Analog-PWM might be beneficial for you?

The issue with reef-pi is that it offers 0–100% settings with a 1% increment. Whether using 12-bit or 16-bit, this 1% step will yield similar results. I suspect the developer of this module may not have used it themselves, as such a cumbersome UI suggests a lack of practical experience.
I also don't see any new update in the last month, we'll see.. I hope that the maintainers are still supporting the project..

Using a micro in the middle between reef-pi and the led driver I can force the pwm output to a lower level when a 1% signal is received on the input.. Not an elegant solution but I think It'll work.

Yes we have to unlock the 0 - 4096 value dimming (as done by @robsworld78 in his Robo-Tank app). But I don't know how and where to modify that... If you have any idea we can try...

Last solution will be using the original AirLink but it became very very hot and tech support says that is normal...

I feel a little frustrated right now, as I have done so many test, build my own pcbs for the controller and I miss this little step to finish everything..

 
@yury88 I've tested on version 6.0; If I enter 0,1% it'll keep the led very very dim :beaming-face-with-smiling-eyes:
It works!! in the first % values light bounces a bit (tested form 0.1 to 5 to 0,1) but I can live with that..
Maybe @Ranjib in the future can smooth the dim curve.. ;)
 

Attachments

  • Screenshot 2024-05-23 212330.jpg
    Screenshot 2024-05-23 212330.jpg
    31.5 KB · Views: 69
@yury88 I've tested on version 6.0; If I enter 0,1% it'll keep the led very very dim :beaming-face-with-smiling-eyes:
It works!! in the first % values light bounces a bit (tested form 0.1 to 5 to 0,1) but I can live with that..
Maybe @Ranjib in the future can smooth the dim curve.. ;)
That could be your eyesight..
Linear dimming the low end can look abrupt because your eyes are more sensitive to "steps"
See gamma curve dimming..
Years ago I did suggest it as a "choice" linear or different gamma curves but do not believe it was implemented.

to "fix" it you'd use floating point math or a LUT..
 
Last edited:
That could be your eyesight..
Linear dimming the low end can look abrupt because your eyes are more sensitive to "steps"
See gamma curve dimming..
Years ago I did suggest it as a "choice" linear or different gamma curves but do not believe it was implemented.
I've read that the best curv for led dimming is not linear but kind of logarithmic.

https://lygte-info.dk/project/Demo16bitPWM UK.html

I think that reef-pi uses a linear dimming curv.
For now this is the best I could achieve, maybe in the future we can try to add this feature to reef-pi... these are the mod that I cannot do by myself.. unfortunately I'm an hardware guy, not a software one :downcast-face-with-sweat:

P.S. does anyone of you know if I can set multiple mode for the same led channel? I want to run my blue channel both as Diurnal and as Lunar. There's a way to set it up or do I have to use the Interval mode at set each slider to the corresponding value?
thank you!
 
Last edited:
I've read that the best curv for led dimming is not linear but kind of logarithmic.

https://lygte-info.dk/project/Demo16bitPWM UK.html

I think that reef-pi uses a linear dimming curv.
For now this is the best I could achieve, maybe in the future we can try to add this feature to reef-pi... these are the mod that I cannot do by myself.. unfortunately I'm an hardware guy, not a software one :downcast-face-with-sweat:

P.S. does anyone of you know if I can set multiple mode for the same led channel? I want to run my blue channel both as Diurnal and as Lunar. There's a way to set it up or do I have to use the Interval mode at set each slider to the corresponding value?
thank you!
reef-pi has a variety of pwm profiles that are not linear including sine and diurnal profiles https://github.com/reef-pi/reef-pi/blob/main/controller/pwm_profile/sine.go#L30

we can have a new profile to use some quadratic equation (read as curve) for interval based profiles (which is linear now), as long we have he mathematic formula and user appetite I don't see any reason to not have support that. If there's enough interest please create a GitHub issue and we can track it there
 
Thank you @Ranjib as always!! It is also possible to use two different profile at the same time on the same channel?
I mean, I have a blue channel on my lamp, and I want to use them on a Diurnal profile but also as Moonlight. There's a way to do that?

Do you also have a page where you show all the different lights mode and how do them work?
Thank you very very much!!
Simone
 
Thank you @Ranjib as always!! It is also possible to use two different profile at the same time on the same channel?
I mean, I have a blue channel on my lamp, and I want to use them on a Diurnal profile but also as Moonlight. There's a way to do that?

Do you also have a page where you show all the different lights mode and how do them work?
Thank you very very much!!
Simone
You should be able to use two different profile using two different light controller under the same module using the same jack/driver. You have to be careful about them not interefering with each other, by using timer to enable /disable them during night time vs day time.

I have not tested this, but I think it will work.

I don’t have a reference document showing each profile difference, but either in this thread or somewhere else I recall going over them during the release announcement. It will be nice to document those here
 
You should be able to use two different profile using two different light controller under the same module using the same jack/driver. You have to be careful about them not interefering with each other, by using timer to enable /disable them during night time vs day time.

I have not tested this, but I think it will work.

I don’t have a reference document showing each profile difference, but either in this thread or somewhere else I recall going over them during the release announcement. It will be nice to document those here
Thank you again!! I've tried to enable/disable the light using the timer but it doesn't work..
Timer seems to do nothing on lights... Maybe I'm doing something wrong
 
Thank you again!! I've tried to enable/disable the light using the timer but it doesn't work..
Timer seems to do nothing on lights... Maybe I'm doing something wrong
Hi Simon, for me it did work. Only I created 4 timers. One to turn on day and one to turn off day, one to turn on moonlight and one to turn of moonlight. Then I made one reversible macro to turn on day and turn off moonlight that I triggered only ones to initiate the start. Hope that helps....
 
Hi Simon, for me it did work. Only I created 4 timers. One to turn on day and one to turn off day, one to turn on moonlight and one to turn of moonlight. Then I made one reversible macro to turn on day and turn off moonlight that I triggered only ones to initiate the start. Hope that helps....
I'll do some test, thank you!!
Can you please share your timer and macro config? On my Controller Timer and Macro seems to do nothing on light...
 
Last edited:

TOP 10 Trending Threads

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 19 57.6%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 14 42.4%
Back
Top
Home
Post thread…
Market
What's new