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

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
Hey guys I am trying to find the wiring diagram to connect up a Jebao slave dosing pump to the PC9685 to be controlled with reef-pi. I am sure I have seen it here somewhere but it is probably buried.

I think the most simple way is to run it through a ULN2803. This is the design I use on my dosing pump adapter. It's an open source design, and you can find files at https://github.com/Ranthalion/JebaoDosingAdapter.

It shouldn't be necessary to double up the channels on the ULN, but they are available and I've another reefer had issues with a single motor pulling much more current than expected.

C1 and R1 are totally optional. My pump is running without those, but I figured they wouldn't hurt...

1592764920144.png


1592764850454.png
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
Fellows, is there any reason not to run my lights also on the PCA9685 as my doser takes up 4 channels already, I only need to use four for the lights. I was using an Arduino Uno with stormx firmware, I blew it up last week, I got the replacement Uno, now it seems the RTC and PCA 9685 got damaged too! I can't wait another week for the parts to turn up, it should take only 2-3 hours get hook up on the pi I guess.
It's almost certainly fine to run your lights and doser on the same PCA9685. I've been doing the same thing for quite some time now. I'm using 800 Hz to control Mars Aqua, Viparspectra, and Jebao doser.

It does depend on the frequency, but it should be fine as long as the lights and doser can work with the same pwm frequency.
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
Hi Everyone, I am currently on 2.0 RC2, is there anymore to upgrading than running this code and re configuring sensors?
wget -c https://github.com/reef-pi/reef-pi/releases/download/3.0/reef-pi-3.0-pi0.deb

sudo dpkg -i reef-pi-3.0-pi0.deb

Thanks
We've made significant changes to reef-pi in 3.0 compared to 2.0. I recommend backing up your reef-pi.db configuration (or even the whole SD card) before upgrading. The latest release is 3.4 and includes many new drivers and several bug fixes.

This is assuming you are using pi zero based on the snippets in your post. It stops reef-pi, backs up the reef-pi.db in case you want to revert, then it downloads reef-pi and installs it. I would run each line one by one.

Code:
sudo systemctl stop reef-pi.service 

sudo cp /var/lib/reef-pi/reef-pi.db /var/lib/reef-pi/reef-pi.db.bak
sudo rm -rf /var/lib/reef-pi/reef-pi.db 

wget -c https://github.com/reef-pi/reef-pi/releases/download/3.4/reef-pi-3.4-pi0.deb
sudo dpkg -i reef-pi-3.4-pi0.deb

Upgrading to reef-pi 3 will basically require setting up the configuration from scratch. You'll need to delete the existing reef-pi.db file prior to installing reef-pi.

Once you have reef-pi installed again, you'll need to perform the following steps.
1. Enable your desired Capabilities, reload, and refresh the page.
2. Configure drivers on Configuration | Drivers tab. This is where you will add PCA9685, ph board, or any other hardware interfaces.
3. Set up connectors (jacks, outlets, inlets) on Configuration | Connectors tab.
4. Go through the other tabs to set up whatever equipment and sensors you have.
 

stefanm

Active Member
View Badges
Joined
Oct 11, 2017
Messages
360
Reaction score
394
Location
Sweden
Rating - 0%
0   0   0
It's almost certainly fine to run your lights and doser on the same PCA9685. I've been doing the same thing for quite some time now. I'm using 800 Hz to control Mars Aqua, Viparspectra, and Jebao doser.

It does depend on the frequency, but it should be fine as long as the lights and doser can work with the same pwm frequency.

Thanks, I'm using LDD's so they work between 100 to 1KHz and Jebao DP4s via L293D which is working on the default 100hz, so there should'nt be an issue, I've ran the doser on 800 and 1500 hz too without any problem.

I'll update once I've given it a try tomorrow, I've set it up on the Pi already, so just the fiddley hardware side to do!
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
What’s the max current draw on the 2803?

The datasheet specifies 500 mA in the summary description and Absolute Maximum Ratings sections. Ideally, you should stay well below the maximum current draw in normal operation. You also can't run 500 mA through all channels at the same time.
 

denniscahill

Community Member
View Badges
Joined
Jun 12, 2019
Messages
37
Reaction score
50
Rating - 0%
0   0   0
Any updates on the temp probe issue with 3.4? I keep getting wonky readings like all of a sudden the temp is 18 degrees. Also, probes themselves drop off and I have to basically rebuild the system from a reformatted sd card.

For now I am going to go back to 3.3.1 and see if that works.
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
I've been working on adding drivers for ADS1015 and ADS1115 to reef-pi. I'm planning for it to only support single shot since reef-pi can't keep up with continuous conversions anyway. I have a few points that could use some community input.

Single Ended vs Differential
Does anyone have a use case for differential inputs? Driver configuration is easy for single ended since it just exposes 4 channels. Differential could be kind of easy by exposing 3 channels since they all have an option to pair with AIN3, but there's a fourth option for differential to pair AIN0 and AIN1. This makes the driver configuration much more complicated to present to users.

