Analog Dimming & MOONPHASE ?
Analog Dimming & MOONPHASE ?
I have the RA + Analog and wish to have my moonlights dim or say work with moonphase this is my code could someone check it, it shows PWM just would like to run moonlights on the Actinic dimming side and overheat buzzer off of Daylight side created this code in Wizard mode in Arduino 1.0 here is code:
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>
// Initialize Buzzer variables
byte buzzer=0;
byte overheatflag=0;
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port5Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 800 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port2 );
ReefAngel.Relay.On( Port7 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port3,11,0,19,0 );
ReefAngel.StandardLights( Port4,13,0,17,0 );
ReefAngel.StandardHeater( Port5,782,785 );
ReefAngel.StandardFan( Port6,780,785 );
ReefAngel.StandardLights( Port8,19,0,11,0 );
ReefAngel.PWM.SetActinic( MoonPhase() );
overheatflag = InternalMemory.read( Overheat_Exceed_Flag );
buzzer = overheatflag;
if ( buzzer > 1 ) buzzer = 100;
ReefAngel.PWM.SetDaylight( buzzer );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "CASPAR" );
ReefAngel.ShowInterface();
}
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>
// Initialize Buzzer variables
byte buzzer=0;
byte overheatflag=0;
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port5Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 800 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port2 );
ReefAngel.Relay.On( Port7 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port3,11,0,19,0 );
ReefAngel.StandardLights( Port4,13,0,17,0 );
ReefAngel.StandardHeater( Port5,782,785 );
ReefAngel.StandardFan( Port6,780,785 );
ReefAngel.StandardLights( Port8,19,0,11,0 );
ReefAngel.PWM.SetActinic( MoonPhase() );
overheatflag = InternalMemory.read( Overheat_Exceed_Flag );
buzzer = overheatflag;
if ( buzzer > 1 ) buzzer = 100;
ReefAngel.PWM.SetDaylight( buzzer );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "CASPAR" );
ReefAngel.ShowInterface();
}
Re: Analog Dimming & MOONPHASE ?
Ok moonlight seems to be working plugged into actinic side but can not get buzzer to work off of daylight side for over heat alarm..........Any ideas?
Re: Analog Dimming & MOONPHASE ?
Ok thanks and noticed when using moonphase webpage portal shows actinic at 32% anything lower than that and moonlight goes completly out change dates on pc then change date on RA to match and moonlight seems to increase with phase of moon as should, but when their is say a quarter moon led moonlight goes totally out when actinic side is saying say 30% And buzzer side set up on daylight side shows hardly no voltage output to even power the buzzer at a known high temp.
Re: Analog Dimming & MOONPHASE ?
You just found the first bug on the Wizard
For the buzzer to work, replace this:
With this:
I'll update the Wizard to fix this bug.
The moonlights were designed to dim properly on the PWM signal.
On analog, there is a cut off point that you are experiencing.
It looks like you don't really need the analog signal. If you are interested on exchanging it for a PWM signal, simply PM me.
For the buzzer to work, replace this:
Code: Select all
if ( buzzer > 1 ) buzzer = 100;
Code: Select all
if ( buzzer >= 1 ) buzzer = 100;
The moonlights were designed to dim properly on the PWM signal.
On analog, there is a cut off point that you are experiencing.
It looks like you don't really need the analog signal. If you are interested on exchanging it for a PWM signal, simply PM me.
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
How would I do a moon phase when my two dimming channels are already used for analog meanwell drivers? I don't need fancy just a possibility to have some LEDs that follow the moon cycle. ATO ports on head unit impossible to use? I assume they don't dim. Only switch? Options?
Re: Analog Dimming & MOONPHASE ?
It is possible, but the ATO port is not boosted and will only output 5VDC.
The other option would be a dimming expansion module.
The other option would be a dimming expansion module.
Roberto.
Analog Dimming & MOONPHASE ?
With that said about the ato port, does that mean plugging in an ai nano will never get 100%
Re: Analog Dimming & MOONPHASE ?
AI uses different technology.
Those fixtures use serial communication and they have an independent controller inside the fixture.
That's why you can control all 3 channels with just a pair of wires.
Those fixtures use serial communication and they have an independent controller inside the fixture.
That's why you can control all 3 channels with just a pair of wires.
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
The code needed to make the ATO ports to go 0-5v with moon phase? That would suit me.
Re: Analog Dimming & MOONPHASE ?
You can use the low ATO port.
What you need is this:
That will make the low ATO port to output 0-5V according to the moon cycle.
What you need is this:
Code: Select all
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,(int)MoonPhase()*2.55);
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
Thanks Roberto...now just to order more dimmer connectors. lol AND temp probes...andddd....never ending
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
where should this code be placed? After I placed in the software and uploaded my PWM values are even...and that's not how I have it programmed.
Code: Select all
// Autogenerated file by RAGen (v1.2.2.171), (05/29/2012 16:15)
// RA_052912_1615.ino
//
// This version designed for v0.9.0 or later
/* The following features are enabled for this File:
#define VersionMenu
#define DisplayLEDPWM
#define wifi
#define WDT
#define SIMPLE_MENU
*/
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 860 );
// Ports that are always on
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port4);
ReefAngel.Relay.On(Port7);
ReefAngel.Relay.On(Port8);
////// Place additional initialization code below here
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,(int)MoonPhase()*2.55);
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.StandardLights( Port1,19,0,6,30 );
ReefAngel.StandardHeater( Port4,740,770 );
ReefAngel.StandardLights( Port7,6,0,20,0 );
ReefAngel.StandardLights( Port8,7,0,19,0 );
ReefAngel.Wavemaker1(Port5);
ReefAngel.Wavemaker2(Port6);
ReefAngel.PWM.SetDaylight( PWMParabola(7,5,19,0,0,85,0) );
ReefAngel.PWM.SetActinic( PWMParabola(6,5,21,0,0,85,0) );
////// Place your custom code below here
////// Place your custom code above here
// This sends all the data to the portal
// Do not add any custom code that changes any relay status after this line
// The only code after this line should be the ShowInterface function
ReefAngel.Portal("DrewPalmer04", "********");
// This should always be the last line
ReefAngel.ShowInterface();
}
Last edited by DrewPalmer04 on Wed May 30, 2012 11:56 am, edited 1 time in total.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
Better?
Code: Select all
// Autogenerated file by RAGen (v1.2.2.171), (05/29/2012 16:15)
// RA_052912_1615.ino
//
// This version designed for v0.9.0 or later
/* The following features are enabled for this File:
#define VersionMenu
#define DisplayLEDPWM
#define wifi
#define WDT
#define SIMPLE_MENU
*/
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 860 );
// Ports that are always on
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port4);
ReefAngel.Relay.On(Port7);
ReefAngel.Relay.On(Port8);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.StandardLights( Port1,19,0,6,30 );
ReefAngel.StandardHeater( Port4,740,770 );
ReefAngel.StandardLights( Port7,6,0,20,0 );
ReefAngel.StandardLights( Port8,7,0,19,0 );
ReefAngel.Wavemaker1(Port5);
ReefAngel.Wavemaker2(Port6);
ReefAngel.PWM.SetDaylight( PWMParabola(7,5,19,0,0,85,0) );
ReefAngel.PWM.SetActinic( PWMParabola(6,5,21,0,0,85,0) );
////// Place your custom code below here
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,(int)MoonPhase()*2.55);
////// Place your custom code above here
// This sends all the data to the portal
// Do not add any custom code that changes any relay status after this line
// The only code after this line should be the ShowInterface function
ReefAngel.Portal("DrewPalmer04", "********");
// This should always be the last line
ReefAngel.ShowInterface();
}
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
THANKS!
Will I need to deal with polarity? Which is (+)?
Will I need to deal with polarity? Which is (+)?
Re: Analog Dimming & MOONPHASE ?
Yeah, you need to watch polarity.
They have the same polarity as the standard PWM channels.
They have the same polarity as the standard PWM channels.
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
got it thanks!
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
I've got the moonlights wired in. I'm experiencing a pulse every 5-8 seconds? It's a millisecond probably, but this is a weird thing that is happening?
Ideas?
Ideas?
Re: Analog Dimming & MOONPHASE ?
Are you using StandardATO? or SingleATO that uses the low port?
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
Please clarify?
I have a string of LEDs on the low port with proper polarity. I single connector going ONLY to the low ATO port.
I have a string of LEDs on the low port with proper polarity. I single connector going ONLY to the low ATO port.
Re: Analog Dimming & MOONPHASE ?
I meant if in your code you are using any ATO function.
Can you paste the code?
Can you paste the code?
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
I've not modified anything related to ATO. I would assume its standardATO
Re: Analog Dimming & MOONPHASE ?
That's probably the reason.
The StandardATO is querying that port to check for the float switch and interfering with the dimming.
The StandardATO is querying that port to check for the float switch and interfering with the dimming.
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
Makes perfect sense. How do I change that code? Also how do I view my existing code without saving my custom code and uploading the total code again?
Re: Analog Dimming & MOONPHASE ?
There is no way to reverse back what you have inside the RA already.
The best practice is to save the code with a filename that is easy for you to remember and open the file when you need to make changes.
The best practice is to save the code with a filename that is easy for you to remember and open the file when you need to make changes.
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
Ok that's what I've been doing. That's good. So how do I go from standard to singleATO?
Re: Analog Dimming & MOONPHASE ?
Instead of using StandardATO, you need to use SingleATOHigh
Roberto.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Analog Dimming & MOONPHASE ?
Thanks. I'm sure I'll figure it out