My Neptune Apex web interface compatible DIY reef controller

I think the temp issue is due to circuit problem. Either pullup resistor needs to be changed, or the sensors are using up more power than it should. I am back to 2 temp sensors for now.

The DS18B20 datasheet says a weak pullup is needed if sensor is powered externally and the value given is 5k. I'll try to change it to 5k and see what I get. I'll also order 5 DS18B20 chips to actually test the circuit on 5 sensors.

I got my parts for the pwm fan, and it is working better with the two transistor common ground circuit. The fan now fully turns off.

ok, placed order for 5 ds18b20 chips. estimate to be here next saturday.


I had a nose around the arduino site, and found this.

http://forum.arduino.cc/index.php/topic,20574.0.html

Suggests that on short cable runs a 4k7 should be fine, but some timings in the 1wire librabry may need a tweak, as the library was written with very tight parameters.

M
 
Last edited:
I think the temp issue is due to circuit problem. Either pullup resistor needs to be changed, or the sensors are using up more power than it should. I am back to 2 temp sensors for now.

The DS18B20 datasheet says a weak pullup is needed if sensor is powered externally and the value given is 5k. I'll try to change it to 5k and see what I get. I'll also order 5 DS18B20 chips to actually test the circuit on 5 sensors.

I got my parts for the pwm fan, and it is working better with the two transistor common ground circuit. The fan now fully turns off.

ok, placed order for 5 ds18b20 chips. estimate to be here next saturday.

I have my Temp sensors and 2 pH and orp on a separate 5 volt 1 amp supply
 
I have my Temp sensors and 2 pH and orp on a separate 5 volt 1 amp supply

That will rule out power supply issue.
how many temp sensors? 4?
try using an even lower pullup resistor, if you have 1k or 1.2k, try it.

I can look at the timing angle, but that will slow down the already really slow one wire protocol.

The controller's application is nowhere close to be considered long distance, like I read in the manufacturer's application notes talking about 200m distance.

after reading a little bit more, it seems the problem is timing. using a lower resistor value will make the data line go high faster. The Onewire library fix in the arduino forum only fixed the write code, I think the read code can be adjusted as well. I analyzed the onewire library when writing the temp sensor code, and as far as I can tell, it satisfies all the (minimum) timing requirement (+ a small buffer) as specified in ds18b20 datasheet. keeping current resistor value can still work if I slow it down on the software side.
 
Last edited:
I checked the ds18b20 data sheet again and the onewire library. there is a limit to how much the timing can be tweaked. I did the adjustment on the onewire library and will test it later today. I've set the timing to the maximum it can possibly be. if that still does not work, then the lower pullup resistor value I think is the next step.
 
That will rule out power supply issue.
how many temp sensors? 4?
try using an even lower pullup resistor, if you have 1k or 1.2k, try it.

I can look at the timing angle, but that will slow down the already really slow one wire protocol.

The controller's application is nowhere close to be considered long distance, like I read in the manufacturer's application notes talking about 200m distance.

after reading a little bit more, it seems the problem is timing. using a lower resistor value will make the data line go high faster. The Onewire library fix in the arduino forum only fixed the write code, I think the read code can be adjusted as well. I analyzed the onewire library when writing the temp sensor code, and as far as I can tell, it satisfies all the (minimum) timing requirement (+ a small buffer) as specified in ds18b20 datasheet. keeping current resistor value can still work if I slow it down on the software side.

I have 3 temp sensors and I can put a 1k pull up on it to see what happens

Have you looked at the DallasTemperature library. I have it on my LED controller with 3 temp sensor with no problems
 
I looked at and it is just a wrapper to OneWire library. It does nothing special, just code using OneWire library. All the wire timing is still done in the OneWire library.

I can't tell if the dallas temp library is officially written by dallas semiconductor or not, and I cannot find any datasheet for ds18b20 that is from dallas semiconductor (I assume DS means dallas semiconductor). I can only find one from maxim.

based on the maxim datasheet, the way dallas library does the convert command I'd say is not quite right (takes double the time necessary actually). The onewire example follows the datasheet from maxim exactly, which is what my code does as well.

I'd have to say adding more sensors affect the circuit capacitance. I have not had a bad reading since last night when I switched back to 2 sensors.

After reading the datasheet and the onewire library code again a few more times, the only one thing I think the onewire library is missing is where the datasheet says "sample" to read the response from the sensor. Here the onewire library reads the pin once and that's it. I think to truly sample, it must read the pin at least twice and if value is the same, then that is the correct value. I'm going to make this change and test this tonight.
 
Last edited:
I looked at and it is just a wrapper to OneWire library. It does nothing special, just code using OneWire library. All the wire timing is still done in the OneWire library.

I can't tell if the dallas temp library is officially written by dallas semiconductor or not, and I cannot find any datasheet for ds18b20 that is from dallas semiconductor (I assume DS means dallas semiconductor). I can only find one from maxim.

based on the maxim datasheet, the way dallas library does the convert command I'd say is not quite right (takes double the time necessary actually). The onewire example follows the datasheet from maxim exactly, which is what my code does as well.

I'd have to say adding more sensors affect the circuit capacitance. I have not had a bad reading since last night when I switched back to 2 sensors.

After reading the datasheet and the onewire library code again a few more times, the only one thing I think the onewire library is missing is where the datasheet says "sample" to read the response from the sensor. Here the onewire library reads the pin once and that's it. I think to truly sample, it must read the pin at least twice and if value is the same, then that is the correct value. I'm going to make this change and test this tonight.

I've had a look at my sensor logs, and I'm not seeing abnormal readings.

I dont have much data as I find I have to bit erase the SDS card each time I upload the .htm file, I think this is a MAC FAT thing, and CURL I still need to get sorted.
 
I've had a look at my sensor logs, and I'm not seeing abnormal readings.

I dont have much data as I find I have to bit erase the SDS card each time I upload the .htm file, I think this is a MAC FAT thing, and CURL I still need to get sorted.

you need to upload the index.gz instead of the index.htm, as that is the file used first. the controller returns the gzipped version of index.htm (20k vs 90k).
 
you must be using mac or linux. get the curl binary without ssl.

I see you said you are using mac.

is Scotland the newest country yet?

Voting runs for another hour and a half, we wont know till tomorrow. It is too close to call in the polls at the moment.

I have to say I understand why the SNP want to quit the UK, generally the govt by stealth is overwhelming folks lives, (in the best interests of people of course):headwalls:
 
Last edited:
d0ughboy what gzip program you are using the one that I downloaded want let me use the -k command, it deletes the index.htm but I always save it at another location.
 
Looks like I missed the Birthday post, sorry about that Doughboy, cant believe you started all this a year ago yesterday. Been busy with schooling that I have not had the time to do much of anything with the controller. I have it setup on my tank and just waiting till I can but another Mega board for testing and a another temp probe. I am currently debating whether or not I will take the controller apart again so I can add the fans or not. Wondering if there is a way to network two mega boards through a CAT5 to have them communicate so I dont have to take the controller apart. Already have it sealed up with hot glue and everything. Can only take the top off so I can add or remove stamps or rewire things from the prototype board, the Arduino itself, and and the Relay board.
 
I'm going to test the 3 Temp Sensors today on my test station, and try different resistors if I experience the same issue as others.
 
I'm going to test the 3 Temp Sensors today on my test station, and try different resistors if I experience the same issue as others.

if you have an oscilloscope, find a resistor value that will give a good almost square wave on the pulses.

if you were getting intermittent crc errors before, then by adding the third or 4th, you may get it more often.
 
Back
Top