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

dmsc2fs

Well-Known Member
View Badges
Joined
Dec 29, 2021
Messages
513
Reaction score
566
Location
Charleston
Rating - 0%
0   0   0
If I didn't miss anything, the last time Salinity and ORP probes came up is around 2017. Has anything changed with being able to add any new probes?
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Hi All! I'm working again on my Reef-Pi build. I'm testing a custom led driver to power my GNC Bluray M PRO using Reef-pi instead of the AirLink.
The original control allow me to use the blue channel at 1% as moon light and it produces a very dim blue light.
Using Reef-Pi if I set the dim to 1% it is much more brighter, it seems that it isn't using the 12bit capabilities of the PCA9685. How can I solve that?
Thank you very much!
Simone
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
Hi All! I'm working again on my Reef-Pi build. I'm testing a custom led driver to power my GNC Bluray M PRO using Reef-pi instead of the AirLink.
The original control allow me to use the blue channel at 1% as moon light and it produces a very dim blue light.
Using Reef-Pi if I set the dim to 1% it is much more brighter, it seems that it isn't using the 12bit capabilities of the PCA9685. How can I solve that?
Thank you very much!
Simone
Do you know if the original controller uses pwm signals in the first place? Or maybe true 0-10V (analog voltage, not pwm). The PCA9685 does something around 3.3V pwm or 5V pwm, what circuit did you create to convert it to whatever signal the lamp/ldriver expects, that circuit could mess with the signal as well.

Id first look at the output with a multimeter, then if you have it with an oscilloscope or logic analyzer, to see what's actually happening.
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
Hi All! I'm working again on my Reef-Pi build. I'm testing a custom led driver to power my GNC Bluray M PRO using Reef-pi instead of the AirLink.
The original control allow me to use the blue channel at 1% as moon light and it produces a very dim blue light.
Using Reef-Pi if I set the dim to 1% it is much more brighter, it seems that it isn't using the 12bit capabilities of the PCA9685. How can I solve that?
Thank you very much!
Simone
There are "hints" here:
and fixed years ago?
Are you running old code?
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
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
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
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
Well still beyond my pay grade but try changing the pwm frequency in reef-pi.
Just for fun.
Way back in my mind I "remember" something about a "relationship" between frequency and pwm stepping.
Its not "normal" so to speak.
Above is a bout a 1% chance I actually know what I'm talking about.. :)

As to frequency change:

Oh this maybe..
It turns out that Broadcom implemented "balanced" PWM in order to make the on and off PWM pulses as evenly distributed as possible. They give a description of the algorithm and some more discussion on page 139 of their datasheet:http://www.element14.com/community/servlet/JiveServlet/
Though that is err "backwards" from what I was thinking..

Anyways seems easy enough to change the frequency and see what happens.

Oh a "random" quote..
For PWM, the Pi's PWM output is by default not a typical mark:space waveform, but a balanced waveform, so it may not be what you're after - certianly the "frequency" becomes somewhat interesting to calculate, however you can put it into mark:space ratio mode then its more predictable, but it's still driven off the same 19.2MHz clock as above.

In the KHz and lower range, then you can generate reasonably accurate frequencies in software - look at the softTone module in wiringPi - it can generate a frequency from 0 to 5KHz - there is some jitter, but it's "good enough for jazz" ...


OR the onboard led drivers can't deal w/ such a low frequency as the 9685 is capable of..
And "if" I read the data sheet right max is :
PWM frequency PRE_SCALE
The hardware forces a minimum value that can be loaded into the PRE_SCALE register
at ‘3’. The PRE_SCALE register defines the frequency at which the outputs modulate. The
prescale value is determined with the formula shown in Equation 1:
(1)
where the update rate is the output modulation frequency required. For example, for an
output default frequency of 200 Hz with an oscillator clock frequency of 25 MHz:
(2)
The maximum PWM frequency is 1526 Hz if the PRE_SCALE register is set "0x03h".
The minimum PWM frequency is 24 Hz if the PRE_SCALE register is set "0xFFh".
The PRE_SCALE register can only be set when the SLEEP bit of MODE1 register is set to
logic 1.
Shouldn't be too hard to find the driver ic on the light.
 

Attachments

  • PCA9685[1].pdf
    399.2 KB · Views: 54
Last edited:

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Well still beyond my pay grade but try changing the pwm frequency in reef-pi.
Just for fun.
Way back in my mind I "remember" something about a "relationship" between frequency and pwm stepping.
Its not "normal" so to speak.
Above is a bout a 1% chance I actually know what I'm talking about.. :)

