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

BenB

Active Member
View Badges
Joined
Jun 11, 2019
Messages
118
Reaction score
152
Rating - 0%
0   0   0
@Ranjib is there a way to control servo motors from the reef-pi?
F180217E-BB00-4491-8A83-C30348305F68.jpeg

In the past i played with this:

I tried the Servo again and I found that the servo PWM needs to be in between 1 and 2 ms. 1 ms is 0dgr and 2 ms is 180dgr. Using the PCA9685 you can set the Frequency. When a frequency is used of 350Hz that means 1/350= 2.86 ms. I used the Lights tab in Reefpi and set it to manual. When the percentage is set to 17% it moves to 0dgr and 55% it moves to 90dgr and 93% to 180dgr.

1592689238567.png


After some fine-tuning when the frequency is set to 320Hz (1/320=3.125ms) i get with 17% it moves to 0dgr and 50% it moves to 90dgr and 83% to 180dgr.
I am thinking of building an auto-feeder with Servos!!!
 

Matevz Savarin

Active Member
View Badges
Joined
Dec 5, 2018
Messages
209
Reaction score
163
Rating - 0%
0   0   0
Hi I just reseted my pi after 7 months and now all data is gone... not good at all. I tried ro update my saved db file but its same.. any idea? Tnx! I have all on pi including heaters, lights, pumps.. all.. not good at all
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
My little sensor assemblies are gaining some ground from R&D. I had to toss a few ideas out, and rejected a number of epoxies, but settled on these little things in the latest batch.

IMG_7434.jpg


Real cable is by far the most expensive thing here. This is a PUR jacket, PVC inner, 3 conductor job. At a little over $1.50/ft, 8 feet of cable adds up fast. There are even fancier jacket materials, but they run $3+ a ft. Over a generic PVC cable, this is quite the expense but should make up for its self in long term reliability. I'm also trying to source as much as possible domestically, and import cables are right out for that (not going to touch them, lest I end up with some copper clad aluminum).

