My Neptune Apex web interface compatible DIY reef controller

d0ughb0y what is the max temp you circuit can handle, I would like to monitor my leds heatsink

in theory, no limit, but practically, until arduino sram is all used up.
The way it is coded, it will take up ~540us on each loop pass, regardless of number of temp sensors. It will just take longer to cylcle back to the first sensor.

I was going to add a third temp sensor to my controller but the 6 way splitter I got broke the stereo plug of my second temp sensor (the tip of the plug got pulled off and is left inside the jack). So I'm back to two temp sensors.
 
I added this pcb mounted ds18b20 chip for ambient temp sensor. I think the LED is causing the reading to be about 2F higher. I think you are better off just getting the DS18B20 chip and gluing it to the heatsink with thermal glue of some kind. Do you have FAN on your LED? What controller do you currently use to control the LED? I did a little bit more research, and found that computer fan pwm runs at 25khz, and the 4wire fans gives the RPM info. So I'll probably code my fan control for 4 wire fans and display the RPM of the fan and set an alarm if fan stops spinning. The fan pwm frequency is 25khz so it is above audible range. So I think I'll use a PWM frequency closer to 100hz for my LED PWM so it is below audible range.


ke54K6l.jpg


ok, I researched cpu fans a bit more and it seems the more common fan is the 3 pin fan, where there is no pwm speed control but the third pin gives the rpm information. I found a link where someone controls the 3 pin fan by doing pwm directly on the +12v power. In any case, I don't think pwm control to fan is really needed. Just a temp sensor to control on and off should be sufficient. The rpm reading I think is useful though, although you can probably set the alarm and turn off led if the temp reading is not coming down even if the fan is on.
 
Last edited:
I vote for the 4 Pin fans :)

I'm using those to vent my stand. 2 x 120mm fans. One doing intake and another doing exhaust. However I'm just using an outlet to turn them on and off.
 
I can do 4 pins, and can make it work with 3 pins as well. The 12v line will come from the controller 12v, so make sure the 12v power supply you get for the controller has enough amps. I don't have a 4 pin fan, so I'll have to get one from newegg or frys.

for led's, my initial design is as follows:

set the levels for each channel to get the desired combined color, one for day and one for night.
set the max brightness for day and for night
the default will just use sunrise/sunset times for some coral reef location (maybe great barrier reef so season is opposite), and will ramp up to noon and ramp down to sunset using sine function. With sine function, 1/3 of the time will be above 87%, 1/3 will be betwen 50% and 87%, and 1/3 is 0% to 50%. I'll probably add a noon length setting, where you can specify the minutes you want noon to last (noon=100% of brightness).
This gives you varying sunrise/sunset times and day length. I think the day length range is between 11-13 hours. If noon is 90degrees, where sine(90)=1.0 (max brightness), sine(60)=0.866 and sine(30)=0.5.

I'll code such that you can swap the updateLED function with your own custom function. The calculation of sunrise, sunset and moonphase is done once a day after midnight. The rest of the (integer) calculations are done in the interrupt routines.

I'll remove the 10v pwm circuit from the diagram, as I think 10v pwm is obsolete. I'll initially be using 16bit resolution 250hz pwm. I can change that later if needed.
 
I'll probably add a noon length setting, where you can specify the minutes you want noon to last (noon=100% of brightness).

Do you mean 100% brightness or 100% based off of the max brightness? Most people don't run LED's at 100% on their system. So there needs to be a max_brightness value and noon should be 100% sign at the max_brightness value. Correct? Krazie:jester:
 
d0ughb0y -

ATO I noticed, that it turns the pump off right after the ATO Lower Float Sensor is set back to Open, but the Upper is Closed. By design? Just curious.
 
Do you mean 100% brightness or 100% based off of the max brightness? Most people don't run LED's at 100% on their system. So there needs to be a max_brightness value and noon should be 100% sign at the max_brightness value. Correct? Krazie:jester:

yes, 100% of the max brightness you set.

most don't run 100%, but say if you set max brightness to 100%, using the sine function, you will actually be at 100% for a very short time (probably 4 minutes ). Although as I described, 1/3 of the day length will be above 86%.

buy yes, say you set max brightness to only 80%, but you want guaranteed noon brightness (80% of led full brightness) for 4 hours, then you set noon length to 4 hours. Then the program will ramp up from sunrise to noon-2hours, then ramp down from noon+2 hours to sunset. This way, your upper 1/3 length will still vary by season.

noon by definition is exactly halfway between sunrise and sunset.
 
Last edited:
d0ughb0y -

ATO I noticed, that it turns the pump off right after the ATO Lower Float Sensor is set back to Open, but the Upper is Closed. By design? Just curious.

if float switch float is down, status is closed.
so in normal operation, upper float will be closed, lower float will be open until water runs low, then it will close.

the upper float will open if the lower float does not open and will turn off the ato pump.
just your standard 2 float ATO configuration.

I think some ATO float swtiches has reversible Normally Open or Normally Closed setting (by turning the switch upside down). You can change the logic to inverted in the code depending on your switch.
 
