My Neptune Apex web interface compatible DIY reef controller

I'm still working on the password change code. It is definitely doable on javascript code to encode/decode base64. I'm still deciding what is the best design.

option 1:
after a program upload and ROM reset, on first web connection, it will prompt to create a login.
option 2:
make default login admin/password. Then in setup page add a page to change login.

since the email alert also requires base64 encoded string, I figured if I go with option 2, then I can make the email setting configurable from the web page as well. So I am leaning towards option 2.

in either case above, the password change will only be allowed if the browser is connected from the local network (internal ip address). So you cannot make this change from the internet.

I also just tested my lumia 5.1 and noticed the violets on channel 5 does not glow like the other leds. I contacted the seller, and the seller claims it is normal as it is in UV range (I thought UV is below 400nm, the violet led is supposed to be 410nm) and it will have a glow of only 5lumens per led, vs 180 lumens for the other leds. I posted a question about this in another thread. Anyway, it probably does not matter, as long as I have my led hardware ready so I can start coding the led code again.

I will simplify the LED code design further. The code I lost, I calculated sunrise/sunset based on latitude and longitude and day of year. I am thinking that is not really necessary hence can be simplified. I will use June 21 and Dec 21 as summer and winter solstice day (actual is +/- 1 day of this), and all I need is a longest and shortest day length (say default to 14 and 10 but configurable) and just calculate the sunrise/sunset daily. I think I can also estimate/calculate solar noon, which is at 12noon on equinox and is shifted the rest of the year. The main objective is to have varying day length throughout the year without having to setup/configure too many parameters. I will initially code using pca9685 and then code using arduino pro mini.

+1 for Option 2.

The UV LEDs do look dimmer than the rest. There are two reasons for that. First is that the LED is putting out a lower lumen/watt output as mentioned. Second is that even though true UV doesn't start until 400nm the human eye starts to lose the ability to see the color at ~418nm. 410nm is well below that and so our eye is not able to perceive the actual brightness of the light being produced.

In my experience those UV LEDs have done almost nothing for the corals anyway. I'm glad they removed them on the lumia 5.2.

Will there also be simple Ramp up, stay on, and ramp down options for the LEDs as well? The changing time period sounds cool but for my needs just having a start time, a ramp up time, an on max percent, a ramp down time and an off time is more than enough. The Max percent would allow easy acclimation of new corals and would make it easy change only a couple of values with each step in acclimation to get back to the normal output.
 
I'm still working on the password change code. It is definitely doable on javascript code to encode/decode base64. I'm still deciding what is the best design.

option 1:
after a program upload and ROM reset, on first web connection, it will prompt to create a login.
option 2:
make default login admin/password. Then in setup page add a page to change login.

since the email alert also requires base64 encoded string, I figured if I go with option 2, then I can make the email setting configurable from the web page as well. So I am leaning towards option 2.

in either case above, the password change will only be allowed if the browser is connected from the local network (internal ip address). So you cannot make this change from the internet.

I also just tested my lumia 5.1 and noticed the violets on channel 5 does not glow like the other leds. I contacted the seller, and the seller claims it is normal as it is in UV range (I thought UV is below 400nm, the violet led is supposed to be 410nm) and it will have a glow of only 5lumens per led, vs 180 lumens for the other leds. I posted a question about this in another thread. Anyway, it probably does not matter, as long as I have my led hardware ready so I can start coding the led code again.

I will simplify the LED code design further. The code I lost, I calculated sunrise/sunset based on latitude and longitude and day of year. I am thinking that is not really necessary hence can be simplified. I will use June 21 and Dec 21 as summer and winter solstice day (actual is +/- 1 day of this), and all I need is a longest and shortest day length (say default to 14 and 10 but configurable) and just calculate the sunrise/sunset daily. I think I can also estimate/calculate solar noon, which is at 12noon on equinox and is shifted the rest of the year. The main objective is to have varying day length throughout the year without having to setup/configure too many parameters. I will initially code using pca9685 and then code using arduino pro mini.

D0ughb0y,

Unrelated to this, does a DALI control project interest you?
 
+1 for Option 2.

The UV LEDs do look dimmer than the rest. There are two reasons for that. First is that the LED is putting out a lower lumen/watt output as mentioned. Second is that even though true UV doesn't start until 400nm the human eye starts to lose the ability to see the color at ~418nm. 410nm is well below that and so our eye is not able to perceive the actual brightness of the light being produced.

In my experience those UV LEDs have done almost nothing for the corals anyway. I'm glad they removed them on the lumia 5.2.

Will there also be simple Ramp up, stay on, and ramp down options for the LEDs as well? The changing time period sounds cool but for my needs just having a start time, a ramp up time, an on max percent, a ramp down time and an off time is more than enough. The Max percent would allow easy acclimation of new corals and would make it easy change only a couple of values with each step in acclimation to get back to the normal output.


thanks for the explanation.

when 5.1 came out, it was the best thing since sliced bread, turns out it is not when 5.2 came out. anyway, the 5.1 will do for now, I can always update to 5.2 when the 5.1 burns out.