The capsules are are a thin wall acetal/delrin construction (0.5" diam), with bottom caps also of delrin. Inside is a _real_ DS18B20 TSOP-8 mounted on a carrier board, and a power decoupling capacitor.

IMG_7435.jpg


Finding the right potting compound took awhile. I'm currently using Loctite 870FT - not cheap, but it has the right viscosity and the cartridge dispensing is perfect for this, even if it means I lose some to the mixing nozzle - just incentive to make bigger batches. I had a number of failed potting attempts previously, and pot mix was just simply too much work.

The commercial guys are using this 5k thermistor pill, potted (with probably a non-thermal modified resin) in an acrylic tube and then heatshrunk over. I may borrow the idea of heatshrinking the cable exit of my version to just clean up the looks.

IMG_7436.jpg


More tests soon!
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,025
Location
Durban - South Africa
Rating - 0%
0   0   0
I'm trying to run the pH calibration, but it seems to have changed since I last used it. So just want to check I clean the probe in RODI. Disable the pH in reef-pi and save. Drop the probe into the 7 Buffer solution. Then hit the calibrate function. Then I'm not sure what is the best course of action. I see the "Midpoint", "Value" which can be set if different from what I want to use and "Run" Boxes. Do I just wait for the "Current Reading" value to stabilise and then hit "Run"? "Run" then turns to a tick/check mark

Then rinse and repeat with the 10 Buffer.

Is that right?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hi I just reseted my pi after 7 months and now all data is gone... not good at all. I tried ro update my saved db file but its same.. any idea? Tnx! I have all on pi including heaters, lights, pumps.. all.. not good at all
Can you share the error or the log ? Also expand what you mean by resetting pi? Reboot or reimage?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
My little sensor assemblies are gaining some ground from R&D. I had to toss a few ideas out, and rejected a number of epoxies, but settled on these little things in the latest batch.

IMG_7434.jpg


Real cable is by far the most expensive thing here. This is a PUR jacket, PVC inner, 3 conductor job. At a little over $1.50/ft, 8 feet of cable adds up fast. There are even fancier jacket materials, but they run $3+ a ft. Over a generic PVC cable, this is quite the expense but should make up for its self in long term reliability. I'm also trying to source as much as possible domestically, and import cables are right out for that (not going to touch them, lest I end up with some copper clad aluminum).

The capsules are are a thin wall acetal/delrin construction (0.5" diam), with bottom caps also of delrin. Inside is a _real_ DS18B20 TSOP-8 mounted on a carrier board, and a power decoupling capacitor.

IMG_7435.jpg


Finding the right potting compound took awhile. I'm currently using Loctite 870FT - not cheap, but it has the right viscosity and the cartridge dispensing is perfect for this, even if it means I lose some to the mixing nozzle - just incentive to make bigger batches. I had a number of failed potting attempts previously, and pot mix was just simply too much work.

The commercial guys are using this 5k thermistor pill, potted (with probably a non-thermal modified resin) in an acrylic tube and then heatshrunk over. I may borrow the idea of heatshrinking the cable exit of my version to just clean up the looks.

IMG_7436.jpg


More tests soon!
Looking awesome :-) . Keep it up
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
I like the idea of multiple busses along with additional ATO logic, Whilst this does mean that the users has to create the additional redundant network, it opens up the possibilities of more complex control schemas.

At the moment we only have

IF THIS THEN THAT

What we really need is

IF THIS AND / OR THIS THEN THAT

Then just set up two temp probes, each on a different bus. Problem solved.

It also means that the system degrades nicely. i.e. there is no loss of control of the system (i.e. the heater) in the event of a single temp probe failure or single bus issue. This is basically how a safety PLC works.

You can use the same control logic to implement redundant control for any connected device, not just heaters and temp probes. E.g. redundant float control for ATO, redundant Ph control, in fact redundant control for any device or control schema.

Plus there's the added bonus of more complex control schemas that would be available with the additional ' AND / OR THIS ' logic.

I think i asked about something similar a really long while ago with the overall stance being that reef-pi wouldn't get a programming language type feature, which i undestand. But with the HAL driver system standardizing everything, and the macro system being expanded, is that maybe something that could be looked into again? I agree that AND/OR statements, and also IF...THEN...ELSE rather than just IF...THEN would vastly increase possibilties here in regards to tinkering with stuff and layers of safety features.
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
916
Rating - 0%
0   0   0
I'm trying to run the pH calibration, but it seems to have changed since I last used it. So just want to check I clean the probe in RODI. Disable the pH in reef-pi and save. Drop the probe into the 7 Buffer solution. Then hit the calibrate function. Then I'm not sure what is the best course of action. I see the "Midpoint", "Value" which can be set if different from what I want to use and "Run" Boxes. Do I just wait for the "Current Reading" value to stabilise and then hit "Run"? "Run" then turns to a tick/check mark

Then rinse and repeat with the 10 Buffer.

Is that right?
Edit ph.
disable probe.
save
Calibrate
Rinse probe in rodi
Place in 7 calibration fluid
Wait for readings to stabilize
Set cal value to 7
Push run
Rinse probe
Put in 10 calibration fluid
Set cal value to 10
Run
Enable probe
Rinse probe and check both 7 and 10 and make sure it’s close.
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,025
Location
Durban - South Africa
Rating - 0%
0   0   0
Edit ph.
disable probe.
save
Calibrate
Rinse probe in rodi
Place in 7 calibration fluid
Wait for readings to stabilize
Set cal value to 7
Push run
Rinse probe
Put in 10 calibration fluid
Set cal value to 10
Run
Enable probe
Rinse probe and check both 7 and 10 and make sure it’s close.

Thanks. That's basically what I was doing.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I think i asked about something similar a really long while ago with the overall stance being that reef-pi wouldn't get a programming language type feature, which i undestand. But with the HAL driver system standardizing everything, and the macro system being expanded, is that maybe something that could be looked into again? I agree that AND/OR statements, and also IF...THEN...ELSE rather than just IF...THEN would vastly increase possibilties here in regards to tinkering with stuff and layers of safety features.
Support for else (as in if - else ) and combining multiple sensor values are two things I’m thinking as something we need as part of next evolution of macro.
 

Matevz Savarin

Active Member
View Badges
Joined
Dec 5, 2018
Messages
209
Reaction score
163
Rating - 0%
0   0   0
Ranjib I managed to upload db file from 6 months ago, now it works. Well all I did when all data was gone is that I added 6 led drivers and lights. After reboot nothing left in pi. Now all works again exept adafruit gets only 7 data feeeds in minute, I will play with that later.
 

sellereef

New Member
View Badges
Joined
Sep 28, 2020
Messages
4
Reaction score
2
Location
Grand Rapids
Rating - 0%
0   0   0
Has anyone setup reef-pi light controller for Mars Aqua? I am reading some things now that looks like I may need an additional converter to be able to use PWM?

Thank you!
Anyone have any thoughts with this one? I may end up with other "Standard black boxes" but I just want to be prepared
 

Carlo Rios

New Member
View Badges
Joined
Aug 14, 2020
Messages
13
Reaction score
7
Location
US
Rating - 0%
0   0   0

waynel

Active Member
View Badges
Joined
May 22, 2020
Messages
266
Reaction score
257
Location
Kentucky
Rating - 0%
0   0   0

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
Very small annoyance with a current behaviour: When i manually dose extra to correct some value, i use the calibration menu of the dosing pumps. There isn't another option, is there? Anyway, when i do that, the amount i manually dosed doesn't show up in the usage statistics in the dashboard. Which makes sense if it's for calibration, doesn't make sense for manual dosing to keep track of how much of a chemical is actually going into the tank.
 

BenB

Active Member
View Badges
Joined
Jun 11, 2019
Messages
118
Reaction score
152
Rating - 0%
0   0   0
Adding analog sensors with ADS1115

Michael Lane has been working on a new ADS1015/ADS1115 driver for reef-pi.

This brings new possibilities to Reef-Pi:
  • PH/Orp probes
  • Pressure sensors
  • Flow sensors
  • Etc.
Any analog sensor can be used as long as the analog signal is in between 2.0V to 5.5V.

ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier

ADS1115.png


ADS1115 Features:
  • Resolution: 16 Bits
  • Programmable Sample Rate: 8 to 860 Samples/Second
  • Power Supply/Logic Levels: 2.0V to 5.5V
  • Low Current Consumption: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
  • Internal Low-Drift Voltage Reference
  • Internal Oscillator
  • Internal PGA: up to x16
  • I2C Interface: 4-Pin-Selectable Addresses
  • Four Single-Ended or 2 Differential Inputs
  • Programmable Comparator
I had an ADS1115 board so I tried if my PH probe is working. So I made a “How to guide” maybe it will be of use for others. I used a Raspberry Pi 2 Model B with Reef-Pi version 3.5.

Add driver under Configuration/Drivers
1.png


Configure the Driver:
2.png

Name: PH
Type: ads1115
Address: standard is 72
Gain: 2/3, 1, 2, 4, 8 or 16

An Adafruit tutorial has this guidance.
# Choose a gain of 1 for reading voltages from 0 to 4.09V.
# Or pick a different gain to change the range of voltages that are read:
# - 2/3 = +/-6.144V (High Gain, Sensitive to noise)
# - 1 = +/-4.096V
# - 2 = +/-2.048V
# - 4 = +/-1.024V
# - 8 = +/-0.512V
# - 16 = +/-0.256V (Low Gain, Not Sensitive to Noise)
# See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.

Reboot (Configuration/Admin)

Add analog input under Configuration/Connectors
3.png


Configure the connector
4.png

Name: PHpin0
Pins: 0 (depends what pin you use on the ADS1115 board)
Driver: PH
Reload (Configuration/Admin)

Add the probe under pH
5.png


Configure the PH probe
6.png

Name: PH
Analog input: PHpin0
Check frequency: 10
Ph status: Enabled
The other settings are not mandatory.

Calibration
The first readings will be high:
7.png

Therefore you need to calibrate!

To be able to calibrate you first have to disable the Ph status
  • Edit ph.
  • Disable probe.
  • Save
  • Calibrate
  • Rinse probe in rodi
  • Place in 7 calibration fluid
  • Wait for readings to stabilize
  • Set cal value to 7 (Midpoint)
  • Push Run
  • Rinse probe
  • Put in 10 calibration fluid
  • Set cal value to 10 (Second Point)
  • Run
  • Enable probe
  • Rinse probe and check both 7 and 10 and make sure it’s close.
Enjoy!
 

BenB

Active Member
View Badges
Joined
Jun 11, 2019
Messages
118
Reaction score
152
Rating - 0%
0   0   0
Adding analog sensors with ADS1115

Michael Lane has been working on a new ADS1015/ADS1115 driver for reef-pi.

This brings new possibilities to Reef-Pi:
  • PH/Orp probes
  • Pressure sensors
  • Flow sensors
  • Etc.
Any analog sensor can be used as long as the analog signal is in between 2.0V to 5.5V.

ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier

ADS1115.png


ADS1115 Features:
  • Resolution: 16 Bits
  • Programmable Sample Rate: 8 to 860 Samples/Second
  • Power Supply/Logic Levels: 2.0V to 5.5V
  • Low Current Consumption: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
  • Internal Low-Drift Voltage Reference
  • Internal Oscillator
  • Internal PGA: up to x16
  • I2C Interface: 4-Pin-Selectable Addresses
  • Four Single-Ended or 2 Differential Inputs
  • Programmable Comparator
I had an ADS1115 board so I tried if my PH probe is working. So I made a “How to guide” maybe it will be of use for others. I used a Raspberry Pi 2 Model B with Reef-Pi version 3.5.

Add driver under Configuration/Drivers
1.png


Configure the Driver:
2.png

Name: PH
Type: ads1115
Address: standard is 72
Gain: 2/3, 1, 2, 4, 8 or 16

An Adafruit tutorial has this guidance.
# Choose a gain of 1 for reading voltages from 0 to 4.09V.
# Or pick a different gain to change the range of voltages that are read:
# - 2/3 = +/-6.144V (High Gain, Sensitive to noise)
# - 1 = +/-4.096V
# - 2 = +/-2.048V
# - 4 = +/-1.024V
# - 8 = +/-0.512V
# - 16 = +/-0.256V (Low Gain, Not Sensitive to Noise)
# See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.

Reboot (Configuration/Admin)

Add analog input under Configuration/Connectors
3.png


Configure the connector
4.png

Name: PHpin0
Pins: 0 (depends what pin you use on the ADS1115 board)
Driver: PH
Reload (Configuration/Admin)

Add the probe under pH
5.png


Configure the PH probe
6.png

Name: PH
Analog input: PHpin0
Check frequency: 10
Ph status: Enabled
The other settings are not mandatory.

Calibration
The first readings will be high:
7.png

Therefore you need to calibrate!

To be able to calibrate you first have to disable the Ph status
  • Edit ph.
  • Disable probe.
  • Save
  • Calibrate
  • Rinse probe in rodi
  • Place in 7 calibration fluid
  • Wait for readings to stabilize
  • Set cal value to 7 (Midpoint)
  • Push Run
  • Rinse probe
  • Put in 10 calibration fluid
  • Set cal value to 10 (Second Point)
  • Run
  • Enable probe
  • Rinse probe and check both 7 and 10 and make sure it’s close.
Enjoy!
I forgot to at a picture of the setup:
.
20201008_201240.jpg
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I forgot to at a picture of the setup:
.
20201008_201240.jpg
Thank you for sharing this . Looks awesome :-) . This opens up the possibility to tinker with all sorts of analog sensors (tds meters etc)
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
I've always shied away from including a ph sensor due to the high cost for little perceived value, but with the ADC i could use cheap chinesium sensor+board kits for 20€ and maybe upgrade to a better probe later, how practicable is that?

Or would that be so useless that i shouldn't even bother?
 
Last edited:

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 37 27.0%
  • 100% dry rock + 100% live sand

    Votes: 46 33.6%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 21.9%
  • 75% live rock, 25% live sand

    Votes: 14 10.2%
  • 25% live rock, 75% live sand

    Votes: 10 7.3%
Back
Top