My Neptune Apex web interface compatible DIY reef controller

Damn if only a 328 had one more pwm pin would make the ultimate slave light controller
:/ and only $4, cheaper then a bloody pcf chip
 
Last edited:
Damn if only a 328 had one more pwm pin would make the ultimate slave light controller
:/ and only $4, cheaper then a bloody pcf chip

pcf857x does not do PWM. It is an i2c shift register.

the pca9685 is the chip that does pwm, and it costs quite a bit more ($17).

if you only need it to go high or low, then the 328 chip provides 18 pins for that (20 if you use arduino pro mini and costs $2.50 only). So it actually has more than the pcf8575 (16 pins).
 
D0ughb0y,

Trying to get my head around why the need for precise fan speed?

I can understand the need to know that that the fans are spinning, but given the demand on the processor, or its support logic it seems overkill.

M
 
D0ughb0y,

Trying to get my head around why the need for precise fan speed?

I can understand the need to know that that the fans are spinning, but given the demand on the processor, or its support logic it seems overkill.

M

I'm getting a reading as high as 6000rpm on a fan rated for 1200rpm.
On my simple test program with essentially the same code, I get reading within +/- 20 rpm at max speed.

I have not figured out yet why the discrepancy, considering pin change interrupt has quite a high priority in the interrupt priority chain.

I'm going to try one variation of the current code first before I try the input capture method. The input capture feature looks quite useful, I'm not sure why arduino designer decided to only use 2 out of 4 available pins. The other 2 pins are simply not connected on the mega board.
 
Last edited:
I'm getting a reading as high as 6000rpm on a fan rated for 1200rpm.
On my simple test program with essentially the same code, I get reading within +/- 20 rpm at max speed.

I have not figured out yet why the discrepancy, considering pin change interrupt has quite a high priority in the interrupt priority chain.

I'm going to try one variation of the current code first before I try the input capture method. The input capture feature looks quite useful, I'm not sure why arduino designer decided to only use 2 out of 4 available pins. The other 2 pins are simply not connected on the mega board.

Probably a dumb question, is there a decoupling cap accros the fan pwr pins, or is it possible the tach is 3:1 or 4:1 pulses per rev, as many fans are?
 
Last edited:
all fans I have are 2:1, and the first thing I did was to check the signal on an oscilloscope and the signal looks like a perfect square wave and the cycle time is correct. I have code for both options done and will test tonight.
 
I'll setup my cond probe tonight and see how mine works. I have not used it since the day I tested it to get the cond code to work. If you have another arduino, you can run it there using the atlas sketch to see how it works.

I found a bug in the new code that is causing the bad fan rpm reading. I fixed it and everything looks stable now. I will finalize the code for fan this weekend.
 
anyone having problem with there conductivity probe, mines kept reading different reading over 24 hour time

overnight, my SG reading just drifted down from 30 to 28.5, probably due to decrease in temp. There were a couple spike readings, one 43 and one 62, but I removed the range restriction code on my setup. I am going to try to add the temp compensation to see if it makes the Salinity reading not drift as much. I now realize I've been running my tank for years at salinity of 30. I have to slowly adjust it to increase to 35.
 
btw, wgraham, I forgot to mention, I had to modify the initialization code for EZO sensors a little. I had to split off the first \r, otherwise, it was not initializing on mine. I have not checked in this fix yet, but the change is this

Code:
    if (data.type==_cond) { //set conductivity stamp to return SG only, K=1.0
      data.saddr.print("\r");
      delay(1000);
      data.saddr.print("response,0\rl,1\rc,0\ro,ec,0\ro,tds,0\ro,sg,0\ro,s,1\rk,1.0\rr\r");
    } else

I set L,1 for now to keep the LED on so I can see on my test setup that the atlas stamp is working fine (green and cyan light only, no red).
 
btw, wgraham, I forgot to mention, I had to modify the initialization code for EZO sensors a little. I had to split off the first \r, otherwise, it was not initializing on mine. I have not checked in this fix yet, but the change is this

Code:
    if (data.type==_cond) { //set conductivity stamp to return SG only, K=1.0
      data.saddr.print("\r");
      delay(1000);
      data.saddr.print("response,0\rl,1\rc,0\ro,ec,0\ro,tds,0\ro,sg,0\ro,s,1\rk,1.0\rr\r");
    } else

I set L,1 for now to keep the LED on so I can see on my test setup that the atlas stamp is working fine (green and cyan light only, no red).


Okay I will put it in the code today thanks, just checked my log in the one I got initialized okay.

I was wondering that the changes could be temperature related.

When mines drops down I can move it around in the sump and it would go to a different reading

Also why do you have the response to 0 and C to 0. Just want to understand.
 
overnight, my SG reading just drifted down from 30 to 28.5, probably due to decrease in temp. There were a couple spike readings, one 43 and one 62, but I removed the range restriction code on my setup. I am going to try to add the temp compensation to see if it makes the Salinity reading not drift as much. I now realize I've been running my tank for years at salinity of 30. I have to slowly adjust it to increase to 35.

My refractometer was reading 1.020 and the sensor was reading 35 sometimes and go to 30 sometimes. So I recal the sensor and increase my salinity to the new cal. So I don't know which to believe now.
 
Okay I will put it in the code today thanks, just checked my log in the one I got initialized okay.

I was wondering that the changes could be temperature related.

When mines drops down I can move it around in the sump and it would go to a different reading

Also why do you have the response to 0 and C to 0. Just want to understand.

c.0 is to turn off continuous mode. I do that even on the old serial ph stamp. I control the reading by sending r\r.
the old stamps do not return response string, hence I turn it off on ezo stamp using response,0 so I don't have to add more code to parse the response.
 
My refractometer was reading 1.020 and the sensor was reading 35 sometimes and go to 30 sometimes. So I recal the sensor and increase my salinity to the new cal. So I don't know which to believe now.

I think I have not calibrated my refractometer since I first bought it, maybe over 5 years ago. I will try my trusty old hydrometer tonight, as Archimedes' principle is time tested and does not depend on any tech. I have a feeling the cond sensor is correct, since I know I put in less salt (maybe half cup less for 5 gal mix) than what is called for when I do my salt mix yet the refractometer shows I am at the SG I want.
 
c.0 is to turn off continuous mode. I do that even on the old serial ph stamp. I control the reading by sending r\r.
the old stamps do not return response string, hence I turn it off on ezo stamp using response,0 so I don't have to add more code to parse the response.

Okay thanks for explaining
 
since this morning, I can see my salinity value slowly drifting back up as temp slowly rise. I'll add the temp compensation code and see if the salinity reading will drift less.
 
since this morning, I can see my salinity value slowly drifting back up as temp slowly rise. I'll add the temp compensation code and see if the salinity reading will drift less.

I did temp compensate my Conductivity probe with getTemp().

I found this worked really well, does get Temp() get calculated each tie it is called, just I think I am noticing that the loop time is getting longer?

M
 
I think I have not calibrated my refractometer since I first bought it, maybe over 5 years ago. I will try my trusty old hydrometer tonight, as Archimedes' principle is time tested and does not depend on any tech. I have a feeling the cond sensor is correct, since I know I put in less salt (maybe half cup less for 5 gal mix) than what is called for when I do my salt mix yet the refractometer shows I am at the SG I want.

Let me know what you come up with and how to put temp compensation in the code.

Will getting the calibration fluid to the tank temperature before calibrating the probe help.
 
yes, that is the idea, to use temp compensation, the calibration itself must be temp compensated. I think if you know the ambient, then you can use that as the temp for calibration.
 
Back
Top