My Neptune Apex web interface compatible DIY reef controller

I got the software working.

I had to move the buzzer from A0 to D38 and the peristaltic pump lines from A14 A15 to D39 and D41. With the buzzer connected to analog pin, during program upload, the buzzer is making a faint sound, and with the peristaltic pump control lines on the analog pins, it is affecting the reading of the ATO, feeder and ultrasonic sensor. Everything now works so I'll consider the wiring final.

I am going to rewire my jebao pump cables next. Once I get the 2 jeabao pumps up, I will work on the web page to configure and control the pumps.

I tested the peristaltic pumps and they run fine. I use a BC337 NPN transistor to drive the pump motor. I do not have a box for the peristaltic pump motor yet. I'll get back to these once the jebao software work is complete.

I had to replace the ultrasonic sensor. It got splashed with saltwater last week and it did not take long to corrode the exposed electronics. I'm covering the electronics with some sugru (I got some free samples at maker faire). You can probably use a glue gun to seal up the electronics just as well.
 
new cable to control two jebao pumps

N5rs600.jpg
 
Last edited:
jebao pump program seems to be working fine, though I probably need to fine tune it some more in the next week or so.

Since I don't have a web interface for this yet, I have to modify the config.h and upload the program to arduino every time I want to test a setting. The feed mode works nicely, short pulse every few seconds. The stock controller feed mode simply turns off the pump. I have the pumps programmed to run in different modes throughout the day.

I have to seriously dial down the two pumps to 62% max on my 60 cube :)
I do see the effectiveness of two pumps. With one pump, I have accumulation under the pump, now with two, all accumulating particles are blown into the water column and hopefully will get filtered out.
 
the jebao pumps do not spin below 20%. I'm currently running my pair on H1 at 40% for night mode. I think timed night mode is better than using a light sensor. I know tunzes do not recommend running below 30% because you will hear a click. I did not hear any click or noise on the jebao running at 20%. So far, I think they are nice pumps.
 
Maybe post a beta? I'm still getting started and I'd like the latest pin outs for the circuit. Thanks for sharing this work, I can't wait to get a Jebeo.
 
Maybe post a beta? I'm still getting started and I'd like the latest pin outs for the circuit. Thanks for sharing this work, I can't wait to get a Jebeo.


The circuit diagram in the first page is updated.

I think the program is stable now after fixing a few bugs. I just started working on the web interface. Depending on how much time I can work on this till Sunday, I may be able to complete this sooner.
 
Here's what I got so far.

Nv2nM3e.jpg
xEVmwLJ.jpg
UKnw3kT.jpg


Notice the W2 antisync graph is the opposite of the master pump.
The wave form graph even updates in real time! :)
<iframe width="560" height="315" src="https://www.youtube.com/embed/JOaR_DREpTQ" frameborder="0" allowfullscreen></iframe>

I still have to work on the pump control page. When you tap on the pump, it should open a pump control page where you can change wave mode, speed and pulse width
 
Last edited:
I'm still working to get the first version to compile. I get: 'sdfile' has not been declared.
I can get by that by uncommenting class sdfile. Next issue is: 'time_t' does not name a type.
Any ideas where to start with that? I'm pretty sure my libraries are good and in the right place.
 
If the library is SdFat then yes and I grabbed the two time libraries from the second page of this thread. First error is here in tinywebserver.h "void send_file(SdFile& file);"
 
if you have TinyWebServer library in your libraries folder, remove it. I use a modified TinyWebServer that is already included in the project.

The other possibility is you placed the library files in the wrong location. It should be in a folder named libraries in your sketch folder. Select File/Preferences menu on arduino, the first item tells you exactly where your sketch folder is.
 
doughboy, thanks for the advice. I cant wait to get this thing running and I must have jumped too quick. I did sketch/show sketch folder which is the incorrect location.

I still have an issue with SdFat. Should that file be pulled out of the sdfatlib20130629 file or was there some modification to it necessary?
 
I'm starting this thread to document and share the progress of my controller build. I have been working on this for 1.5 years now and is still a work in progress. I have been using this on my tank since April 2013. I initially planned on getting an Apex controller, but it does not contain some features I need. Apex feed mode cannot be run on a schedule, it only has input lines (no output), no water level sensor, and no built it support for auto feeder (I think they are coming out with one for $99).

Objective:
To build a reliable, compact, simple, low cost, web based interface aquarium controller.

Description/Features:
Base Features:
8 outlet aquarium controller using Chauvet SR-08 relay packs.
Web based user interface optimized for mobile browser (Neptune Apex compatible).
Water level sensor using SR04 ultrasonic sensor (for top off water).
http://reefcentral.com/forums/showthread.php?t=2328819
Auto Feeder using hacked Aqua Chef feeder.
http://reefcentral.com/forums/showthread.php?t=2327962
Can run a Feed cycle on schedule.
Time is synchronized with NTP server and DS1307 RTC module.
Automatic daylight savings time adjustment of time.
ph sensor.
Temp sensor.
Two ATO switches.
Sound and Email alert.
Outlets, Sensors and Web access logging.

