Page 1 of 1

Using Float Switch ports for Dimming

Posted: Tue Feb 10, 2015 2:22 pm
by dedvalson
Is it true that the float switch ports can be re-purposed as analog outputs for pumps / lights? I saw that somewhere but I can't find it now.

Don

Re: Using Float Switch ports for Dimming

Posted: Tue Feb 10, 2015 2:31 pm
by rimai
Yes, but it is not going to be analog. It will be 0-5PWM signals.

Re: Using Float Switch ports for Dimming

Posted: Wed Feb 11, 2015 1:58 pm
by saf1
Oh, I never knew this. So if I understand this correctly you would have the two existing diming ports then two more by using the float switch ports for a total of 4?

Is there any special code or how are the two ports referenced (or examples)? I have a pair of Rapid LED's Borealis Luxeon arrays. Each chip has 4 channels that I will power by the Mean Well LDD dimmable driver. 2 will be 1000mA and 2 will be 700mA that I'm going to test/use over a 40 breeder. Since I'll be dimming each of the chips the same 4 ports would be enough provided they will work with the LDD's.

Thanks for any information.
-scott

Re: Using Float Switch ports for Dimming

Posted: Wed Feb 11, 2015 3:27 pm
by rimai
Yes, the ATO ports are 0-5PMW that you can connect directly to LDD, but the regular dimming channels are 0-10V.
So be careful to dim LDDs with the regular dimming channels.
You need to add this to the setup():

Code: Select all

pinMode(lowATOPin,OUTPUT);
pinMode(highATOPin,OUTPUT);
Then this in loop()

Code: Select all

analogWrite(lowATOPin,255); // yuo can dim from 0 to 255
analogWrite(highATOPin,255); // yuo can dim from 0 to 255

Re: Using Float Switch ports for Dimming

Posted: Wed May 06, 2015 11:38 pm
by joshlawless
I understand that if I remove the surface mount resistor R2 from the standard Jebao dimming cable harness, I can use the 0-5v PWM signal from the ATO pins to control pump speed. Is there a way to code this to take advantage of the DCPUmp function? Somehow associate Sync or Antisync with the ATO pin?

Alternatively, is there a way to set the ATO pin level to correspond to a portal-accessible variable, to change the pump speed manually?

Re: Using Float Switch ports for Dimming

Posted: Thu May 07, 2015 8:28 am
by rimai
Yeah, I think lnevo already added that to the libraries.
You can use any of the other memory locations you are not using to change the speed of the pump. For example, use the dosing pump timer 1 to set the speed.
If you expand to using the android app, you can use the custom variables too.

Re: Using Float Switch ports for Dimming

Posted: Thu May 07, 2015 9:41 am
by joshlawless
Is there a big difference in feature set between the Android and iOS app? I have the UAPP on my iPhone. Don't see the custom variables yet, but I haven't uploaded my latest code with the setup() line that defines one to a non-zero value yet.

Re: Using Float Switch ports for Dimming

Posted: Thu May 07, 2015 9:42 am
by rimai
I can't remember if you can set custom variables through the UApp :(
I know Curt just added that to the Android.

Re: Using Float Switch ports for Dimming

Posted: Thu May 07, 2015 9:55 am
by joshlawless
A little OT -- where is the code for generating the reefangel "http://xxx.xx.xx.xxx:2000/wifi" page? I'd be more comfortable having LAN access to my controller, with remote control via VPN, than exposing the port to the world and relying on basic http authentication to protect the portal interface. Maybe I can help with the LAN functionality?

Re: Using Float Switch ports for Dimming

Posted: Thu May 07, 2015 10:02 am
by rimai
We definitely need some help there :)
Downloads from the web:
http://www.reefangel.com/wifi/ra2.js

Re: Using Float Switch ports for Dimming

Posted: Fri Jul 17, 2015 2:47 pm
by Kakorb
I have some ldd drivers I want to hook to my ato port like above. I was wondering about code to slowly dim them up and down for sunrise and set. I new to all this so I don't know much and need help

Re: Using Float Switch ports for Dimming

Posted: Fri Jul 17, 2015 6:48 pm
by cosmith71
Start out with this in setup. Use one port or both to fit your needs (i.ie, whites on the lowATO and blues on the highATO).

Code: Select all

pinMode(lowATOPin,OUTPUT);
pinMode(highATOPin,OUTPUT);
Then something like this goes in the loop to control the lights. Again, use one port or both.

Code: Select all

analogWrite(lowATOPin, (PWMSlope(9,0,20,30,0,100,60,0)*2.55));
analogWrite(highATOPin, (PWMSlope(9,0,20,30,0,100,60,0)*2.55));
Here's what the numbers mean.

Turn on at 9:00 AM (9,0) and off at 8:30 PM (20,30). Start at 0% and end at 100% (0,100). Ramp up and down over 60 minutes (60). The final zero is a fallback value, don't worry about changing it. We multiply by 2.55 because PWMSlope returns a value from 0-100 and we need a value from 0-255 for the ATO pins.

So here, the lights will start at 0% and ramp up to 100% from 09:00 to 10:00, then start ramping down again at 7:30 PM (1930) and turn off (0%) at 8:30 PM (2030).

--Colin

Re: Using Float Switch ports for Dimming

Posted: Sat Jul 18, 2015 6:04 am
by Kakorb
Do it matter where u put it in the setup and loop. And this all I would need to make it work.

Re: Using Float Switch ports for Dimming

Posted: Sat Jul 18, 2015 6:28 am
by cosmith71
Doesn't really matter, except make sure the loop part is before this:

Code: Select all

// This should always be the last line
    ReefAngel.ShowInterface();
This should be it on the software side.

--Colin