My Neptune Apex web interface compatible DIY reef controller

Which fans are you going to use with this the ones from tigerdirect or bestbuy

I am going to use both. I got 1 from tigerdirect and 2 from bestbuy and configured the controller for 3 fans. I might end up using only 2 and keep 1 for spare.

I currently use a small electric fan mounted on top of my display tank to cool the tank in the summer. I will be replacing that with the tigerdirect fan. I will use one of the bestbuy fan for the sump cabinet and maybe the other one for led fixture.
 
I am not seeing a way to create new macros or action on the controller's web site, so I imagine I would have to define that in the sketch, like how the feed macros and actions are. Then do the actual time setups via webpage?

there is a limit of 4 macros. so you just need to edit one of them either in the setup page or in config.h.
 
this looks promising

https://github.com/codebendercc/Ariadne-Bootloader

you can still upload code via serial, but can upload via tftp as well, and works with mega with Ethernet board.


So I played around with this and the good news is it works.
The github page says usbasp programmers won't work loading the bootloader on to arduino mega, which is right if you are using arduino to burn the bootloader.

I used the avrdude command line and it burned the bootloader just fine.
You need to copy the file ariadne_atmega2560.hex to the same location as avrdude.exe and run the 3 commands shown below. The second command will take about 3 minutes to complete. There will be a progress bar.
you can buy usbasp programmer on ebay for about $2.50 only. Make sure to get the one with the 6 pin ICSP cable.

Code:
avrdude -c usbasp -p m2560 -P usb -b 115200 -e -u -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xD8:m -U efuse:w:0xFF:m
avrdude -c usbasp -p m2560 -P usb -b 115200 -V -U flash:w:ariadne_atmega2560.hex
avrdude -c usbasp -p m2560 -P usb -b 115200 -U lock:w:0x0F:m
you will know the bootloader is on your arduino mega if the led blinks fast with the ethernet shield attached.

you will then need to run their utility program to change the ip address, gateway, etc info that is stored in the eeprom. Since they are using eeprom at address 0 to store this informaiton, I will need to move where I store chauvet config variable values a little further up.

before you can upload, you need to compile your arduino program to generate the .hex file, then use avr-objcopy.exe command to convert it to bin. Then upload using tftp command

Code:
tftp -i  ipaddress <ip> put Chauvet16.cpp.bin
This option to upload a new program to arduino mega via tftp is not required but good to know it can be done if needed. The nice thing with this bootloader is upload via usb cable still works.

I will move the config variable storage location in case anyone tries to use this feature. I will also add the http command to reset remotely.

I will burn this bootloader to my arduino mega when I open up my controller case to add the transistor circuit for the fans.
</ip>
 
So I played around with this and the good news is it works.
The github page says usbasp programmers won't work loading the bootloader on to arduino mega, which is right if you are using arduino to burn the bootloader.

I used the avrdude command line and it burned the bootloader just fine.
You need to copy the file ariadne_atmega2560.hex to the same location as avrdude.exe and run the 3 commands shown below. The second command will take about 3 minutes to complete. There will be a progress bar.
you can buy usbasp programmer on ebay for about $2.50 only. Make sure to get the one with the 6 pin ICSP cable.

Code:
avrdude -c usbasp -p m2560 -P usb -b 115200 -e -u -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xD8:m -U efuse:w:0xFF:m
avrdude -c usbasp -p m2560 -P usb -b 115200 -V -U flash:w:ariadne_atmega2560.hex
avrdude -c usbasp -p m2560 -P usb -b 115200 -U lock:w:0x0F:m
you will know the bootloader is on your arduino mega if the led blinks fast with the ethernet shield attached.

you will then need to run their utility program to change the ip address, gateway, etc info that is stored in the eeprom. Since they are using eeprom at address 0 to store this informaiton, I will need to move where I store chauvet config variable values a little further up.

before you can upload, you need to compile your arduino program to generate the .hex file, then use avr-objcopy.exe command to convert it to bin. Then upload using tftp command

Code:
tftp -i  ipaddress <ip> put Chauvet16.cpp.bin
This option to upload a new program to arduino mega via tftp is not required but good to know it can be done if needed. The nice thing with this bootloader is upload via usb cable still works.

I will move the config variable storage location in case anyone tries to use this feature. I will also add the http command to reset remotely.

I will burn this bootloader to my arduino mega when I open up my controller case to add the transistor circuit for the fans.
</ip>


Not a programmer and I'm trying to understand. I put the folder in my sketchbook folder and restarted arduino and I see the files in the boards and programmer. Now where do I put the code you listed here at.
 
if you want to do this now, you need to edit the readEEPROM and writeEEPROM in utils.ino to

Code:
eeprom_read_block((void*)&conf+0x40, (void*)0, sizeof(conf));
and

Code:
eeprom_write_block((const void*)&conf+0x40, (void*)0, sizeof(conf));
I told the author of the bootloader it is a bad idea to store system data at addrerss 0 since that is where user program will store data.