Mobile Client app features:
View and control outlets.
View chart of sensor data for last 24 hours.
View logs for any day since logging started.
Modify controller program schedule.
Calibrate ph probe.
Manage SD card files (currently supports file delete only).

Optional Features:
Can be expanded with another unmodified Chauvet SR-08 to add another 8 outlets.
Two channel PWM 0-10v variable output. (hardware implemented, no software yet).
LCD display. (implemented)

The original design includes an X10 interface so I can use my old AC jr DC-8, but had since dropped that feature. The PWM I originally intended for controlling LED lights, but I have since bought a Maxspect Razor so PWM is currently unused. I may use it someday when I get a controllable pump.


Main Parts Needed:
Chauvet SR-08 Relay pack.
8 channel 5v relay module.
Arduino Mega2560.
Ethernet Shield.
Atlas ph stamp.
DS1307 RTC module.
DS18B20 Temp sensor.
ph probe.
BNC connector.
Aqua Chef feeder.
BC327 PNP transistor and 4.7k, and 47K resistors and 1N914 diode.
12v 1A power adapter.
5v 1A power adapter (USB charger).
5mm LED and 220ohm resistor.
Piezo buzzer.
micro SD card. (4GB will store your logs forever).
assorted jumper wires, pin connectors male and female , stereo and 4 pole plugs and jacks, prototype board, soldering equipment, switches, etc.

Optional Additional Parts:
For 8 outlet expansion
Another Chauvet SR-08.
DB-9 breakout module (Sparkfun 8552)
ULN2803 Transistor Array.
DB9 cable (male to female).

For PWM output
LM358 and 4 10k resistors. For 0-10v variable DC output.

For LCD Display
1602 LCD with I2C backpack. You can display a lot of stuff on 16x2 if you get creative. :)

Depending on where you source your parts, the base unit will cost around $150 and definitely under $250 with the optional parts. I got all my parts from Ebay, Tayda Eletronics, and Sparkfun.


Software Features:
The software consists of the arduino code, and an html5/javascript code that runs on mobile web browser. The outlet schedule processing is done via timer interrupts. Each outlet is updated once per second, guaranteed. I use a very simple, efficient and compact algorithm to define the outlet schedule programming.

The main loop executes less time critical tasks at 60 hz (60x per second or once every 16ms) like logging outlet switch events to SD file, updates LCD, update ph, temp and sonar readings. The ph, temp and sonar readings use an 8 reading rolling average to smooth out the values.

Input lines use pin change interrupts. Ultrasonic sensor echo pulse, Feeder home position indicator (to stop feeder rotation), generic IO open and close all use pin change interrupt. ATO uses timer interrupt to poll once per second.

I also have a timer interrupt based audio beep code for the controller to provide an audio confirmation when commands are received by the controller from the mobile app.

The web server code is based on TinyWebserver. I modified it to use SdFat library and to read and write faster (using buffered reads and writes). I also added basic web authentication code to prompt web connections for a username and password. TinyWebserver is nice that it has code for uploading your files to the SD card.

The mobile web interface is compatible with Neptune's Apex controller. This means, my htm file will work with Neptune Apex controllers. See http://reefcentral.com/forums/showthread.php?t=2306409. Someday when I get an Apex, I will have a nice mobile html app to use. The web page also displays live video stream from a Foscam compatible camera. It is a single htm file written in html5 and javascript using jquery mobile library.

Files for this project are available on github at
https://github.com/d0ughb0y/Chauvet16

d0ughb0y,

Great job on this.

I started on 2 other Aurduino controllers and just gave up. This one has everything I need.

Just need to confirm some parts with you before proceeding

Ethernet Shield -any ethernet shield?

Where would I find the SD shield or is it part of the ethernet shield?

LCD shield - any 1602 LCD with I2C backpack will suffice?

Is there a BOM located at - https://github.com/d0ughb0y/Chauvet16?

Thank you!!
 
Last edited:
I did not create a complete BOM other than what I listed, since the idea is to provide the plan (diagram) on how the parts connect, then its up to you what parts you want to use (like what connectors, relay board or solid state, etc). The circuit diagram on the first page is up to date, but a little low on resolution. I will update github with the latest program and pdf of the circuit diagram soon.

You need to use the arduino ethernet shield or compatible one. It comes with the sd card reader.

You can use any 1602 I2C LCD, however, I think there are two maybe three versions of the I2C backpack out there, any you will need to tweak the values (I2C address, pin assignments, etc) to find out what will work with the LCD you got.

I suggest you get all the parts first, then run individual test programs for each part (temp, rtc, ph ,etc) then once you verify each is working, then try to put them all together then try the controller program.
 
Back
Top