My Neptune Apex web interface compatible DIY reef controller

Hi d0ughb0y!

I have trouble with configuration with 4 dosers.
As I check shematics documentation there is still doser 2 connected to pin D45 asd doser 3 connected to pin D44


Still in your last sketch code you are using pins
PORTG|=_BV(PG0); pin 41
PORTG|=_BV(PG2); pin 39
PORTG|=_BV(PG1); pin 40
PORTL|=_BV(PL7); pin 42

So I guess pins 40 and 42 should be used for doser 2 and 3 ?


Anyway I recconect doser 2 and 3 to correct pins still when I reset
controller all pumps are off still when I want to calibrate doser 0 and 1 everything works OK and correct
still with doser 2 and 3 I start calibrating and pumps start to spin but whatever I do they don't stop until next reset of controller?

What could be the reason for that? Strange really ?



in config.h I use:

#define _DOSER
#define MAXDOSERS 4

and

#define DOSERDEFAULT {"Cal",24,12,0,0,100,500},{"Alk", 24,12,0,10,100,500},{"Bux",24,12,0,0,100,500},{"Mg1", 24,12,0,10,100,500}

I hope this is ok default settings?
 
Great write-up, I'll definately be referring to this extensively for my future projects. Thanks for putting so much time in documentation so that others can DIY.
 
Hi d0ughb0y!

I have trouble with configuration with 4 dosers.
As I check shematics documentation there is still doser 2 connected to pin D45 asd doser 3 connected to pin D44


Still in your last sketch code you are using pins
PORTG|=_BV(PG0); pin 41
PORTG|=_BV(PG2); pin 39
PORTG|=_BV(PG1); pin 40
PORTL|=_BV(PL7); pin 42

So I guess pins 40 and 42 should be used for doser 2 and 3 ?


Anyway I recconect doser 2 and 3 to correct pins still when I reset
controller all pumps are off still when I want to calibrate doser 0 and 1 everything works OK and correct
still with doser 2 and 3 I start calibrating and pumps start to spin but whatever I do they don't stop until next reset of controller?

What could be the reason for that? Strange really ?



in config.h I use:

#define _DOSER
#define MAXDOSERS 4

and

#define DOSERDEFAULT {"Cal",24,12,0,0,100,500},{"Alk", 24,12,0,10,100,500},{"Bux",24,12,0,0,100,500},{"Mg1", 24,12,0,10,100,500}

I hope this is ok default settings?

sorry for the late reply.

D40 and D42 are used for dosing pumps 2 and 3.
D45 and D44 are used for pwm pump (jebao pump) 2 and 3.
So the code is correct and your connection is correct.

I will check the calibration code for dosers 2 and 3.
 
WOw!. ok.. once, your not a very good driver...but twice?? ur a complete moron. lol. What did they say? What made you go back and look at the video?

btw. How did you learn how to do all this?

learn by lots of reading and google search.
the arduino forum helps a lot in terms of coding and circuits.
There are quite a few people on there that really know what they are doing.
 
latest status.

Last I was doing was writing an arduino library for esp8266, and found several issues.
The first one is esp8266 reboots if client disconnects before server close the socket. I reported this bug to espressif and amazingly, they fixed it. The second one is slow sending of data. I worked around the problem by buffering send data 256 bytes at a time and send is now at an acceptable rate. The final issue is my code currently hangs if a second client connects before the first one disconnects. I think this can be fixed in my code, but I have asked espressif for an enhancement as well.

I'm just finishing my taxes and after that, I will go full speed on working on the led controller. I think now the teensy 3.1 and esp8266-01 is a feasible combination to use for the led controller.

The esp8266 looks like a really neat module, since they provide you tools to write your code and upload it to the module. User code space is 256k which is a lot. The only limitation is there are only 3 PWM pins (at least that is the only info I found on google search). I am guessing they provided 3 pwm pins for controlling LED RGB color.
 
D40 and D42 are used for dosing pumps 2 and 3.

So the code is correct and your connection is correct.

I will check the calibration code for dosers 2 and 3.

Yes it is strange really. Today I was thinking to try using two different output pins so then i would know if problem is on that two pins or in code.
Still I think you are using same code for calibration of all 4 dosers so then this is even more strange?
 
The esp8266 looks like a really neat module, since they provide you tools to write your code and upload it to the module. User code space is 256k which is a lot. The only limitation is there are only 3 PWM pins (at least that is the only info I found on google search). I am guessing they provided 3 pwm pins for controlling LED RGB color.

Still you could connect esp8266 to external 12bit pwm chip and with this you eliminate this teensy?
In this case you use pwm ports on external pwm chip and esp8266 only receive commands and process them. In this way and with short commands esp8266 works normally?
And we still have multiple channels LED controller for light which works by wifi.
 
Getting really excited about this LED code!!

Im really glad you have moved to the auxiliary mcu for the LEDs and not just the pwm i2c chip

teensy is a great choice, Im really keen to see your code, Im learning so much about coding from what you are doing

Are you going to send an array or something of all the on-off times to the teensy so if there is a disconnection to the mega it stays on or just update the values from the mega as they change?

Not to be pushy but have you thought about storm modes and clouds and such?
 
Last edited:
I'm guessing this was probably already covered but I wasn't able to find it via the search ...

Where did you purchase the case for this project, or was it custom made? If it was custom made, do you have any details on that process?

Thanks,
Harry

