My Neptune Apex web interface compatible DIY reef controller

I wired up up 16, but currently only using 8. I need to see what all needs changed in the code to make all 16 work. I don't need them all, but may some day in the near future.

The BNC's are for pH/Salinity & ORP. The picture only shows 2 BNC's but I added the 3rd after I took the picture. I do have 2 pH stamps though, so your code is very much welcome, if you want me to test in the near future.

Also I think I found an issue on the Web Interface. Mainly for the PWM Pumps Setup section. Pump 1 & Pump 2 show the same settings, and Pump 3 show as Master with H1 @ 50%. However in the config.h file Pump 2 and 3 are setup as _master @ 50%. I have my return pump connect to Pump 2 PWM, and I had to modify the Pump 3 settings from the web interface for on the fly changes.

Thoughts?

The config.h values are just the initial settings, so you can ignore those once you modify the values in controller setup page.
Can you email me the screen shots of the pwm pump controller setup page that shows the discrepancy? (one pic for each pump)

I'll check this later when I get home.
 
d0ughb0y,

Thanks for the clarification and understood. I was not aware that some routing can actually sabotage a gzipped response - Yikes.
How does one (remotely) recover from that situation? My guess is that a user is then "up the creek with no paddle"...

Best to upload both index.htm and index.gz files to SD card. You never know if your internet connection will go through some route that will change the http header to not accept gzipped response. But in general, you can probably get away with just uplpoading the gzipped file.

Yes, I have (but not with the Atlas module) and while I don't like having the need for isolation (something must be causing the stray voltage),
I muttered to myself that my next setup would have isolation to be safe. Thanks for the link to the Atlas isolator, I had not seen that and it might be a solution.
In fact, I'll order an Atlas board right now and will try it for fun. I can always add isolation later.

Have you actually tried out the various ph options? I started with my own circuit, it was nothing but problems. The atlas stamp was trouble free right from the beginning. I just checked their website, and they are closing out the current ph stamps. Perhaps they are coming out with a new version that has galvanic isolation. They sell a power isolator stamp that will work with the ph stamp.
https://www.atlas-scientific.com/product_pages/embedded/pwr-iso.html
 
I'm using a 12v 1amp Walwart to power the 16 Channel Relay. In the picture it is the top Walwart. The bottom Walwart is a 9v 1amp, that is then cabled to the ATX Connector pins 23 & 24 (V+ & V-), that go back to the main controller to power it using the Vin Pin.
 
I just uploaded the fix to github. The html was constructed incorrectly.
I also uploaded a fix to the netcheck routine.

the page should now look like this
6kKZE4Y.png
 
Last edited:
Nice work sorscode. I tried to power the arduino and 8 relay board with one 12v/1.2A wall wart but it has trouble on startup. Do the power supplies need to be separate due to starting amp draw?
 
Regarding power supply, you do not want to power the relay board off of the arduino 5v out. You will burn out the voltage regulator on the arduino.

The specs for the 5v relay is 89.3ma, and 12v relay is 37.5ma
multiply that by 8 (if you are powering 8 channel board)
5v relay board = 714.4ma
12v relay board = 300ma

this is the max amps it will draw if all relays are ON. I think the actual was a little lower when I measured it.

If you want to use a single power supply, get a 12v to power the arduino, and get a 12v relay board, and you can get by with a 12v 1a power supply or better 2a. Again, do not power a 5v relay board off of arduino 5v. rrbigdog, if your relay board is 5v, you need to get another 5v1a supply to power it. if you want to run on single 12v supply, you need to get a 12v relay board.

I use a 12v 1a to power arduino, and a 5v 1a to power a 5v relay board.

Regarding the relay board, if you find that the relay is sometimes not switching, you may have to desolder the led indicator light on each channel and short them out. The led takes out about 0.7v forward voltage from the pin connected to the optoisolator input.

if you have trouble on startup or arduino reboots when relay switches, try to add a filter to the power line. That simple toroid coil works wonders.
http://reefcentral.com/forums/showthread.php?p=22648973#post22648973
 
I agree with d0ughb0ys post above. I went separate power supplies, for personal reasons. I could of gotten away with a single, but liked the dual setup better.
 
Hi d0ughb0y !

I updated my controller code and also refresh both files on SD card.
Still after enabling 4 PWM pumps I got different view of configuration window?
Pump0 and Pump1 are in same line stil Pump 2 and Pump3 below instead of on the right side in same line?
Same view on Firefow, Chrome on laptop or on Android phone.
Why that?

 
Teslo -

I would upload the new files again. Mine didn't take the first time I did a curl update but did the second time. Also make sure you clear any cached data on your computer after.
 
Teslo -

I would upload the new files again. Mine didn't take the first time I did a curl update but did the second time. Also make sure you clear any cached data on your computer after.

Yes I was also thinking that, still I delete original files on sd card then refresh view and both file were not on SD card. Then I copy new files and refresh and files were there. I am using USB card reader/writer.
Also when I try and remove card from reader/writer and return it back I check contents and files with right date/clock/size are on Sd card.

Then I try again and same result.
 
first, go to file manager under logs and setup to see if file size of index.gz is 20403.

the webserver code does not use any caching feature (http header set to no cache), so client browser will honor that. you can try to do a CTRL-F5 from firefox on windows to see if it loads a new file.

I only use curl to upload and never had any problem.
You can try to delete the index.htm and only upload the index.gz.

I use this curl command

Code:
curl.exe -0 -T index.gz http://loginname:loginpass@192.168.0.15:8000/upload/index.gz
 
Sanity check. If I do use a single 12v 2a and use a 12v relay then it would wire with the 2803 right?

you only need the 2803 if you are expanding another 8 outlets to a chauvet. but otherwise, yes you can use the 12v to power the arduino and the 12v relay board.
 
Well it is strange but when I download files from github yesterday index.htm and index.gz vas old but today newer version.

Anyway copying new index files to SD card using SDcard reader/writer works normally and then that page for pwm pumps configuration normally shows all 4 pumps in same line as it should to.


But this copying with curl doesn't work for me. I put curl.exe in same directory as both index files and run it without parameters and I get reply as:
curl: try 'curl --help ......

so program runs and do something

then I try in command prompt in my working directory where I have curl.exe and both index files as:
curl.exe -0 -T index.gz http://admin:password@192.168.8.177:8000/index.gz and
curl.exe -0 -T index.htm http://admin:password@192.168.8.177:8000/index.htm

and it finish with no reply or any error message still when I check index.gz on SD card there are still old files and not updated?
 
I just tried curl again and it fails to connect.
I must have uploaded the index files before I updated my arduino with the last code. Did you update the arduino with the network.ino that fixes the netcheck function? That would be the only change since I know I was able to upload successfully.

you can add -v option to curl command to show progress verbose.

wait, I just tried again and it works just fine. I was not able to upload earlier because my laptop was still connected to my work vpn. So check if you can even do a plain curl to your controller

curl http://user:login@yourip:8000

that command should display the index.htm file.
 
Last edited:
Did you update the arduino with the network.ino that fixes the netcheck function?

Well I hope I did :)

I also took controller to my office connect it to local network and that message
"Ethernet and Webserver reset."

still appears in Contreoller log each 20minutes.

Strange really :(
 
Back
Top