Jump to content

How do fluid sensors work?!


Recommended Posts

I'm having trouble building automation systems that use sensors to sort fluids. There must be a gap in my understanding of how they work, because I keep getting the wrong fluid in my output.

For example, my water treatment plant. Originally I just had two banks of three reservoirs that alternate which reservoir is open every day, on a timer, so that the germy water proceeds slowly through the system. That wasn't enough, though, so I tried to add a germ sensor to the system.

That germ sensor in the top right has pipes connecting it to the inputs of both shuttoff valves. It emits green when it detects germs. The top valve is meant to open in that case, to send the water back for more processing. The valve to the right is only ever supposed to have clean water in it, but you can see in the third screenshot that it's full of germs. And, as a result, so is my water supply.

What am I doing wrong here? Why doesn't this work? Why does germy water even get into that valve? Does anyone have a link to a comprehensive explanation of how exactly sensors and valves work, and how to use them correctly? I'm obviously missing something here.

20210103191712_1.jpg

20210103191722_1.jpg

20210103191756_1.jpg

Link to comment
Share on other sites

We don't see your piping but I think you have a T junction where the sensor is. The germ sensor isn't giving direction to flow in pipe, it's just opening or closing shut-off. If you've a T junction behind your sensor, flow will go right, then top, then right, then top, etc... no matter which shut-off is opened at this exact moment.

So far what I can say is I think that's not your understanding of sensor that isn't good, that's your piping.

I suggest one pipe, and over it one sensor taking care of sorting germy water for one shut-off. Then after if you've no flow congestion, the pipe can go straight into distribution system. Because if it's not germy, then it's clean. (You can of course do the opposite, sorting clean water and everything else loop back).

