My Neptune Apex web interface compatible DIY reef controller

did you wire up all the hardware like in the connection diagram?

You must have temp and ph probe connected in order for the program to run.

Hi "d0ughb0y",

For testing purpose could I use only Arduino Mega 2560 and Ethernet shield?
Should web interface work even withouth all other hw?

In that case should I get any response in Arduino serial monitor?

Of course I rem line: // initSensors(); //temp and ph
in Chauvert16

As I compile and upload program everything is OK still no response in browser, even ping of same address gives me good reply.

How could I get information where program stops?
 
Hi "d0ughb0y",

For testing purpose could I use only Arduino Mega 2560 and Ethernet shield?
Should web interface work even withouth all other hw?

In that case should I get any response in Arduino serial monitor?

Of course I rem line: // initSensors(); //temp and ph
in Chauvert16

As I compile and upload program everything is OK still no response in browser, even ping of same address gives me good reply.

How could I get information where program stops?

You will need to debug the program a small section at a time. It was not the intention to run the program without any sensors, etc. You copied the index.htm file to the SD card in the ethernet shield right?

Are you just interested in the javascript html5 code?

If you don't have any of the hardware, best is to just read and walk through the code.
 
Jebao pump code is complete and uploaded to github!
Refer to the PDF file for the new updated circuit diagram. Click the link below and then click on "View RAW" on the GitHub page.
https://github.com/d0ughb0y/Chauvet16/blob/master/chauvet16_schem.pdf

Jebao Pump Control Features:

  • Control your jebao pumps anywhere on the internet. Fully control your pumps from your smart phone. Real time wave form graphs are displayed!
  • Pump too strong for your tank? You can dial down the pump speed (or level) down to 20% with this controller.
  • Supports up to 4 Jebao or any 5V PWM pumps.
  • Change wave mode, sync mode, level and pulse width up to 6 times over a 24 hour period automatically.
  • Ramps up and down between intervals as defined in your program.
  • Run pumps in sync or anti sync with reference to pump 0. Pump 0 is always the master pump.
  • Define your own custom wave form. It's as easy as entering the waveform values in an array. Program is super efficient since levels are retrieved from arrays without any floating point operations.
  • Real feed mode. The pump will turn on for 110ms every 880ms.
  • H1, W1, W2, W3, ELSE mode is 100% replica of the stock controller. H2 and H3 can be obtained by reducing the speed of the pump. Night mode is simply H3.
  • Added a Nutrient Transport Mode. You can customize this wave form for your tank. I run a bare bottom so I run all pumps at 100% to kick up detritus.

some more screenshots. I use Mercury web browser on the iPhone. It allows saving of the login name and password and has a nice full screen mode.
AkqwSPZ.jpg

jebao pump status

ev240gO.jpg

bars are grey if pump is running in manual override mode
notice the bar level decrease when I decreased the max level from 100% to 83%

xvzNfdi.jpg

pump control page showing pump1 running in Anti-sync mode

lIqZX0a.jpg

pump0 control page.
H3AWe3X.jpg

editing the pump program. The program is setup as 6 intervals over a 24 hour day. The time for each interval is configured in config.h. The wave mode, sync mode, max level and pulse width can be configured from the mobile client.

My next project for this controller is the dosing pumps. I'll add basic dosing and auto water change functions.

I recently opened up my Maxspect Razor and see that it is controlled by an ATMega168 chip. I think will be able to control the maxspect razor with my controller as well. The final project is to add LED light control. I'll start working on these next year.
 
Last edited:
You will need to debug the program a small section at a time. It was not the intention to run the program without any sensors, etc. You copied the index.htm file to the SD card in the ethernet shield right?

Are you just interested in the javascript html5 code?

If you don't have any of the hardware, best is to just read and walk through the code.

As I monitor progress on several controllers I find out this solution is that what I could use as Web interface and solution for it in controller is the best combination of all code from all those projects.
In this way I would like to try your sw and do some small exchanges to meet my specific requirements.

As you say I had to add some additional hardware I will connect RTC and Temp sensor, but for now leave ph input "on the air". I think in this way readings of Ph will be random but this shouldn't have impact ot sw work.

I hope with RTC and Temp sesor your code will work in that way as I could use for my purposes.

Yes I format my 2G SDcard to Fat32 and put in index.html