The bootloader uses the first 64 bytes (hex 0x40) of eeprom to store its data (like ip address, etc).


You cannot use the Arduino IDE to burn the bootloader to mega. You must use the avrdude command to do it. So ignore the steps about copying the hardware folder to arduino and use the avrdude command I listed instead. The libraries are useful as you need to use them to change the ip to something else if the default does not work for your local network.

I really like the idea that the chauvet program (or any program/firmware for that matter) can be updated via ethernet.
 
I'm going to play around with this bootloader

https://github.com/thseiler/embedded/tree/master/avr/2boots

it gets the program from SD card.
I think if this works, will actually work better because one can just use curl to upload the new firmware to the sd card, reboot the arduino, and the new firmware is read and loaded. No need to have to deal with the bootloader eeprom usage conflict, no need to have to load additional libraries, run yet another program, etc.
 
I think if this works, will actually work better because one can just use curl to upload the new firmware to the sd card, reboot the arduino, and the new firmware is read and loaded.

Yes this is even much more simple and easy solution! And a good one!
 
D0ughb0y,

I increased the number of outlets to 16, to include a heater at Unused9

Complies ok, but get an apex parser error.

Also, a suggestion, could the fan and temp be just setpoints so max temp, and min fan on temp.

Also the temp settings do not seem to turn on and off the heater, or the fan, any thoughts on where I am going wrong?

Thanks

Moomin
 
do you have #define _HEATER uncommented?
and heater name is Heater
it is case sensitive in C.

as for fan, the current program merely use the temp0 value to control and outlet named Heater. If you want to use a temp sensor other than temp0, you need to edit the current code.
The pwm fan will use the set points.

run the atlas test sketch for conductivity probe, and capture the serial output. I just want to see what it looks like.

specifically, I want to turn off extended message reply, and not sure yet if I want to enable only conductivity reading or salinity or both.
and if you disable readings, does it show only the enabled ones? or return the values with commas but no value. It is not clear in the atlas write up.

the default response is
EC,TDS,SAL,SG<cr>
if I only enable EC, does it return
EC<cr>
or EC,,,<cr>

I see Atlas released the new EZO version of ORP stamp as well.</cr></cr></cr>
 
Last edited:
I see Atlas released the new EZO version of ORP stamp as well.</cr></cr></cr>

Now dissapointed, my ORP is not an EZO, looks like I just had to wait a few more days, and probably only a firmware update too!.

Conductivity is EZO.

Ill get the Atals output posted today.
 
OK
This is the output out of the box.

0.00,0,0.00,1.000

0.00,0,0.00,1.000

Out of the box in 150000uS solution

12140,6560,6.94,1.006

12140,6560,6.94,1.006

*OK

If the O command is used one or more outputs will, or wont display

i.e. O,EC,1 -- Will display EC & any others that aren't disabled.

so...

O,EC,1 -- only EC displays no commas
O,TDS,0
O,S,0
O,SG,0
12100
*OK
-------------------------
Specific Gravity
O,EC,0
O,TDS,0
O,S,0
O,SG,1 -- only SG displays no commas
1.006
*OK
--------------------
EC,TDS,SG
O,EC,1
O,TDS,1
O,S,0
O,SG,1
12100,6536,1.006
*OK
 
D0ughb0y,

Have noticed that these devices are very temperature sensitive, is it worth sending the current water temperature when requesting a reading?

M
 
thanks for the info.
did you get the K=10 probe?
can you try sending the following commands in the exact order

response,0
c,0
o,ec,0
o,tds,0
o,sg,0
o,s,1
k,1.0
r
r
r

I want to use salinity reading only and no *OK in the response. If you got the k 10 probe, use k,10.0 instead of k,1.0 command. The above sequence is the current initialization commands sent to conductivity stamp. For each r command sent, I need it to show salinity only. It looks like from your sample, the response is a number with two decimal places.

I think for the temp range in reef aquarium, the difference is negligible.
 
Last edited:
Wow, nice work. I'm impressed to find this, especially now that I'm working on my own system which does almost the same thing as your system, although mine is more aiming to a modular system.

Anyway, I found this topic because I was searching for a good way to measure the water level. I had the idea to measure this with by placing a PCB inside the tank to measure the level but I'm not fond of that idea.
Now I see you're using an ultrasonic to do this which is a good idea. But I can't seem to find any waterproof version for this.
Best one I found was this one: http://www.aliexpress.com/item/1PCS...odule-30cm-3-5m-FREE-SHIPPING/1649048115.html but it measures between 30cm and 5m so it is only usable if you can hang it high enough which is not the case for me. Are you still using the HC-SR04 version?
 
Hi,

Its a K=10 probe

35.00
35.01
35.00

As far as temp goes a change of 0.4C will shift S from 35.01 to 35.41, Its a simular effect with pH, will shift by about from 7.9 - 8.2 over a sim temp range.


M
 
Also found out where I was going wrong with the heater.

I incorrectly thought that I needed to set an on period of 24hrs in the heater outlets setup.
 
Back
Top