As to frequency change:

Oh this maybe..

Though that is err "backwards" from what I was thinking..

Anyways seems easy enough to change the frequency and see what happens.

Oh a "random" quote..



OR the onboard led drivers can't deal w/ such a low frequency as the 9685 is capable of..
And "if" I read the data sheet right max is :

Shouldn't be too hard to find the driver ic on the light.
I already try it.. max freq with the PCA9685 is 1.5KHz. I've tryed frequenzies from 100Hz to 1KHz with no luck..
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
I already try it.. max freq with the PCA9685 is 1.5KHz. I've tried frequencies from 100Hz to 1KHz with no luck..
Ok.. sort of gets to a driver (on light) signal (pca) mismatch.
I dont know how or why but it is leaning in that direction.
I dont think ther is anything wrong w/ the pi or the light. They just don't like each other in that way.. :beaming-face-with-smiling-eyes:

20KHz is "motor" pwm frequency. Not usually used for aquarium lights afaict.
 
Last edited:

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Right now I'm checking the differences between the 2 driver circuit...
I only have some minor diferrences in the under voltage lockout protection resistor divider.
I can try to feed my driver with a 20KHz signal and see what happen..
I don't know why I have such a big "jump" in intensity from 0% to 1%...
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
Right now I'm checking the differences between the 2 driver circuit...
I only have some minor diferrences in the under voltage lockout protection resistor divider.
I can try to feed my driver with a 20KHz signal and see what happen..
I don't know why I have such a big "jump" in intensity from 0% to 1%...
How are you judging the "moonlight" pwm level?
Like its 1%?

Also the gnc could be 16bit
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
How are you judging the "moonlight" pwm level?
Like its 1%?

Also the gnc could be 16bit
I found that value in the manual somewhere if I remember...
And also from the scope measurements it says that is 1% duty cycle..
Maybe it could be a 16bit PWM.. it is powered by an STM32 and it could be 16bit..
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
I found that value in the manual somewhere if I remember...
And also from the scope measurements it says that is 1% duty cycle..
Maybe it could be a 16bit PWM.. it is powered by an STM32 and it could be 16bit..
Can you dim to 0.5%
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
I don't think I can... I can only set the % with 1 increment..
Maybe switch output boards.if one can


yea its a driver but..
something like this..

16-Channel 16-Bit PWM Servo Motor Driver Module Shield Expander Extension Expansion Board HAT for RPI Raspberry Pi PICO W H WH RP2040 Accessories​

  • Note: Raspberry Pi PICO board is NOT included.
  • The standard RaspberryPi Pico interface is only applicable to Raspberry Pi Pico W/H/WH.
  • Up to 16 channels of servo/PWM output, 16-bit resolution for each channel. Onboard 5V voltage regulator chip, output current can reach 3A, can be connected to battery power supply through VIN terminal.
  • The test code is in the WIKI English manual. waveshare.com/wiki/Pico-Servo-Driver
 
Last edited:

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
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
Online datasheet says that driver can handle analog voltage, so maybe try that. Smooth down the output of the pwm with a low pass filter, possibly an op amp for stability

You could hook up a sensitive lab power supply first to try out how well it works driver side. Refer to the datasheets example circuit for analog control
 
Last edited:

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Another maybe stupid question..
Using the “fixed” profile in the Light tab how can I set the led channel to be on all day? Start and End time are not clear to me…
Thank you!
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
@oreo54 I'll do some research, thank you! @elysics do you have any schematic for the low pass with opamp? thank you!
I just looked in my post history to find a schematic, a year ago you actually posted one yourself here lol

Mind the pin and analog Input voltage the driver datasheet calls for though
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
6,877
Reaction score
4,081
Rating - 0%
0   0   0
@oreo54 I'll do some research, thank you! @elysics do you have any schematic for the low pass with opamp? thank you!
See the 4 types of possible "dim"..
@oreo54 I'll do some research, thank you! @elysics do you have any schematic for the low pass with opamp? thank you!
I've never thought "analog" dimming works well on the low side..
Apply a voltage between 0 - 1.24V

Note behavior at origin:
lm3409driver.JPG
 

Attachments

  • LM3409.pdf
    1,018.2 KB · Views: 71
Last edited:

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 37 27.0%
  • 100% dry rock + 100% live sand

    Votes: 46 33.6%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 21.9%
  • 75% live rock, 25% live sand

    Votes: 14 10.2%
  • 25% live rock, 75% live sand

    Votes: 10 7.3%
Back
Top