Flow Meter Addon for reef-pi

OP
OP
robsworld78

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
946
Reaction score
1,259
Review score
+0 /0 /-0
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi Rob - looking at two of these.
https://h2oprotech.com/products/ha-1044-flow-meter-3-wire?variant=7121431593018

is this correct?
these are 3/4inch.
thanks
Hi @Dukereefnz, those look and sound like the correct type however they don't say Hall Effect so I'm not 100%, not really sure if there's different types. It talks about pulses per gallon, plus they mention it's just general purpose and show pic of connecting to a microcontroller so it should be ok.

This is the type I recommend, as you can see they are very similar to the H2Opro.

 
Top Shelf Aquatics
BRS

Weasel1960

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Aug 22, 2020
Messages
2,121
Reaction score
9,953
Review score
+0 /0 /-0
Location
Monticello, WI
Rating - 0%
0   0   0
There are cheaper ones on Amazon up to 1.5” I think. You need to check their ratings though. They often give a gallon per minute rating but most f the hobby works in gallon per hour. Just be mindful of that and do the conveersion
 
OP
OP
robsworld78

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
946
Reaction score
1,259
Review score
+0 /0 /-0
Location
Edmonton, Canada
Rating - 0%
0   0   0
There are cheaper ones on Amazon up to 1.5” I think. You need to check their ratings though. They often give a gallon per minute rating but most f the hobby works in gallon per hour. Just be mindful of that and do the conveersion
I've seen the cheap ones up to 2" but just a few minutes ago I read in some reviews that the 1" goes down to 0.5" internally so there will be some back pressure which might not be good for a pump. I've been looking around for large ones that don't tapper but haven't found any that say that.
 
Top Shelf Aquatics

Sral

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
May 2, 2022
Messages
746
Reaction score
820
Review score
+0 /0 /-0
Location
Germany
Rating - 0%
0   0   0
I forgot to explain how to connect a flow meter directly to a Raspberry Pi. Flow meters need 5v to operate, the Pi is only 3.3v so you need to add a couple resistors to drop the 5v to 3.3v.

The +5v goes to your power supply and the ground to the Pi.

View attachment 2088885
Something very special:
I will have a 4-channel level shifter anyway (BSS138, has 10k pull-up resistors, so I might have to add another 10k to bring it to the ~5k from the Adafruit Guide), so I'm thinking about putting this on one of them next to the temperature probes on the other channels. That by itself should do the trick of level shifting for the PI.

That way, however, the sensor almost always pulls the signal to GND and I have almost permanent current flow through the pull-up resistors. Does anybody know whether I could invert that logic ?

I'm thinking about putting a MOSFET between pull-up and GND, triggered by the flow sensor signal. That pulls the signal line to GND every time a pulse comes in. The program should still work, since it only looks for either a rising or falling flank, which is still there, just inverted.
 
Last edited:
OP
OP
robsworld78

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
946
Reaction score
1,259
Review score
+0 /0 /-0
Location
Edmonton, Canada
Rating - 0%
0   0   0
Something very special:
I will have a 4-channel level shifter anyway (BSS138, has 10k pull-up resistors, so I might have to add another 10k to bring it to the ~5k from the Adafruit Guide), so I'm thinking about putting this on one of them next to the temperature probes on the other channels. That by itself should do the trick of level shifting for the PI.

That way, however, the sensor almost always pulls the signal to GND and I have almost permanent current flow through the pull-up resistors. Does anybody know whether I could invert that logic ?

I'm thinking about putting a MOSFET between pull-up and GND, triggered by the flow sensor signal. That pulls the signal line to GND every time a pulse comes in. The program should still work, since it only looks for either a rising or falling flank, which is still there, just inverted.
The BSS138 won't work with DS18B20 sensors, the signal seems to get lost through them but you can use them for I2C. I think the flows don't like them either as they use interrupts but I could be wrong about that one, the voltage divider works for sure though. Not sure about using the mosfet for that, guess there's one way to find out. :)
 

Sral

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
May 2, 2022
Messages
746
Reaction score
820
Review score
+0 /0 /-0
Location
Germany
Rating - 0%
0   0   0
The BSS138 won't work with DS18B20 sensors, the signal seems to get lost through them but you can use them for I2C. I think the flows don't like them either as they use interrupts but I could be wrong about that one, the voltage divider works for sure though. Not sure about using the mosfet for that, guess there's one way to find out. :)
Thx for the input !
I'll have to testit in a dry run with header pins for example. Maybe you really need to bring the pull up down to ~5k to make it work. I'll keep you updated :)
 

BenB

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Jun 11, 2019
Messages
96
Reaction score
150
Review score
+0 /0 /-0
Rating - 0%
0   0   0
This is super cool. Thanks for sharing @robsworld78 . We should incorporate the driver in main reef-pi. I'll go through the details

Nice work Rob!!!

