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

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
5,724
Reaction score
3,521
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
135
Reaction score
102
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
5,724
Reaction score
3,521
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
135
Reaction score
102
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
5,724
Reaction score
3,521
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
5,724
Reaction score
3,521
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,550
Reaction score
1,544
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
135
Reaction score
102
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!
 

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
5,724
Reaction score
3,521
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: 16
Last edited:

oreo54

5000 Club Member
View Badges
Joined
Sep 18, 2017
Messages
5,724
Reaction score
3,521
Rating - 0%
0   0   0
Followup to the "pico" board mentioned above..


Haven't found an equivalent for other R Pi boards though.
Kind of odd it is so specific. Adapters?
Like I mentioned.. out of my pay grade..
 

Simonv92

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

Simonv92

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

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
158
Location
indo-pacific
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

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%
 

Simonv92

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

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
158
Location
indo-pacific
Rating - 0%
0   0   0
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
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
135
Reaction score
102
Location
Italy
Rating - 0%
0   0   0
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!!
 
Back
Top