If flow congestion is a worry (depending on how you're using this water), after the first shut-off add another sensor and another shut-off, taking care of sorting pure water, then loop back elsewhere.

 

Link to comment
Share on other sites

Try to avoid T sections. You will be much less confused about what is supposed to be flowing where. And so will the flow. Use bridges if at all possible.

If you want to use the sensor and shutoff to direct flow, make sure there is no delay between the sensor and the shutoff, which means no backing up and certainly no T sections on the sensor itself. Here's an example of an element filter system. Germ sensor+shutoffs work the same way.
lCMjt1xHSX.thumb.gif.88d74a0daef231f89645e700ce2336ca.gif

By the way, and yes I am going to bring this up every single time, no automation is needed to clean any natural concentration of germs in polluted water at 10kg/s.
ZAzlkMsqRW.gif.647198b13a290aed168b75848cf62b77.thumb.gif.10af609195154bbbff2c4e40495566b6.gif

Link to comment
Share on other sites

Huh, I was waiting for a notification email. Didn't work somehow. Thanks for the help, folks!
 

22 hours ago, OxCD said:

We don't see your piping but I think you have a T junction where the sensor is. The germ sensor isn't giving direction to flow in pipe, it's just opening or closing shut-off. If you've a T junction behind your sensor, flow will go right, then top, then right, then top, etc... no matter which shut-off is opened at this exact moment.

So far what I can say is I think that's not your understanding of sensor that isn't good, that's your piping.

I suggest one pipe, and over it one sensor taking care of sorting germy water for one shut-off. Then after if you've no flow congestion, the pipe can go straight into distribution system. Because if it's not germy, then it's clean. (You can of course do the opposite, sorting clean water and everything else loop back).

If flow congestion is a worry (depending on how you're using this water), after the first shut-off add another sensor and another shut-off, taking care of sorting pure water, then loop back elsewhere.

 

There is a T-junction, yes.

22 hours ago, nakomaru said:

Try to avoid T sections. You will be much less confused about what is supposed to be flowing where. And so will the flow. Use bridges if at all possible.

If you want to use the sensor and shutoff to direct flow, make sure there is no delay between the sensor and the shutoff, which means no backing up and certainly no T sections on the sensor itself. Here's an example of an element filter system. Germ sensor+shutoffs work the same way.
lCMjt1xHSX.thumb.gif.88d74a0daef231f89645e700ce2336ca.gif

 

Ok, I think I get how it works. Let me check see if I have these basic principles correct:

  1. Valve activation is naturally delayed by however long it takes a packet of fluid to flow from the sensor tile to the valve entry tile.
  2. If a valve is open and the exit tile is clear, the packet will ALWAYS prefer to move to it instead of the other tile.
  3. Because it works by timing, it all only works if there's no congestion, and if there is congestion then all bets are off.

Have I got that right?

 

Ok! So, new approach:
20210104201447_1.thumb.jpg.f8cba9ba07df0047177a095931b06a6a.jpg20210104201457_1.thumb.jpg.a0f5fac41c04c6c48b90615805b7f1f4.jpg

If the sensor detects germs or there's no power the valve will shut and the water should recirculate, right? It should only break if the clean output or the recirculation is clogged up, and in my case that won't happen.

Link to comment
Share on other sites

48 minutes ago, Hyperlynx said:
  1. Valve activation is naturally delayed by however long it takes a packet of fluid to flow from the sensor tile to the valve entry tile.
  2. If a valve is open and the exit tile is clear, the packet will ALWAYS prefer to move to it instead of the other tile.
  3. Because it works by timing, it all only works if there's no congestion, and if there is congestion then all bets are off.
  1. Yes, if this distance is 1 tile and the flow is uninterrupted. (specifically, a shutoff activated at T0 will act on whatever packet is touching its intake at T1). 
  2. Yes. This is also a critical principle of using bridges to direct pipe flow priorities. Note that two exceptions exist: the bridge and the the valve, which can also merge into partially full segments. All other exits are fully blocked at any non zero mass. (i.e. a bridge or valve can fill up the rest of the way a segment with 100g of water in it, a reservoir, pump or shutoff exit is blocked in this case.)
  3. Yes, note that due to principle 2, and the use of two bridges (and no T sections), our filter system will never get backed up because the pump will not over fill the pipe. If it is full, the bridge waits, and the filter system continues to spin, enabling proper shutoff timing.
    TVMRakCj05.gif.bb4020fe5d5e9beb04a8c189a32afb6e.gif

Your germ sensor itself looks okay. Some things to keep in mind.

There must be no exits at any point along this pipe after the shutoff. An exit would push flow from two directions to this shutoff intake. To remove this restriction, add a bridge after the shutoff.
image.thumb.png.a12d7762a76c37cf3b0f83364479edec.png

These segments will never be cleaned. Chlorine atmosphere only acts on the reservoir contents, not the pipe contents. To fix this, remove the shutoffs and put a mechanized airlock below the reservoir which can be used to disable output. (Input will still function.) Or maybe have a bypass to recycle the stopped flow.
image.png.c0e2d7198ae6a8e7267ae0357372e086.png

Link to comment
Share on other sites

Cool! Thanks! :D

2 hours ago, nakomaru said:

There must be no exits at any point along this pipe after the shutoff. An exit would push flow from two directions to this shutoff intake. To remove this restriction, add a bridge after the shutoff.

image.thumb.png.a12d7762a76c37cf3b0f83364479edec.png

Ha. Yes, I found this one out the hard way, and was indeed able to fix it by adding a bridge as you describe :)

 

Quote

These segments will never be cleaned. Chlorine atmosphere only acts on the reservoir contents, not the pipe contents. To fix this, remove the shutoffs and put a mechanized airlock below the reservoir which can be used to disable output. (Input will still function.) Or maybe have a bypass to recycle the stopped flow.
image.png.c0e2d7198ae6a8e7267ae0357372e086.png

That probably explains why there were germy packets of water ending up in the output in the first place!

Oh well, it's a little inefficient, but they'll still get caught by the improved filter.

Link to comment
Share on other sites

If you use a shutoff + germ sensor instead of the door trick you need to loop back germy packets back through the reservoirs. It seems you have been trying to to do that, but the setup isn't quite right. You don't need two shuttoffs with opposite activations. An activated shuttoff will have priority with the way inputs and outputs work. It's the same concept as with bridges, but priorities work generally on all inputs/outputs. If something can go into an input it will go into it rather than beyond it. So you can just have a pipe going past the input node and the shutoff off with get priority. You can also use bridges to sort the priority between the loop and new incoming water.

A setup like that is more complicated than it needs to be. But it does work

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...