regarding pwm fans, I'll probably support 4 fans. Since the circuit is really out of pwm pins, I'll be bit banging 4 regular pins, the only constraint is there will only be 10 speed levels (instead of 256 levels for 8 bit pwm).

25hkz has period of 40us. I can bit bang every 4us the 4 lines to get the desired pwm duty cycle.
 
if float switch float is down, status is closed.
so in normal operation, upper float will be closed, lower float will be open until water runs low, then it will close.

the upper float will open if the lower float does not open and will turn off the ato pump.
just your standard 2 float ATO configuration.

I think some ATO float swtiches has reversible Normally Open or Normally Closed setting (by turning the switch upside down). You can change the logic to inverted in the code depending on your switch.

Thanks, Just wanted to validate.

BTW I added a second pH stamp, but from some reason on the latest code, when it boots it hangs when initializing pH. I'll play with it some more to find out what that issue is.
 
If you have any of the DIY floats you can easily change the open/close by flipping the float on the stem. I had to do this to my float to get the correct state for my float.
 
If you have any of the DIY floats you can easily change the open/close by flipping the float on the stem. I had to do this to my float to get the correct state for my float.

some float switch may not have this feature. if this is the case, you can always mount the switch upside down.
 
Ever thought about adding one of these? I was thinking about doing that, so I could run minimum wiring from my controller to my LED Fixture. House everything needed in my LED Fixture.

http://www.adafruit.com/products/815

how about using hdmi cable.

the Wire library code has to be run in main loop. you can do this if you think a few seconds lag is ok.

I can see if accessing i2c registers directly is feasible.

do you know how far you can run i2c wires? I can't find any specs for it. And bus speed may have to be set to 100khz.
 
Last edited:
ok, I think a few seconds lag is irrelevant. even updating the led brightness once a minute will work.

if solar elevation angle goes from 0 to 90 say in 6 hours (3600 minutes), then it will take about 4 minutes to move 1 degree. The difference between sin(0) and sin(1) is about 10 points on 16 bit resolution, hence a couple points per minute should be insignificant. I guess I was overthinking this.

I suppose it should be ok if you use cat5 cable to run i2c signal for a few meters.

I guess it is the end user's call whether to run 7 wires (less if not using all channels) and no additional component and code vs run 3 wires plus added component and code. Each fan will require 3 lines + common ground, plus the temp sensor. So with i2c, you will need at least 6 wires if you use 1 fan and 1 temp sensor.
 
Last edited:
I started writing a test program for a 3 pin fan, and found out bit banging is not feasible, due to the high pwm frequency required. I tried the standard arduino pwm, and I can hear a sound coming from the fan, so I think 25khz pwm is really needed. This means pwm speed control for fan will have to use a pwm pin. I'm trying to see if I can use the pin9 pwm to run at 25khz. I probably have to drop the idea of pwm control for 3 pin fan.

The 4 pin fan I ordered won't arrive till next wednesday (slow free shipping).

I was initially thinking of supporting 4 dosers and 4 fans to use all 8 lines of uln2803. I can still do 4 dosers (just a minor change), and 4 fans with no pwm control (just on/off), and with rpm reading. Well, one with pwm control once I get pwm pin9 to work. (running 4 fans will need to make sure 12v power supply has enough amps or can use a supplemental 12v wall wart to power the fans, connected to uln2803 com pin and to fan +v pin).

I was planning a ramp function for the fan. Something like

temp > 79 fan 30% //fan turns on at 30%
temp > 82 fan 100% //or lower max rpm if 100% is too noisy

fan rpm will then ramp linearly up as temp goes up to 82.
 
d0ughb0y - FYI, Bestbuy has 120mm PWM Fans on sale right now for 10 bucks. Thats were I picked up mine for my stand.
 
I don't see any 120mm pwm fan for $10 listed in their website.
there is one 120mm 4pin for $9.99, but that it has fixed 1200rpm speed.

nvm, I think this one is pwm for $6.99
http://www.bestbuy.com/site/rocketfish-120mm-case-fan/9462654.p?id=1218108988841&skuId=9462654&st=pwm%20fan&cp=1&lp=1

the closest store does not have it in stock. I'll go to the next closest one and pick up a couple today. If I had it shipped, it will arrive next wednesday as well. I want to work on this over the long weekend.

I think to get all 4 pwm, led must give up 3 pwm lines, so that leaves 3 16bit pwm and 1 8 bit pwm for led. there's always the option to use the pca9685 pwm chip.
 
Last edited:
http://www.bestbuy.com/site/insigni...721&skuId=3648006&st=120mm case fan&cp=1&lp=2

This is the Fan I bought. It does support different speeds. I went and got the specs from the manufacturer website before picking 2 up.

As for giving up PWM, I think using the module I mentioned earlier from Adafruit, could be dedicated just for LEDs. It's more channels than needed, but they will all live in one spot. That's my thought. (Now that I think about it, It's the same chip, so ignore the Village Idiot over here ;p )
 
Last edited:
Back
Top