PWM Help!

Requests for new functions or software apps

Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm
PostPosted: Sun Dec 16, 2012 12:46 am
Hi,

I recently got some Rapid LEDs that I am constructing. I got the PWM drivers, and have it all put together. I am able to power my fixtures if I use a couple AA batteries as my "dimming" signal.

However, I am unable to get the controller to light them up. I believe that I am not doing something correctly with the PWM ports.

Here is my simple code I have on the reef angel:

Code: Select all
#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 <PH.h>
#include <WaterLevel.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
    // Ports toggled in Feeding Mode
    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( 869 );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );

    ////// Place additional initialization code below here
   

    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.PWM.SetDaylight( PWMSlope(0,0,0,0,100,100,60,100) );
    ReefAngel.PWM.SetActinic( PWMSlope(0,0,0,0,100,100,60,100) );
    ////// Place your custom code below here
   

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.AddWifi();
    ReefAngel.ShowInterface();
}



The menu SHOWS my PWM for both channels being at 100.... however, neither channel is actually delivering any signal. HELP!
Last edited by Zechenia on Sun Dec 16, 2012 2:55 pm, edited 1 time in total.
PostPosted: Sun Dec 16, 2012 5:38 am
It looks like you may not be setting the PWM Slope function correctly. The start and finish times look like they are set to 0.

Here is the list settings list, check to see that you have set the right parameter for what you want to happen.


startHour - Hour of the start the slope/ramp
startMinute - Minute of the start the slope/ramp
endHour - Hour of the end of the ramp/slope (when end value is reached)
endMinute - Minute of the end ramp/slope
startPWM - Beginning PWM value
endPWM - Ending PWM value
Duration - Amount of time (in minutes) it takes to go from the startPWM to endPWM (and vice versa). If the duration is 30 minutes. Then if it starts at 8a, from 8 - 8:30a it will go from startPWM to endPWM. If it ends at 5pm, from 4:30p - 5p it will go from endPWM to startPWM.
oldValue - Should be the existing/current PWM value (ReefAngel.PWM.GetActinicValue() or GetDaylightValue())

Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm
PostPosted: Sun Dec 16, 2012 9:27 am
I also tried with ending time of 23:59 with same result.

Posts: 12057
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Dec 16, 2012 10:32 am
Just for testing purposes, try this:
Code: Select all
    ReefAngel.PWM.SetDaylight( 50);
    ReefAngel.PWM.SetActinic( 50);

This should put it to 50%
Roberto.

Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm
PostPosted: Sun Dec 16, 2012 11:01 am
Ok, I will give that a quick try.

Also, I tried:

Code: Select all
    ReefAngel.PWM.SetDaylight(100);
    ReefAngel.PWM.SetActinic(100);


Originally, but thought I was doing something wrong when it failed, so I used the wizard which didn't give a static option.

Additionally, I believe I have the most recent libraries installed.

Posts: 12057
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Dec 16, 2012 11:07 am
That should have worked too.
Make sure you are using the same polarity shown in the user manual.
Do you have a multi meter to test the output voltage?
Also, just to be sure, you have a gen2 relay box and you are using the original RA svga cable, right?
Roberto.

Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm
PostPosted: Sun Dec 16, 2012 11:09 am
Original Cable is being used (NOTE: I bought this unit used. So I am using the original cable they provided - cable is labeled "30v vw-1 low voltage computer cable jamer").


I have tried using either polarity (started with one in the manual).

Not sure which version of the relay box I have.

Doing it to 50% didn't change anything :/
Last edited by Zechenia on Sun Dec 16, 2012 11:53 am, edited 2 times in total.

Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm
PostPosted: Sun Dec 16, 2012 11:48 am
Just completely removed the controller from my aquarium (was needing to do this anyway as I am moving it to the 90 gallon tank I am building that should be started next week)

Reconnected the relay box (and nothing else). Still not getting any Voltage out of the PWM ports.

Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm
PostPosted: Sun Dec 16, 2012 12:09 pm
Another addition. If you remember a few months back I had to replace all the guts out of the head unit of the Reef Angel. Just in case that could have anything to do with it.

Posts: 12057
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun Dec 16, 2012 2:42 pm
That shouldn't affect the dimming signal.
Can you send me a photo of your box?
Roberto.
Next

Return to Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron