reef-pi :: An opensource reef tank controller based on Raspberry Pi.

OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I originally had the probes hooked up GPIO3 and GPIO4, but after reading through the adafruit tutorial, connected them in parallel like this, to just GPIO 4, sharing a 4.7K resistor.

4cc3dc9f55d6df5abd356176ca93cc51.jpg


3414e1ae371c62b546ce9789b1043d2d.jpg


sorry if the pictures are crappy, once I figure out everything on the software and, I was planning to clean up the wiring.
Pictures are awesome :-) . It is the gpio settings that I was looking for.

Well, if raspbian can support multiple probes, I dont see any reason not to support them in reef-pi. The only challenge I see with multiple probes is how can I detect what device (in raspbian , /sys/bus .. ) represent which probe. i.e. from reef-pi I can detect that there are multiple probe and show temperatures from all of them, but it will be hard to say which one represent the sump , which one tank etc... thoughts? or it does not matter ?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Multiple temperature sensors can be extremely useful. I have tons of temperature sensors on my tank. Here are a few useful/fun tricks you can do with multiple temperature sensors.

sump temp 1 != sump temp 2: one of the sensors has failed probably a good idea to turn off the heater if either is high.
tank temp != sump temp: sump pump failure: send me an urgent email
room temp < stand temp: speed up stand ventilation fan
metal halide temperature = room temperature: lights are not on - if they are supposed to be cut power and then turn power back on to reboot.
Sorry if I was not clear, I am sure that multiple probes will be useful , its just that the stock raspbian kernel (when I last checked) didn't support multiple ds18b20. Looks like this is not the case any more,, i think the patches I noticed last time in raspbian kernel mailing list is now merge (debian stretch release version) ..

I stand corrected :0) , and I am happy about that
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
could you please walk me through how you set your reef-pi up and your telemetry.
reef-pi wont work with multiple probe. I can walk you through single probe telemetry integration, if thats something useful,
 

AshwinRavi

Active Member
View Badges
Joined
May 23, 2017
Messages
374
Reaction score
519
Location
Pittsburgh, PA
Rating - 0%
0   0   0
Pictures are awesome :-) . It is the gpio settings that I was looking for.

Well, if raspbian can support multiple probes, I dont see any reason not to support them in reef-pi. The only challenge I see with multiple probes is how can I detect what device (in raspbian , /sys/bus .. ) represent which probe. i.e. from reef-pi I can detect that there are multiple probe and show temperatures from all of them, but it will be hard to say which one represent the sump , which one tank etc... thoughts? or it does not matter ?
what about labelling them as sump and display on telemetry once I figure out which one is which physically? is that viable?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
i guess I got confused, I have reef-pi working with 1 probe and telemetry added just fine. Thanks.
hmm.. so , its fine if reef-pi just shows the physical address of individual probe, and let you add a label (sump, DT etc) for each one of them .. ?
 

cypho

Community Member
View Badges
Joined
Nov 24, 2015
Messages
78
Reaction score
67
Rating - 0%
0   0   0
could you please walk me through how you set your reef-pi up and your telemetry.

I started with a PiB (original) in early 2015. Later updated to Pi2B and now on Pi3B. Never had any problems with multiple temp sensors. Default raspbian install. Just wire them in and they all show up in the /sys/bus/w1/devices folder. One of the few things that worked on my first try.

Wired like this. https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/hardware
The DS18B20 "1-wire" sensors can be connected in parallel - unlike nearly any other sensor sold! All sensors should share the same pins, but you only need one 4.7K resistor for all of them



Here is the python code i use to read the sensors
Code:
    def read_sensor(self):
    
        lines = self._read_temp_raw()
        if lines is None:
            raise ValueError("sensor returned no data".format(lines))
        if lines[0].strip()[-3:] != 'YES':
            raise ValueError("cannot find Yes in: {0}".format(lines))
        equals_pos = lines[1].find('t=')
        if equals_pos == -1:
            raise ValueError("cannot find t= in: {0}".format(lines))
        temp_string = lines[1][equals_pos+2:]
        temp_c = float(temp_string) / 1000.0
        if temp_c > 80 or temp_c < 1:
            raise ValueError("temperature out of range: {0}".format(temp_c))
        else:
            return {"C":float(temp_c),"F":float(float(temp_c) *9.0/5.0+32.0)}
 
    def _read_temp_raw(self):
        t = '/sys/bus/w1/devices/' + self._address + '/w1_slave'
    
        if not os.path.exists(t):
            raise ValueError("sensor not found: ".format(self._address))
    
        with open(t, 'r') as f:
            lines = f.readlines()
    
        return lines
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I started with a PiB (original) in early 2015. Later updated to Pi2B and now on Pi3B. Never had any problems with multiple temp sensors. Default raspbian install. Just wire them in and they all show up. One of the few things that worked on my first try.

Wired like this. https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/hardware




Here is the python code i use to read the sensors
Code:
    def read_sensor(self):
    
        lines = self._read_temp_raw()
        if lines is None:
            raise ValueError("sensor returned no data".format(lines))
        if lines[0].strip()[-3:] != 'YES':
            raise ValueError("cannot find Yes in: {0}".format(lines))
        equals_pos = lines[1].find('t=')
        if equals_pos == -1:
            raise ValueError("cannot find t= in: {0}".format(lines))
        temp_string = lines[1][equals_pos+2:]
        temp_c = float(temp_string) / 1000.0
        if temp_c > 80 or temp_c < 1:
            raise ValueError("temperature out of range: {0}".format(temp_c))
        else:
            return {"C":float(temp_c),"F":float(float(temp_c) *9.0/5.0+32.0)}
 
    def _read_temp_raw(self):
        t = '/sys/bus/w1/devices/' + self._address + '/w1_slave'
    
        if not os.path.exists(t):
            raise ValueError("sensor not found: ".format(self._address))
    
        with open(t, 'r') as f:
            lines = f.readlines()
    
        return lines
Embarrassed to say that this is a silly mistake made by me. I think I confused the fixed GPIO (4) with multiple probes, and read all the patches that involve hooking up multiple probes in multiple GPIOs. Clearly I am a stupid :0/

Stay put good fellas, patch is coming this week to support multiple probe.
 

AshwinRavi

Active Member
View Badges
Joined
May 23, 2017
Messages
374
Reaction score
519
Location
Pittsburgh, PA
Rating - 0%
0   0   0
Good evening everyone! I have my heater plugged into one of the 8 channel relays and have it configured on reef-pi and works fine. Is there a way I can control the heater to go on and off depending on the temperature from DS18B20? I see the option to control on reef-pi UI, but not sure how it works exactly.
c64024cad191ed3a7eeb1075650b0db6.jpg
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Good evening everyone! I have my heater plugged into one of the 8 channel relays and have it configured on reef-pi and works fine. Is there a way I can control the heater to go on and off depending on the temperature from DS18B20? I see the option to control on reef-pi UI, but not sure how it works exactly.
c64024cad191ed3a7eeb1075650b0db6.jpg
Specify the grio PIN numbers that are controlling the relay which in turn control heater and cooler ( if present). The UI is clunky , and confusing for this. I have changed it two days back, so in latest reef pi you get to choose the cooler & heater from a drop down menu of available equipments
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Good evening everyone! I have my heater plugged into one of the 8 channel relays and have it configured on reef-pi and works fine. Is there a way I can control the heater to go on and off depending on the temperature from DS18B20? I see the option to control on reef-pi UI, but not sure how it works exactly.
c64024cad191ed3a7eeb1075650b0db6.jpg
Reef-pi will turn on the heater when temperature goes below the specified minimum threshold and turn on cooler if it’s above the max threshold. The PIN number represents grip pins that are connected to relay
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Reef-pi will turn on the heater when temperature goes below the specified minimum threshold and turn on cooler if it’s above the max threshold. The PIN number represents grip pins that are connected to relay
I you don’t have cooler hooked up ( I us a fan) then assign an unused gpio pin
 

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
Cary, I'm not sure if you are still stuck on this or not.
My new Pi and SD card are coming in today (I was borrowing the other from a friend).
I will start over from scratch on this new one, and try to set it up completely remotely. I will document as I go for this startup.
 

AshwinRavi

Active Member
View Badges
Joined
May 23, 2017
Messages
374
Reaction score
519
Location
Pittsburgh, PA
Rating - 0%
0   0   0
Reef-pi will turn on the heater when temperature goes below the specified minimum threshold and turn on cooler if it’s above the max threshold. The PIN number represents grip pins that are connected to relay
Hi Ranjib,

I have the control enabled on temperature tab and I have the heater and fans connected to channel 1(GPIO pin 26) and 2(GPIO pin 19) on the relay respectively.
f1065b2af4290a686047b4875e73080b.jpg


I also have the heater and fans added to the equipment tab here, and it works perfectly from the on and off toggle switch here.

for some reason, I just couldn't seem to get automatic control going, I played with the minimum and maximum threshold to see if it would kick on the heater or cooler and nothing happens, strangely if the temp goes above maximum threshold, it stops recording temperature. not sure what I am doing wrong here.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hi Ranjib,

I have the control enabled on temperature tab and I have the heater and fans connected to channel 1(GPIO pin 26) and 2(GPIO pin 19) on the relay respectively.
f1065b2af4290a686047b4875e73080b.jpg


I also have the heater and fans added to the equipment tab here, and it works perfectly from the on and off toggle switch here.

for some reason, I just couldn't seem to get automatic control going, I played with the minimum and maximum threshold to see if it would kick on the heater or cooler and nothing happens, strangely if the temp goes above maximum threshold, it stops recording temperature. not sure what I am doing wrong here.
Do you have the log by any chance? I'll test it out tonight again with the version you are using, and confirm if I can reproduce.
Sorry for the pain, and thank you for testing it out.
 

AshwinRavi

Active Member
View Badges
Joined
May 23, 2017
Messages
374
Reaction score
519
Location
Pittsburgh, PA
Rating - 0%
0   0   0
Do you have the log by any chance? I'll test it out tonight again with the version you are using, and confirm if I can reproduce.
Sorry for the pain, and thank you for testing it out.
please don't be sorry, I should be the one thanking you for all the amazing work you have done!!! I have no technical knowledge what so ever and what you have done here is simply amazing.
fadf37200932573cbe1dfdfaa04be864.jpg
 

TOP 10 Trending Threads

DO YOU THINK TECHNOLOGICAL ADVANCEMENTS ARE MORE HELPFUL OR HURTFUL TO REEFING?

  • More helpful.

    Votes: 52 41.9%
  • More hurtful.

    Votes: 5 4.0%
  • I think it depends mostly on the technology.

    Votes: 48 38.7%
  • I think it dependsmostly on the reefer behind the technology.

    Votes: 37 29.8%
Back
Top
Home
Post thread…
Market
What's new