Using Float Switch ports for Dimming

Basic / Standard Reef Angel hardware
Post Reply
dedvalson
Posts: 140
Joined: Tue Oct 04, 2011 5:49 am

Using Float Switch ports for Dimming

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using Float Switch ports for Dimming

Post by rimai »

Yes, but it is not going to be analog. It will be 0-5PWM signals.
Roberto.
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Using Float Switch ports for Dimming

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using Float Switch ports for Dimming

Post 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
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Using Float Switch ports for Dimming

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using Float Switch ports for Dimming

Post 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.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Using Float Switch ports for Dimming

Post 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.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using Float Switch ports for Dimming

Post by rimai »

I can't remember if you can set custom variables through the UApp :(
I know Curt just added that to the Android.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Using Float Switch ports for Dimming

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Using Float Switch ports for Dimming

Post by rimai »

We definitely need some help there :)
Downloads from the web:
http://www.reefangel.com/wifi/ra2.js
Roberto.
Kakorb
Posts: 19
Joined: Fri Jul 17, 2015 2:42 pm

Re: Using Float Switch ports for Dimming

Post 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
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Using Float Switch ports for Dimming

Post 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
Kakorb
Posts: 19
Joined: Fri Jul 17, 2015 2:42 pm

Re: Using Float Switch ports for Dimming

Post by Kakorb »

Do it matter where u put it in the setup and loop. And this all I would need to make it work.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Using Float Switch ports for Dimming

Post 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
Post Reply