For this simple case you described, you just specify the same longest and shortest day, say 14 hours. Then your light will be on the same amount of time every day. The solar noon you specify will offset the midpoint to another time other than the actual 12noon, say you want 14 hours but on at 7am and off at 9pm, the solar noon is +2 from actual noon, which is 2pm (midpoint between sunrise and sunset). Then another parameter is noon length. In theory, actual noon length is 0, so sun ramps up from sunrise to noon then immediately ramps down to sunset. You can specify the time you want the light to be at max%, say for 4 hours, then the program will ramp up from sunrise to noon-2, and ramp down from noon+2 to sunset. And final parameter is max%. I think this setup is generic enough to accommodate most requirement.
 
Ok. Probably a stupid question. Right now all i have connected to the Arduino is the Ethernet shield and the LCD screen. I have compiled and uploaded the sketch to the board. I have my SD card inserted as well. I know you have said multiple times that you need the PH and temp sensors connected in order for it to work or to comment them, but when I comment those out I get compile errors.

Right now I basically want to see something to make sure I am heading in the right direction. When i power on the board the LCD displays squares. Ok, possibly no output due to sensors not being connected or commented. But I am getting no log either on the SD. Shouldnt this atleast be STARTING a log file so I can see where it errors?
 
you should still see the LCD initialize and display LCD init.
in the latest config.h, there are two settings for LCD. These are the two most common settings for LCD.
If Setting 1 does not work, comment out that whole block and uncomment the block for setting 2.
if that still does not work, you need to run the LCD library test program until you find the settings that will make your LCD work, and then use those settings in the config.h.
 
I am thinking of changing the design for the led controller build. I am thinking it will probably be better to build it stand alone and network enabled (wifi).

atmega328 won't cut it for this application, as there are only 6 pwm, and the meanwell requires 1khz but the fan requires 25khz pwm frequency.

so I am getting a teensy 3.1. Using this, I can build one with 8 channel 16 bit pwm for led control, and two 23.4 khz pwm for fan control. I will try to interface it with a wifi module and run a simple webserver. The teensy 3.1 also has built in rtc but you need to add a crystal and a coin battery to use it.

the chauvet can then communicate with the led controller via network connection (no more i2c). I can also write a separate app for use on the led controller only for people who only need the led controller.

the number of wires from the led controller to the led fixture will be
2 wires for +v -v for each led channel x8
4 wires for each pwm fan x2
3 wires for the temp sensor x1

maximum wll be 27 wires, but since the GND for the fan and temp sensor can be combined, that will be 25 wires. 25 conductor cables are widely available so I think this setup is perfect. if you build the controller right into the fixture, then the only wires out of the fixture are the power (ac or dc) lines.

(I got sidetracked planning this so I have no progress yet on the password change code).
 
Last edited:
That worked. now have LCD display. displays SD card error as well as a few more, but im getting somewhere now. Thank you very much.
 
I am thinking of changing the design for the led controller build. I am thinking it will probably be better to build it stand alone and network enabled (wifi).

atmega328 won't cut it for this application, as there are only 6 pwm, and the meanwell requires 1khz but the fan requires 25khz pwm frequency.

so I am getting a teensy 3.1. Using this, I can build one with 8 channel 16 bit pwm for led control, and two 23.4 khz pwm for fan control. I will try to interface it with a wifi module and run a simple webserver. The teensy 3.1 also has built in rtc but you need to add a crystal and a coin battery to use it.

the chauvet can then communicate with the led controller via network connection (no more i2c). I can also write a separate app for use on the led controller only for people who only need the led controller.

the number of wires from the led controller to the led fixture will be
2 wires for +v -v for each led channel x8
4 wires for each pwm fan x2
3 wires for the temp sensor x1

maximum wll be 27 wires, but since the GND for the fan and temp sensor can be combined, that will be 25 wires. 25 conductor cables are widely available so I think this setup is perfect. if you build the controller right into the fixture, then the only wires out of the fixture are the power (ac or dc) lines.

(I got sidetracked planning this so I have no progress yet on the password change code).
NOOOOOOOOOOO
now i really need to figuar out how to code c++. i need simple 255 steps pwm, 1 hr ramp up, noon setting, 1hr ramp down. i have a current code that does that im just not sure how i would incorporate that into your code. Any thoughts?
 
I am thinking of changing the design for the led controller build. I am thinking it will probably be better to build it stand alone and network enabled (wifi).

atmega328 won't cut it for this application, as there are only 6 pwm, and the meanwell requires 1khz but the fan requires 25khz pwm frequency.

so I am getting a teensy 3.1. Using this, I can build one with 8 channel 16 bit pwm for led control, and two 23.4 khz pwm for fan control. I will try to interface it with a wifi module and run a simple webserver. The teensy 3.1 also has built in rtc but you need to add a crystal and a coin battery to use it.

the chauvet can then communicate with the led controller via network connection (no more i2c). I can also write a separate app for use on the led controller only for people who only need the led controller.

the number of wires from the led controller to the led fixture will be
2 wires for +v -v for each led channel x8
4 wires for each pwm fan x2
3 wires for the temp sensor x1