this may be late reply, so you probably have the answers already.
The chauvet relay box was widely available on ebay a few years back, but seems be harder to find now. I think American DJ took over the manufacture of the relay box, since it looks exactly the same as the chauvet (the ADJ version was not available when I started on this project as far as I can recall).

you can always build your own outlet box and I have considered this route originally. But figured the cost of all parts plus the trouble of making the holes etc. would cost me more than just getting the chauvet.
 
Getting really excited about this LED code!!

Im really glad you have moved to the auxiliary mcu for the LEDs and not just the pwm i2c chip

teensy is a great choice, Im really keen to see your code, Im learning so much about coding from what you are doing

Are you going to send an array or something of all the on-off times to the teensy so if there is a disconnection to the mega it stays on or just update the values from the mega as they change?

Not to be pushy but have you thought about storm modes and clouds and such?

it will be stand alone and the chauvet will communicate with it via http, and perhaps the led will have its own web interface (not sure yet if possible, as I do not intend to add an sd card to it).
 
Last edited:
Yes it is strange really. Today I was thinking to try using two different output pins so then i would know if problem is on that two pins or in code.
Still I think you are using same code for calibration of all 4 dosers so then this is even more strange?

I got busy and have not looked into this yet. I will be able to this week.

Still you could connect esp8266 to external 12bit pwm chip and with this you eliminate this teensy?
In this case you use pwm ports on external pwm chip and esp8266 only receive commands and process them. In this way and with short commands esp8266 works normally?
And we still have multiple channels LED controller for light which works by wifi.

the problem with using esp8266 as mcu is it has extremely limited support at this time. sure it is popular due to its low cost, but pretty much all sample programs or post you see are for really simply blinky led type code. I see custom firmwares but I think the authors of those have access to non public info (like source code of the sdk).

I think the latest version of esp firmware is stable. I am able to get most of the library functions working with one final issue where once in a while, I get a send error. I am testing using arduino webserver example code with 12 browser clients running all at the same time.
 
sorry for the late reply.

D40 and D42 are used for dosing pumps 2 and 3.
D45 and D44 are used for pwm pump (jebao pump) 2 and 3.
So the code is correct and your connection is correct.

I will check the calibration code for dosers 2 and 3.

teslo, there is a bug in calibration code.
calstop function does not have code for dosers 2 and 3.

change the if then block code to this
Code:
if (i==0) {
PORTG&=~_BV(PG0);
} else if (i==1) {
PORTG&=~_BV(PG2);
} else if (i==2) {
PORTG&=~_BV(PG1);
} else {
PORTL&=~_BV(PL7);
}
I will update github this weekend with the fix.
 
I finally have all the parts and have started wiring up each component separately, but am confused with the complicated fan circuit. I saw that it was previously mentioned that it was to enable the fan to be completely turned off due to a floating ground, but I am confused as to how there is a floating ground if the arduino and fan are both connected to the same ground.

I think it may just be that I do not understand what the 4 pins on the PWM fans do. If I were to do this myself I would have connected the 2 pins for the 12V power and ground directly to the 12V power supply, then the tach and PWM pins to the arduino to read the rpm and control the speed. Why does the power for the fan need to be connected to the arduino? What does that pin do that the PWM does not? Further, why is it attached to an analog pin (perhaps this will become obvious when I understand what the circuit is accomplishing)

Thanks for the clarification.
 
quick question, on the schematic there is a feed button on pin a10, does this actually do anything and does the button go to ground? does it need any resistors? Thank You
 
I finally have all the parts and have started wiring up each component separately, but am confused with the complicated fan circuit. I saw that it was previously mentioned that it was to enable the fan to be completely turned off due to a floating ground, but I am confused as to how there is a floating ground if the arduino and fan are both connected to the same ground.

I think it may just be that I do not understand what the 4 pins on the PWM fans do. If I were to do this myself I would have connected the 2 pins for the 12V power and ground directly to the 12V power supply, then the tach and PWM pins to the arduino to read the rpm and control the speed. Why does the power for the fan need to be connected to the arduino? What does that pin do that the PWM does not? Further, why is it attached to an analog pin (perhaps this will become obvious when I understand what the circuit is accomplishing)

Thanks for the clarification.

regarding floating ground.
If you use an NPN circuit to switch 12v (like the one for peristaltic pump), you "float" the ground when the transistor is off. Since the "tach" pin is used by the circuit, the 12v then finds a path to ground via the tach connection, hence the fan never turns off. It's actually above ground, but still enough potential difference to keep the fan turning.

regarding connecting 12V of fan directly to 12v.
Computer fans will run at 30% if you set PWM to 0 (if you ground the PWM pin or leave it open). So fan does not actually turn off. With this circuit, when you set the fan to turn off, it actually turns off.

the tach pin connected to A8 and A14 does not have anything to do with it being an analog pin. They are part of PORTK and I use PORTK for pin change interrupt.
 
ok so to make sure i understand it right, it goes to the aquachef and not a button. I was hoping I could hook up a button, and push the button to turn off the return pump then it turns back on like the feed mode one the web interface, with out having to use my computer.
 
ok so to make sure i understand it right, it goes to the aquachef and not a button. I was hoping I could hook up a button, and push the button to turn off the return pump then it turns back on like the feed mode one the web interface, with out having to use my computer.

right, it is used to control the aquachef feeder. there is no hardware button equivalent to the feed mode on the web interface.
 
Back
Top