WP40 on the ATO PWM & Custom code

Do you have a question on how to do something.
Ask in here.
Post Reply
kimacom
Posts: 33
Joined: Fri Jul 27, 2012 9:52 am

Re: WP40 on the ATO PWM & Custom code

Post by kimacom »

this is awesome thread,
that helps me a lot to understand and use it.
thanks much guys
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: WP40 on the ATO PWM & Custom code

Post by ganjero »

is there a way to check if this is working? if the speed is ramping up and down? will the portal ato low level change colors when running this?

Also,
How would I change this code for a pump connected to the ATO port?

Code: Select all

static time_t StartFeeding=0;
              if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
                ReefAngel.PWM.SetActinic(100);
              else   
                ReefAngel.PWM.SetActinic(45);
Thanks
Image
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: WP40 on the ATO PWM & Custom code

Post by ganjero »

any input on the above?

Thanks
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

The code you posted is for feeding mode.
Not sure what you are asking.
The way to test is load into the controller and check your pump.
Roberto.
Amos Poh
Posts: 107
Joined: Sun Jul 22, 2012 4:51 am
Location: Singapore

Re: WP40 on the ATO PWM & Custom code

Post by Amos Poh »

( PWMParabola(3,0,2,59,30,75,0), PWMParabola(3,0,2,59,12,25,0),true) );

Hi can anyone explain what the number means so i can alter to my preference?
Thanks :)
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: WP40 on the ATO PWM & Custom code

Post by ganjero »

rimai wrote:The code you posted is for feeding mode.
Not sure what you are asking.
The way to test is load into the controller and check your pump.
Roberto,

Sorry if I was not clear. This code controls a pump that run a 45% all the time, and at 100% for one hour starting 30min after triggering feed mode.

My question is how do I modify this code to do this for a pump controlled through the ATO port instead of the Actinic port as shown in the code.

Code: Select all

static time_t StartFeeding=0;
              if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
                ReefAngel.PWM.SetActinic(100);
              else   
                ReefAngel.PWM.SetActinic(45);
Thank you,
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

It's in the OP.
Use something like this to set the ATO port to what you want:

Code: Select all

pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,45*2.55);
The example above sets it to 45%
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

Amos Poh wrote:( PWMParabola(3,0,2,59,30,75,0), PWMParabola(3,0,2,59,12,25,0),true) );

Hi can anyone explain what the number means so i can alter to my preference?
Thanks :)
Check here:
http://www.easte.net/RA/html/_globals_8 ... de5873f8d6
Roberto.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: WP40 on the ATO PWM & Custom code

Post by ganjero »

rimai wrote:It's in the OP.
Use something like this to set the ATO port to what you want:

Code: Select all

pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,45*2.55);
The example above sets it to 45%
Roberto,

Does this

Code: Select all

pinMode(lowATOPin,OUTPUT);
need to be written everetime I modify the speed? or can I write once somewhere in the code and then do different speeds with the second line? Like this
The xxxxxxx are other lines in the code

Code: Select all

xxxxxxxx
         xxxxxxx
         pinMode(lowATOPin,OUTPUT)
         xxxxxxxx
         xxxxxxxx
 if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
               analogWrite(lowATOPin,100*2.55);
              else
                analogWrite(lowATOPin,75*2.55);
Thank you again
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: WP40 on the ATO PWM & Custom code

Post by lnevo »

I'm pretty sure it only needs to be done once.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

I think you can do once, but just in case keep it everytime you use digitalWrite, just because the ATO port is setup as input and not as output.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: WP40 on the ATO PWM & Custom code

Post by lnevo »

Roberto wonder if that may be the problem for the person who had issue in feeding/wc mode with the lowAto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

Humm... not sure
Roberto.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: WP40 on the ATO PWM & Custom code

Post by ganjero »

Well I tried this

Code: Select all

if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
               pinMode(lowATOPin,OUTPUT)
               analogWrite(lowATOPin,100*2.55);
              else
                pinMode(lowATOPin,OUTPUT)
                analogWrite(lowATOPin,75*2.55);
and got an error on "else" - it says "there is not an if" before

so I just changed it to this, and it's working fine

Code: Select all

   ....
            ReefAngel.StandardLights( Port1,14,0,19,0 );
            ReefAngel.StandardLights( Port2,15,0,20,0 );
            ReefAngel.StandardLights( Port3,19,55,22,0 );
            ReefAngel.StandardLights( Port4,14,0,20,15 );
            ReefAngel.StandardHeater( Port5,780,785 );
            ReefAngel.StandardFan( Port6,780,800 );
            ReefAngel.StandardLights( Box1_Port5,22,0,16,0 );
            ReefAngel.DCPump.UseMemory = true;
            pinMode(lowATOPin,OUTPUT);
            ....
            static time_t StartFeeding=0;
              if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
               analogWrite(lowATOPin,100*2.55);
              else
                analogWrite(lowATOPin,60*2.55);
             ....
            
Image
89delta
Posts: 163
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Re: WP40 on the ATO PWM & Custom code

Post by 89delta »

What's the difference between the regular cables and the ATO cable for jebao?
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: WP40 on the ATO PWM & Custom code

Post by cosmith71 »

You have to remove a resistor (surface mount) on the cable for it to work properly with the 5V ATO signal. There's a thread around here somewhere that points it out.

--Colin
89delta
Posts: 163
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Re: WP40 on the ATO PWM & Custom code

Post by 89delta »

Thanks, found it.
Post Reply