Flow Meter Sample C...
 

Flow Meter Sample Code  

  RSS

not_5
(@not_5)
New Member
Joined: 7 months ago
Posts: 4
23/02/2019 11:03 pm  

Does any one have any experience using a flow meter with a raspberry pi and would be willing to share the snippet of code you use to control a solenoid or pump?


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 0
23/02/2019 11:20 pm  

I don't have any flow meters but my understanding is you could use the RPM Input and determine the flow rate based on the RPM. This can be used with a Conditional Function to open/close a solenoid or valve, either via on/off-open/closed or PWM to adjust the opening based on the flow range (e.g. 5 <= flow_rpm <= 10, do this, 10 <= flow_rpm <= 15, do that) . A PID could also be used with the flow RPM Input to adjust a PWM signal that adjusts a valve's opening.

This post was modified 7 months ago by Kyle Gabriel

ReplyQuote
not_5
(@not_5)
New Member
Joined: 7 months ago
Posts: 4
23/02/2019 11:27 pm  

Makes a lot of sense. Good thought.

Thanks Kyle! Good idea opening a forum. Definitely nice to have a place to discuss mycodo and related projects.


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 0
24/02/2019 12:01 am  

Furthermore, you can create a conversion at Configure -> Measurements -> Add Conversion, for example, RPM to water speed (liters per hour), with the conversion x*10. Then in the RPM Input, you can set the conversion from measured RPM to liters per hour. This would allow for convenient measurement storage as the exact flow and makes programming downstream easier.

This post was modified 7 months ago by Kyle Gabriel

ReplyQuote