maximum wll be 27 wires, but since the GND for the fan and temp sensor can be combined, that will be 25 wires. 25 conductor cables are widely available so I think this setup is perfect. if you build the controller right into the fixture, then the only wires out of the fixture are the power (ac or dc) lines.

(I got sidetracked planning this so I have no progress yet on the password change code).

Why 8 Channel led? Lumia 5.1 is only 5 channels and even Radion is only 6 channels.

I also don't find the need for 16 bit PWM for LED control. 256 steps is plenty and personally on/off fan control is enough. Are you sure another controller is the way you want to go? Krazie :jester:
 
In the previous plan, I have to make two versions, one for atmega328, and another using PCA9685 (which is 16 channels).
16bit is just the resolution the teensy board supports. The resolution used should not matter since you specify value by percent (or even using a value between 0 and 255). Likewise, 8 channels because that is what the board supports. You do not need to use all 8 channels. Some applications use 5 channels for Lumia and one or more for moon lights, etc., so I think 8 is a good number.

that's the plan for now, I'll see how it goes. it may still change.
 
Going through connecting 1 piece at a time as you suggested awhile back. Hooking my first sensor up, which is temp. Installed a 3.3kΩ resistor. Getting temp readings of 185, which in reading leads one to think loose wiring. All wiring good. Tried several different temp sensors as well as several different resistors. This resistor DOES NOT bridge from the D48 on the arduino board to the 5v output, correct? just bridge the wires. Log reads a crc mismatch error.

Just to be sure I got the correct resistor, it is from radio shack and has 3 orange bands on it, correct?
 
Wow. I must be getting old. I pulled it out of the 3.3 bin at radio shack and seen 3.3 on the sleeve. After closer inspection it is 33, not 3.3. Guess where I am going back to tomorrow?
 
Ok, got it working. It ended up being that I only had 1 temp sensor hooked up (water and not ambient). After I commented the second temp sensor, compiled and uploaded, it started working
 
In the previous plan, I have to make two versions, one for atmega328, and another using PCA9685 (which is 16 channels).
16bit is just the resolution the teensy board supports. The resolution used should not matter since you specify value by percent (or even using a value between 0 and 255). Likewise, 8 channels because that is what the board supports. You do not need to use all 8 channels. Some applications use 5 channels for Lumia and one or more for moon lights, etc., so I think 8 is a good number.

that's the plan for now, I'll see how it goes. it may still change.

Well I had a play with the PCA9685, with a library, wrote a 1% rise every 4mins routine upto 100% then back down the same way.

This approach or simular would be good enough for me, its easy enough to add chromatic balance as a bias or over time. Add an I2c temp sensor to the hood, all done.

I can see the benefit of a wireless solution for remote canopies.

Just my thoughts

M
 
Awesome project! I've been looking for a good project as an into to electronics and some programming and this is it!

I have read through the thread and think I understand what is going on but need to use a wireless networking solution. It looks like many have been having trouble getting it be responsive enough. Does anyone have a good experience with using the wifi shield? Is the antennae strong enough to make it through a few inches of wood since I want to keep the controller in my cabinet?

The other option seems to be the ethernet sheild and an external wifi adapter. Would this be better in terms of responsiveness? I like the idea of a single box, but if it doesnt work, then I will add an external wifi unit.

Again, the amount of work and thought put into this project is impressive. My soldering iron arrives today so I can practice.
 
Awesome project! I've been looking for a good project as an into to electronics and some programming and this is it!

I have read through the thread and think I understand what is going on but need to use a wireless networking solution. It looks like many have been having trouble getting it be responsive enough. Does anyone have a good experience with using the wifi shield? Is the antennae strong enough to make it through a few inches of wood since I want to keep the controller in my cabinet?

The other option seems to be the ethernet sheild and an external wifi adapter. Would this be better in terms of responsiveness? I like the idea of a single box, but if it doesnt work, then I will add an external wifi unit.

Again, the amount of work and thought put into this project is impressive. My soldering iron arrives today so I can practice.


For a while to get over the wired connection problem I used an AirPort Express, which worked very well.
 
The other option seems to be the ethernet sheild and an external wifi adapter. Would this be better in terms of responsiveness? I like the idea of a single box, but if it doesnt work, then I will add an external wifi unit.

using external adapter will be the simplest solution. make sure you get one with good quality. I tried this using a TP Link TL-WR703 with an open source firmware, and it did not work very well. The response time compared to wired ethernet was significantly slower, resulting in a lot of connection timeouts. I think the firmware was not ready for prime time when I tested it a couple years back, so it may work better now.

you can try using the official arduino wifi shield with minor modifications to the code.
 
I started working on the led controller using teensy 3.1 and like the teensy so far. I got the coding for temp and fans done and will work on led code next. I'm still waiting for the wifi module. If the wifi module does not work well, my fallback is to use I2C connection to the chauvet controller. I'm still deciding whether to add an lcd display to this or not (probably will if there is no wifi). I like the teensy because you can plug in the usb and it will not reboot the board. This way, I can use Serial communication as a way to manually configure the controller in case there is no wifi connection. The built in RTC on the teensy works really well, and I'm assuming it is more accurate than the DS1307 RTC module.
 
Back
Top