Thanks for sharing your project and code! :wave:
 
As I monitor progress on several controllers I find out this solution is that what I could use as Web interface and solution for it in controller is the best combination of all code from all those projects.
In this way I would like to try your sw and do some small exchanges to meet my specific requirements.

As you say I had to add some additional hardware I will connect RTC and Temp sensor, but for now leave ph input "on the air". I think in this way readings of Ph will be random but this shouldn't have impact ot sw work.

I hope with RTC and Temp sesor your code will work in that way as I could use for my purposes.

Yes I format my 2G SDcard to Fat32 and put in index.html

Thanks for sharing your project and code! :wave:

The arduino SDfat library does not support long filename. So the file must be named index.htm, not index.html.

With the latest code, you can disable temp and ph in config.h. Both will read 0 if disabled.
I don't think RTC is required either as long as the program is able to get the time using NTP over the network. Check your SD card for log files that are created to see what failed.

This project started out as writing a new better web client for Neptune Apex (I do not even own an Apex), and as I was writing it, I realized that although Apex can do a lot, there is a lot more it cannot do, and started building my own controller. Since I already put in all the work to write the client, I figure I will use the same Apex web service on my controller. Pretty much any modern device out there now is web enabled and can be controlled by a smart phone. You can use your smart phone as TV remote control, home automation, even start the car! Even ecotech recently added smartphone control to their light and will add it to control vortechs in the future.
 
Last edited:
Amazing work that you are doing!!

I was started to copy last week and now I am very happy whit your great work. All is fine for me.

Only a question.

What I need to change in your code to use a temp sensor in parasite mode? I tried a lot of things but not works for me.

Thanks in advance
 
Amazing work that you are doing!!

I was started to copy last week and now I am very happy whit your great work. All is fine for me.

Only a question.

What I need to change in your code to use a temp sensor in parasite mode? I tried a lot of things but not works for me.

Thanks in advance

to use parasite mode, search for ds.write in Sensors.ino, and add a second parameter value 1 to the write function call.

Note that the temp sensor onewire operation is the slowest operation in the whole controller code. The current code is optimized for use with a single sensor (no addressing is made if there is only one OneWire device). This cuts the execution time significantly. All the code is in Sensors.ino and you can change the code there to suit your design (like multiple sensors, parasite mode, etc).

Well I miss that and I will check that today. Thanks!

But SDlib suport only FAT or also FAT32 formated SD card??

yes, you can use fat32 on a 2gb card. the only restriction of sdfat library is the use of 8.3 filename in order for the library to conserve arduino memory space usage.
 
Thanks for your fast answer. I tried typing the second parameter but it continues failing.
I try to change more things. ;)
 
The arduino SDfat library does not support long filename. So the file must be named index.htm, not index.html.

Yes I check and file on SD card is index.htm

With the latest code, you can disable temp and ph in config.h. Both will read 0 if disabled.

I rem both lines,

I don't think RTC is required either as long as the program is able to get the time using NTP over the network. Check your SD card for log files that are created to see what failed.

Yes I try today with your new code still same result. I got ping reply on shield IP, on SD card only that index.htm file exist and in browser on that IP address no response.
Tomorrow I will try to add also RTC to see if this will change anything.
I also don't have I2C LCD so maybe also this could be a reason?

But I try some other examples with This shield and controller and shield is working normally.

This project started out as writing a new better web client for Neptune Apex (I do not even own an Apex), and as I was writing it, I realized that although Apex can do a lot, there is a lot more it cannot do, and started building my own controller. Since I already put in all the work to write the client, I figure I will use the same Apex web service on my controller. Pretty much any modern device out there now is web enabled and can be controlled by a smart phone. You can use your smart phone as TV remote control, home automation, even start the car! Even ecotech recently added smartphone control to their light and will add it to control vortechs in the future.

Yes your project is very interesting as code for controller is not so huge and there are still so many features which could be added.
 
Jebao pumps are even cheaper now on eBay.

Wp-25 $68 for one $132 for two
Wp-40 $80 for one $158 for two

I paid $153 for my two wp-25 from same seller.

There is absolutely no reason/excuse for any reefer not to get at least a pair of these now.
 
Thanks for your fast answer. I tried typing the second parameter but it continues failing.
I try to change more things. ;)


