Need custom code for custom expansion

User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Need custom code for custom expansion

Post by DrewPalmer04 »

Let's see some pics of what you've accomplished AuqaO
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Re: Need custom code for custom expansion

Post by AquaO »

Yes I will post pictures later I need to fix some detail.

Thank you for your interest.

Eric
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Need custom code for custom expansion

Post by lnevo »

Yeah, very interested to see what you did with the dosing pumps... what pumps are you using.

I'm currently investigating how to dose, and not thrilled with the idea of wasting outlets (want to do triple channel) and having to waste all those relay ports. I like the standalone controllers like Bubble Magus, but sooo expensive. Considering the chinese knock-off Marine Magic which looks good, but I feel like it's such a waste having the RA that could do all that...

The RA dosing pump should connect to the PWM ports and have a PWM driver. If it was controllable like that or directlyw ithout the dimming module, I'd be snatching it up in a heartbeat. So very curious on the details here...

Edit: From the store-front, the previosly out-of-stock dosing pump looks like it's been replaced.. any details? It looks like the slave pump from another dosing pump i've seen...
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Need custom code for custom expansion

Post by DrewPalmer04 »

I have a triple magic dosing set up and to be honest it sucks. Every doser gives out different amounts. So you have to do some serious math for two part dosing. And they like to wear down and dose less and less and then you have to adjust the speed settings/recalculate again and the cycle repeats. Just FYI
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Need custom code for custom expansion

Post by AquaO »

Because a picture is worth a thousand words ;)

Do not forget is in progress.

Here is the dosing pump I use
(purchased on eBay)

Image
Image

Here is my DiY case

Image
Image
Image

And Video
http://youtu.be/oV4HXv71SxQ
Last edited by AquaO on Wed Oct 30, 2013 4:30 pm, edited 8 times in total.
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need custom code for custom expansion

Post by rimai »

no pics :(
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Need custom code for custom expansion

Post by DrewPalmer04 »

Where'd you get the bare doser motor? 12v I'm assuming?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Re: Need custom code for custom expansion

Post by AquaO »

I corrected the link of the pics, sorry

I bought the motor on ebay, I believe that it is the same as Profilux.
Yes they are 12v

I was also working to change the speed of the motor manually, for avoided programming all the time.
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Need custom code for custom expansion

Post by DrewPalmer04 »

So jealous...I need an Uno now...:(

Good DIY!!!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Need custom code for custom expansion

Post by lnevo »

AquaO,

That is awesome! I just bought a few of those pumps, actually I bought the $30 ones that are already in an encosure with a potentiometer. I would love to convert it at some point to do what you did and control them individually with PWM instead of relays on my outlet strip...

Do you think you could do a more comprehensive post on what you did to setup the UNO? Do you know what would be needed if I wanted to just integrate with the RA Dimming module?

Thanks in advance and again awesome job!

Edit: Wow, the UNO is only $35... I'd gladly purchase one of these if I knew what to do with it!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need custom code for custom expansion

Post by rimai »

I'm also interested on seeing how you are powering the motors. Did you use a mosfet transistor?
Roberto.
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Need custom code for custom expansion

Post by AquaO »

rimai wrote:I'm also interested on seeing how you are powering the motors. Did you use a mosfet transistor?
No I use a NPN transistor TIP-122

Here is the wiring I did

Image

Image

Image

Image

Image

Thank you very much for your comment
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Need custom code for custom expansion

Post by AquaO »

For control motor speed with PWM you need:

1x NPN transistor TIP-122
1x Capacitor 1uf
1x Diode
1x Resistor 1k ohm

And the diagram

Image

Image

Image

Image

Image

For make your own USB cable for communication RA/Uno
You need:

1x Regular USB cable and strip it
2x Resistor 1.5k ohm

And the diagram

Image
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Need custom code for custom expansion

Post by AquaO »

Hi guys, I did some experiment for you. And the good news, you can use the dimming ports of Reef Angel to control the motor speed. You do not need an Arduino Uno. The Reef Angel and pwm expansion module is ready for this use.

Here the diagram

Image

Image

Image

Image

Image

And the video
http://youtu.be/Zo3RXFuEGlI

I think if would be great for an update of RA dosing pump ;)
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Need custom code for custom expansion

Post by lnevo »

There you go roberto! Wire that into the circuit for of the ra dosing pump add a switch for controlled or independent mode and done deal!!!
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Re: Need custom code for custom expansion

Post by AquaO »

I need your help, I'm not very good with the RA code.

I would like to know if it's possible to add to the menu PWM port and change the name in the menu?
Ex: instead of Ch 0, Ch 1, Ch 2 and Ch 3
I would like Alk, Ca, Mg and Carb and to modify the duration and %
Ex: Alk 15sec at 100% or Ca 20sec at 60%

Thank you in advance
Eric

This is my RA code

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
    ReefAngel.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit;
    // 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 );
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Port7 );

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

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

void loop()
{
    ReefAngel.DosingPumpRepeat( Port8,0,60,60 );
    ReefAngel.PWM.SetChannel( 0, now()%3600<15?80:0);
    ReefAngel.PWM.SetChannel( 1, now()%3600<25?50:0);
    ReefAngel.PWM.SetChannel( 2, now()%3600<35?95:0);
    ReefAngel.PWM.SetChannel( 3, now()%3600<10?100:0);

    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Dimming Expansion
    x = 15;
    y = 2;
    for ( int a=0;a<6;a++ )
    {
      if ( a>2 ) x = 75;
      if ( a==3 ) y = 2;
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
      ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
      y += 10;
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 43, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 43, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 84, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()
{
}
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need custom code for custom expansion

Post by rimai »

I'm assuming you are talking about changing the main screen, right?
http://forum.reefangel.com/viewtopic.php?f=14&t=109
Roberto.
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Need custom code for custom expansion

Post by AquaO »

Yeah and change the value of PWM expansion, on ch0, ch1, ch2, ch3 directly on PDE.
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
AquaO
Posts: 61
Joined: Sun May 27, 2012 11:22 am

Need custom code for custom expansion

Post by AquaO »

rimai wrote:I'm assuming you are talking about changing the main screen, right?
http://forum.reefangel.com/viewtopic.php?f=14&t=109
thank you I'll try to make my own main screen and menu.
Image

Osaka 40g with 55g sump
Radion, 2X Tunze 6045, Swc-160 mini cone
Post Reply