Gain settings
Should we go with a single gain setting, or the possibility of different gain on each channel? There are a handful of amplification settings available. It's possible to have the gain configured differently for each channel, but that gets much more complicated for differential readings since the channels would be more dynamic.

Comparator
Does anyone have a use case for the comparator functions? It could be exposed as a digital input, but I haven't really thought through this functionality.

Bad readings

I've got a test board hooked up and things are mostly running fine. I see the values change as I move the position of the potentiometer.

sailfin.jpg


I occasionally see a sporadic conversion returned as 0. All those lines to the bottom are bad readings. The jump at the end is from me pushing the slider up.

1592767502526.png


I can't seem to find any reason for the bad conversions, but I do find that they are always correlated with the config register being reset to default. So it's not technically a bad conversion since the config is stating to read AIN0 with AIN1, but I haven't been able to pin down the root of this problem.

1592767656998.png


I thought it might be some other I2C traffic causing a problem, but nothing else has been captured on that bus using a logic analyzer. Only the intended messages are flowing. I also thought it might be a voltage sag causing the chip to reset. I've hooked up a scope on the power pins around this chip and set a trigger at 4.75v. It's never triggered (except at power on and power off). I've also searched for any mention of others having this kind of problem, but that turned up empty as well... I have an ADS1115 board showing up soon, so I'll repeat these tests with that module.

To work around this problem, I think I'll just read back the config register and discard the conversion if the config doesn't match what it should be. It can retry a few times in the event of a mismatch or failure. I don't see this kind of behavior in any other samples, though.

The analog reading also wiggles a bit. it's exaggerated by 16 times in my samples above since ADS1015 is 12 bit instead of 16 and I haven't shifted it to compensate. Is there an appetite to have the driver take multiple conversions and average the results?
 

BenB

Active Member
View Badges
Joined
Jun 11, 2019
Messages
118
Reaction score
152
Rating - 0%
0   0   0
I've been working on adding drivers for ADS1015 and ADS1115 to reef-pi. I'm planning for it to only support single shot since reef-pi can't keep up with continuous conversions anyway. I have a few points that could use some community input.

Single Ended vs Differential
Does anyone have a use case for differential inputs? Driver configuration is easy for single ended since it just exposes 4 channels. Differential could be kind of easy by exposing 3 channels since they all have an option to pair with AIN3, but there's a fourth option for differential to pair AIN0 and AIN1. This makes the driver configuration much more complicated to present to users.

Gain settings
Should we go with a single gain setting, or the possibility of different gain on each channel? There are a handful of amplification settings available. It's possible to have the gain configured differently for each channel, but that gets much more complicated for differential readings since the channels would be more dynamic.

Comparator
Does anyone have a use case for the comparator functions? It could be exposed as a digital input, but I haven't really thought through this functionality.

Bad readings

I've got a test board hooked up and things are mostly running fine. I see the values change as I move the position of the potentiometer.

sailfin.jpg


I occasionally see a sporadic conversion returned as 0. All those lines to the bottom are bad readings. The jump at the end is from me pushing the slider up.

1592767502526.png


I can't seem to find any reason for the bad conversions, but I do find that they are always correlated with the config register being reset to default. So it's not technically a bad conversion since the config is stating to read AIN0 with AIN1, but I haven't been able to pin down the root of this problem.

1592767656998.png


I thought it might be some other I2C traffic causing a problem, but nothing else has been captured on that bus using a logic analyzer. Only the intended messages are flowing. I also thought it might be a voltage sag causing the chip to reset. I've hooked up a scope on the power pins around this chip and set a trigger at 4.75v. It's never triggered (except at power on and power off). I've also searched for any mention of others having this kind of problem, but that turned up empty as well... I have an ADS1115 board showing up soon, so I'll repeat these tests with that module.

To work around this problem, I think I'll just read back the config register and discard the conversion if the config doesn't match what it should be. It can retry a few times in the event of a mismatch or failure. I don't see this kind of behavior in any other samples, though.

The analog reading also wiggles a bit. it's exaggerated by 16 times in my samples above since ADS1015 is 12 bit instead of 16 and I haven't shifted it to compensate. Is there an appetite to have the driver take multiple conversions and average the results?

Hi Michael I think that the separate Gain settings will be needed for the 4 different instruments you can connect per ADS1115. When connecting a flow sensor, a Ph sensor, or a Pressure sensor they possibly need a different gain.

What I understand from single-ended vs differential is that differential is not connected to ground and therefore is more accurate. When a filter board will be used a single-ended will be fine.
 

speedstar

Well-Known Member
View Badges
Joined
Sep 18, 2018
Messages
704
Reaction score
1,029
Location
Grand Rapids
Rating - 0%
0   0   0
We've made significant changes to reef-pi in 3.0 compared to 2.0. I recommend backing up your reef-pi.db configuration (or even the whole SD card) before upgrading. The latest release is 3.4 and includes many new drivers and several bug fixes.