test things one at a time. Make sure your sensor is still working. I think these sensors don't get damaged easily. I have made wrong connections on my first sensor and it did not get damaged. The ebay seller had the wrong wire color label.

write a test program for temp sensor using parasite and make sure it works. Then merge the changes into the controller code.

as far as I know, the only difference is to add 1 as second parameter to write function call.

You have a pullup resistor on the data line right? the pullup is required regardless if you use parasite mode or not. I don't think you can use the arduino internal pullup, in case that is what you are trying to do.
 
Who's the seller, I don't need any as I have 2 WP40's and 2 WP60's

jebaous

I don't think he is an official jebao dealer, but he probably made tons of profit off of this already. I don't think he sells the wp60 or wp10 yet. He ships very fast, same day he takes the package to the post office in Arizona. I get it in two days in California. way better than saving a few bucks and waiting forever ordering from china or from group buy.
 
Yes I check and file on SD card is index.htm



I rem both lines,



Yes I try today with your new code still same result. I got ping reply on shield IP, on SD card only that index.htm file exist and in browser on that IP address no response.
Tomorrow I will try to add also RTC to see if this will change anything.
I also don't have I2C LCD so maybe also this could be a reason?

But I try some other examples with This shield and controller and shield is working normally.



Yes your project is very interesting as code for controller is not so huge and there are still so many features which could be added.


Test this one step at a time as follows:

at the beginning of setup()
add
Serial.begin(115200);
or whatever baud rate you want to use. make sure the IDE baud rate is the same.

Then after each line in setup(), add something like
Serial.println("after initbuzzer");

Serial.println("after initTimer");

and so on.
From this you will know how far the program got before it hung.
Then you can do the same inside the function where it stopped working until you find the reason why the program does not work.

Also, make sure the network is configured correctly. I set it up to use a fixed ip address, and not dhcp.

Also, the webserver port is at 8000. The tinywebserver files I used have the webserver port hard coded. I think the newer one is configurable.
 
As to code size, most other arduino controller code size is larger because of the added ui code for menu, touch screen, button or joystick input. I would not recommend starting a new controller build based on arduino touchscreen, as that is technology from two years ago.

The bane of all loop based arduino program (which all other controllers use and why some builds get abandoned) is the dreaded loop hang, due to a function taking up more than its fair share of execution time. This can result in unresponsive UI, or horror stories you read like the two part doser got stuck to ON position.

It is also impossible to get 100% accurate timing using loop based program, which inevitably, will need to call the delay() function. Which is why I avoided the typical loop based code for this controller. I worked on some code for an arduino based drone that use interrupts heavily and applied the same code design to this controller build.

You can see what I mean when you complete this build. Even simple things like the blinking of the status led, and the 50ms beeps cannot be achieved with 100% accuracy without using interrupt based code. Likewise for the guaranteed refresh of outlet relays once per second, or adjusting pwm level every 2ms.
 
Finaly I achieved to connect the temp sensor in parasite mode but I am not agree with the result because it needs a 750ms delay to run property.
I am thinkingnto return to your original code adding another one because now Inhave two sensors. One for the tank and another for the sump and I like it.

Thanks for your hard work.
 
Finaly I achieved to connect the temp sensor in parasite mode but I am not agree with the result because it needs a 750ms delay to run property.
I am thinkingnto return to your original code adding another one because now Inhave two sensors. One for the tank and another for the sump and I like it.

Thanks for your hard work.

The 750ms delay is required.

on my code, I do not wait using a delay(750). I just return back to the main loop and just keep checking the state in each loop (state 1 in updateTemp function). If data is available, I move to state 2 to actually read the code.

My main loop, if you take out the temp sensor OneWire code, executes as fast as 50us. So the loop can go up to 14-15x to do other things before the temp value is available from the sensor. Then it takes about 550-600us to actually read the temp. OneWire protocol is really slow.

If you want to use 2 sensors, state 1 can still use ds.skip(). This way, you do not need to send the convert command (0x44) to each sensor. One send of the convert command goes to both sensors. then in state 2, you must use the temp sensor address in sequence. Replace ds.skip() with ds.select(addr) to read the temp value for sensor with address addr. You can try adding a state 3 for reading the second sensor value or stay in state 2 and read the second sensor's value on the next call from main loop before going back to state 0.
 
Back
Top