Hi @Ranjib, did you have time to include this into reef-pi itself???
Would be a great to have HAL flowsensors working directly from reef-pi!!!!
 

Sral

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
May 2, 2022
Messages
746
Reaction score
820
Review score
+0 /0 /-0
Location
Germany
Rating - 0%
0   0   0
Thx for the input !
I'll have to testit in a dry run with header pins for example. Maybe you really need to bring the pull up down to ~5k to make it work. I'll keep you updated :)
Just as an update: the BSS138 level shifter works with both the DS18B20 temperature sensor and the Seedstudio flow meter I have.
 

Dunducatti

New Member
Review score
+0 /0 /-0
View Badges
Joined
Oct 25, 2022
Messages
3
Reaction score
7
Review score
+0 /0 /-0
Location
USA
Rating - 0%
0   0   0
That's all I need and things could get pretty interesting quick. I was playing with Node.js, if I run the js file with node in terminal it does what it should but I wasn't able to fire it from the web page using ajax.
I hope you did well and gained valuable experience with Node.js I usually go to a friend who is very good at it he said that to work in Node he goes to a company that build him everything, he even showed https://zenbit.tech/services/nodejs-development-company/ not sure how relevant it is but I'll leave it!
 
Nutramar Foods
OP
OP
robsworld78

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
946
Reaction score
1,259
Review score
+0 /0 /-0
Location
Edmonton, Canada
Rating - 0%
0   0   0
I hope you did well and gained valuable experience with Node.js I usually go to a friend who is very good at it he said that to work in Node he goes to a company that build him everything, he even showed https://zenbit.tech/services/nodejs-development-company/ not sure how relevant it is but I'll leave it!
Thanks, I didn't do a lot with Node.js, was able to work it out with c++, I'm by far most comfortable with it. C++, php, javascript, html, css and mysql is plenty enough for me to keep track of. At one time I was messing with python which I found the most difficult as it basically goes against everything I know with c++.
 

Dunducatti

New Member
Review score
+0 /0 /-0
View Badges
Joined
Oct 25, 2022
Messages
3
Reaction score
7
Review score
+0 /0 /-0
Location
USA
Rating - 0%
0   0   0
Thanks, I didn't do a lot with Node.js, was able to work it out with c++, I'm by far most comfortable with it. C++, php, javascript, html, css and mysql is plenty enough for me to keep track of. At one time I was messing with python which I found the most difficult as it basically goes against everything I know with c++.
I admire the amount of knowledge you have of languages, I think that now you can be called a polyglot in a sense!))
 
OP
OP
robsworld78

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
946
Reaction score
1,259
Review score
+0 /0 /-0
Location
Edmonton, Canada
Rating - 0%
0   0   0
I admire the amount of knowledge you have of languages, I think that now you can be called a polyglot in a sense!))
Lol, too bad I wasn't like that with real languages, I have enough trouble with English. :)
 
AquaCave Logo Banner

Wolfw28

Active Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 13, 2022
Messages
178
Reaction score
131
Review score
+0 /0 /-0
Location
Myakka City
Rating - 0%
0   0   0
Hey @robsworld78 I have been using 4 flow sensor that the calibration factor is 7.5 just bought 2 large diameter one and the is 4.5 .in your program it only allows for one. If I stay with the 7.5 what equation would I use to calculate the 4.5 into gallons per hour. Thank you for all your help.
 

Sral

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
May 2, 2022
Messages
746
Reaction score
820
Review score
+0 /0 /-0
Location
Germany
Rating - 0%
0   0   0
Hey @robsworld78 I have been using 4 flow sensor that the calibration factor is 7.5 just bought 2 large diameter one and the is 4.5 .in your program it only allows for one. If I stay with the 7.5 what equation would I use to calculate the 4.5 into gallons per hour. Thank you for all your help.
If you set the script to output gallons per hour, just with the calibration factor of 7.5 instead of 4.5, you need a factor of 1.6666667 ( ~ 7.5 / 4.5 )
E.g. Correct Value = 1.666667*Incorrect Value
 

Wolfw28

Active Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 13, 2022
Messages
178
Reaction score
131
Review score
+0 /0 /-0
Location
Myakka City
Rating - 0%
0   0   0
If you set the script to output gallons per hour, just with the calibration factor of 7.5 instead of 4.5, you need a factor of 1.6666667 ( ~ 7.5 / 4.5 )
E.g. Correct Value = 1.666667*Incorrect Value
So for Dummies like me just multiple the reading I get by 1.666667 and that the correct flow reading. Thank you again my friend.
 
Nutramar Foods

Polyp polynomial: How many heads do you start with when buying zoas?

  • One head is enough to get started.

    Votes: 27 10.6%
  • 2 to 4 heads.

    Votes: 145 57.1%
  • 5 heads or more.

    Votes: 65 25.6%
  • Full colony.

    Votes: 10 3.9%
  • Other.

    Votes: 7 2.8%

New Posts

Pirates Reef Corals
Back
Top