My Neptune Apex web interface compatible DIY reef controller

I am using a gutted 12v 1a power supply inside the chauvet to power the arduino and the PWM circuit and to pin 5 of the DB9 to power the second chauvet.

No trial and error, I opened up the chauvet and test using a multitester continuity test to figure out the DB9 pin connections. You should do the same.

https://github.com/d0ughb0y/Chauvet16/blob/master/Outlets.ino
lines 178-207

actually, first 8 uses PORTA and next 8 uses PORTC, so in your case, you would use the same code as PORTC on PORTA.
like this

Code:
void _outletOn(uint8_t p){
  if (p<8) {
    if (!(PORTA & _BV(p))) {//is off
      PORTA |= _BV(p);  
      _outlogentry(p,true);
    }
  } else if (p==Feeder) {
    feed();
  } else {
    if (!(PORTC & _BV(p-8))) {
      PORTC |= _BV(p-8);
      _outlogentry(p,true);
    }
  }
}

make sure to do the corresponding change in _outletOff
 
Last edited:
having a problem compiling get the same as Rafael, now2 was declared and i followed the direction on github. Added the lines to Time. Do I delete anything
 
having a problem compiling get the same as Rafael, now2 was declared and i followed the direction on github. Added the lines to Time. Do I delete anything

do you only have one copy of Time library? It should be in libraries folder in your sketch folder, not in the libraries folder of Arduino program. You only add exactly as described in the readme, nothing to delete.

you need to edit BOTH Time.h and Time.cpp
 
Last edited:
It would most likely be simpler if I used two DB9 outlets instead of trying to link the two units together using the integrated connectors.

So when I initialize my port A the value should be "0" not "0xFF"?

In the utils.ino file line 179 should I remove the ~from "~PortA" as well?
 
It would most likely be simpler if I used two DB9 outlets instead of trying to link the two units together using the integrated connectors.

So when I initialize my port A the value should be "0" not "0xFF"?

In the utils.ino file line 179 should I remove the ~from "~PortA" as well?

You must use two DB9, one going to each chauvet. You cannot daisy chain the chauvet because the DB9 connection is straight through.

Yes in the initialization (initOutlets), you want it 0. Basically driving port pin low will turn off the outlet, driving it high will turn it on. So yes in Utils.ino routine that prints the status of the ports, it will be a direct read (no need to invert) to show if the port is on or off. and same for isOutletOn function.
 
I tried to do what the instruction said and still come up with the now2 is not declared. I'm not a programmer. I put the folders in the libraries folder in the sketch and mod to instructions and still come up with the error. I notice in the time library there is already a
DS1307RTC in the folder and also you ask to download another one. Sorry for not understanding
 
I tried to do what the instruction said and still come up with the now2 is not declared. I'm not a programmer. I put the folders in the libraries folder in the sketch and mod to instructions and still come up with the error. I notice in the time library there is already a
DS1307RTC in the folder and also you ask to download another one. Sorry for not understanding

you are right, the ds1370rtc already comes with the time download. I will update the readme.

just use this version of time library that is already edited
 

Attachments

  • Time.zip
    19.3 KB · Views: 1
Are you using windows? Arduino 1.05?
The only thing I can think of is there must be another copy of Time library that arduino is picking up.

Two things you can try.
close arduino, open and edit Time.h and type like a space or add some comments. Then save and start Arduino. This will force arduino to rebuild the library using the new file.

Last resort is to move the Time library folder from your arduino sketch folder into the main arduino program libraries folder.

If it still does not work, you need to do a full file search for Time.h and Time.cpp to find out where that other copy is.
 
awesome! I have most of these parts and am just about ready to dive into this fun! Thanks for the great wrire up. I'll be following.
 
Very cool! Been thinking about making an arduino controller for a while; may have to jump in!

How did you encase the DS18B20 temp sensor for underwater use, or did you get the ready made one like this?
 
Yes that kind, except I got it from eBay. Make sure you get the 2m length one on eBay (costs under $3), most just sell the 1m long cable.
 
Hi! Great project!!! I also have most of the parts including the SR8, so I already started playing with your code.

I also got the "now2 not declared" error and was able to solve it. For some reason in my PC, the Arduino 1.5.2 IDE was looking for libraries in "My Documents\Arduino\libraries". I renamed this folder and now the IDE is using only the libraries from "C:\Program Files\arduino\libraries". I hope this will help wgraham.

Now the error I'm getting when compiling is ""TCCR4A was not declared in this scope". Any clues?
 
Now the error I'm getting when compiling is ""TCCR4A was not declared in this scope". Any clues?

you get that error if the board selected is not mega2560.
if you are still getting that error with mega2560 selected, then I suggest to go back to version 1.0.5.

thanks for sharing the fix to the Time library issue.

the instruction is to
"Download and copy each of the libraries into your Arduino sketchbook folder in a folder named libraries."


The default sketch folder is
My Documents\Arduino
You can change that location in preferences.

Therefore, when you download the libraries, you copy it into a folder named libraries in the Arduino sketchbook folder, so the files look like

My Documents\Arduino\libraries\Time
My Documents\Arduino\libraries\DS1307RTC
My Documents\Arduino\libraries\Flash
My Documents\Arduino\libraries\LiquidCrystal
My Documents\Arduino\libraries\OneWire
My Documents\Arduino\libraries\SdFat

You can always put all these libraries folders into the libraries folder where the arduino program is installed, just as in your fix. But the recommended way of using libraries that does not come with Arduino install is to place it in a libraries folder in the sketchbook folder.

The Chauvet16 program files are in a folder named Chauvet16 in the Sketchbook folder

My Documents\Arduino\Chauvet16\*
 
YES!!! The "TCCR4A..." error was cleared when the mega2560 was selected. I then carefully check the libraries, selected the correct folder in the "Preference" IDE menu and everything compiled ok.

Now the fun part, hooking up things and loading the sketch to the mega2560. I will let you know the results later.

Thanks for your quick reply!
 
what is Sketchbook folder and how do you put libraries in it, sorry for the stupid question just not a programmer
 
what is Sketchbook folder and how do you put libraries in it, sorry for the stupid question just not a programmer

When you start Arduino IDE program, go to File menu and select Preferences. The first item in the dialog is your Sketchbook location.

You put all the library folders inside a folder named libraries inside the Sketchbook folder. The Chauvet16 folder will be at the same level as the libraries folder inside the Sketchbook folder.

If you change the location in the preferences or you just copied the files to the right location, you will need to exit and restart the arduino program.
 
Back
Top