This is assuming you are using pi zero based on the snippets in your post. It stops reef-pi, backs up the reef-pi.db in case you want to revert, then it downloads reef-pi and installs it. I would run each line one by one.
That was my mistake, I was looking for a link and that is what popped up. I and running a 3b+ board. So I'll just do a fresh build on a new memory card and setup from scratch. Do you have a link handy to download that code. Thanks
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,121
Rating - 0%
0   0   0
That was my mistake, I was looking for a link and that is what popped up. I and running a 3b+ board. So I'll just do a fresh build on a new memory card and setup from scratch. Do you have a link handy to download that code. Thanks
The releases are listed in github. The most recent release is 3.4, and I've just added those upgrade snippets to the release description.

Code:
wget -c https://github.com/reef-pi/reef-pi/releases/download/3.4/reef-pi-3.4-pi3.deb
sudo dpkg -i reef-pi-3.4-pi3.deb
 

MosBronco

New Member
View Badges
Joined
Jun 6, 2020
Messages
23
Reaction score
16
Rating - 0%
0   0   0
reefpi just saved my tank. ive had several hot days here and i was still using my reef keeper elite to run my tank. I had my reefpi probes in the tank to kinda do a week uptime/trial test. The temp probe said my tank was at 83 and rising.. sending me into a panic at midnight. I was pretty confused and turning everything off and turning on fans until i noticed that the reef keeper had decided to not turn off my heaters... One element had failed causing it to be stuck on . SO a BIG thanks to @Ranjib and @Michael Lane for helping me out along the way and saving my fishies lives and who knows how much in corals . Side note... a great reef keeper elite will be for sale soon :D
Screenshot_2020-06-22 ReefPi.png
 

Matevz Savarin

Active Member
View Badges
Joined
Dec 5, 2018
Messages
209
Reaction score
163
Rating - 0%
0   0   0
Tnx to reefpi all my stuff is almost automatic, all its left is tds meter for rodi water. Any plan to add it in the future?
I am using dsr reefing, no wc for2.5 years now.,justcadding stuff on 8 peristatic pumps 3 of them are on pi. 5 will come on in the future or not.. if tds would be possible that means I dont do anything exept testing parameters on 3 weeks, prety cool
 
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 see this thread is becoming popular and a few guys seems to talk about "Heartbeat" which I know is an Apex term / feature.

Does reef-pi have plans to implement something like this? Can it even be done easily?
Since reef-pi does not have any cloud based counter part , it does not have exactly similar heart beat mechanism. You can however use Prometheus or adafruit io for achieving the exactly same thing, since they are external to reef-pi and receives data from reef-pi , they can alert you when incoming data is missing or stopped.
 
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
Question regarding motor drivers. I’m using the mosfet TB6612. It works like all the others, has 2 GPIO inputs and a PWM input. If I don’t need bi-directional motor control and want to conserve GPIO pins can I put one of the inputs direct to ground?
I don’t think so. But I have to read a bit. Tb6612 is a dc motor driver or stepper driver ?
 
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
Tnx to reefpi all my stuff is almost automatic, all its left is tds meter for rodi water. Any plan to add it in the future?
I am using dsr reefing, no wc for2.5 years now.,justcadding stuff on 8 peristatic pumps 3 of them are on pi. 5 will come on in the future or not.. if tds would be possible that means I dont do anything exept testing parameters on 3 weeks, prety cool
Thank you for the kind words :-)
 

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
Since reef-pi does not have any cloud based counter part , it does not have exactly similar heart beat mechanism. You can however use Prometheus or adafruit io for achieving the exactly same thing, since they are external to reef-pi and receives data from reef-pi , they can alert you when incoming data is missing or stopped.

OK. That's a cool work-around I guess. Always good to make use of what exists already.
 
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
reefpi just saved my tank. ive had several hot days here and i was still using my reef keeper elite to run my tank. I had my reefpi probes in the tank to kinda do a week uptime/trial test. The temp probe said my tank was at 83 and rising.. sending me into a panic at midnight. I was pretty confused and turning everything off and turning on fans until i noticed that the reef keeper had decided to not turn off my heaters... One element had failed causing it to be stuck on . SO a BIG thanks to @Ranjib and @Michael Lane for helping me out along the way and saving my fishies lives and who knows how much in corals . Side note... a great reef keeper elite will be for sale soon :D
Screenshot_2020-06-22 ReefPi.png
That’s awesome to see :-) . Corals should be fine though, my tanks go through crazy 84 degrees swing (from 79) due to the hot weather here.. I’m slowly getting a hold of this situation
 

Somdelt

New Member
View Badges
Joined
Jun 22, 2020
Messages
2
Reaction score
3
Rating - 0%
0   0   0
Hi everyone I made a account just to say thank you to rob with robo tank and everyone with reef pi I run fresh water but I love this project so far I've got all 4 power head's up and running with my kessils and 2 temp probes waiting on my ph probe to get here can't wait to see what is to come
 

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 10 58.8%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 7 41.2%
Back
Top
Home
Post thread…
Market
What's new