Monday, October 17, 2016

Flow: Fluid Consumption Balancer

A client had a problem about his company's consumption of a fluid.  This particular fluid is the essential for operations, so he got two suppliers for redundancy.  However, the two suppliers sell the fluid at different prices where the difference is at least 20% depending on the market.  Operationally, the lower priced supplier is the priority, but fluid from the more expensive one should still be consumed due to minimum purchase contract obligations.

First, they got the average total consumption of this fluid for the whole company.  They were able to determine that to achieve minimum consumption of the more expensive supplier's fluid, a ratio of 3:1 is comfortable to avoid penalties.

Before they commissioned the project, what the client did was to shift from one supplier to the other by manually closing, and opening valves from the suppliers' respective tanks.  This was done every other week.  In a month, that roughly translates to a 1:1 ratio (half from supplier A, other half from B).  However, this scheme does not maximize savings, because consumption from the more expensive supplier is way above minimum.

The client then commissioned the project to rebalance their fluid consumption favoring the cheaper supplier.  The solution was to find a way to monitor the fluid consumption per supplier.  Then, when a condition is met (3:1), one supplier's line is cut off, and the other one opened.  Of course, some form of intelligence is required by this setup.

What we did was to attach a flow meter, and a solenoid valve to each of the fluid lines.

The flow meter counts how much fluid is consumed, while the solenoid valve opens, or closes the line.  The flow meter solenoid valve combinations are wired to a microcontroller, in our case a Bluno, which is just an Arduino with built in bluetooth low energy.

The flow meters directly interface with the microcontroller, while the solenoid valves are connected to a single channel relay with the normally opened/closed port controlled by the microcontroller.


The firmware is very simple.  The microcontroller determines how much fluid from the cheaper supplier passes through.  When it senses that 30 liters from the cheaper supplier have passed, it shuts down the flow by closing the solenoid valve.  Shutting down the solenoid valve of the cheaper supplier is as simple as switching the relay to enable the normally opened port (expensive supplier's) instead of the normally closed (cheaper supplier's) port.  The more expensive supplier's solenoid valve opens, fluid flows, and is measured again by its own flow meter.  When 10 liters have passed, the microcontroller switches consumption back to the cheaper supplier's by opening its valve, and closing the other one.  The whole process is repeated.  So for every 30 liters consumed from the cheaper supplier, 10 liters is used from the more expensive one.

The setup itself has no way to show the user the status of the fluid lines (consumption, current line in use), because we thought that adding a LCD screen will complicate the apparatus, and we were targeting minimum cost.  What we did to show the status was to connect the microcontroller to an Android phone via bluetooth, and with an app (Flow), show consumption, and the currently used line, both in real time.  A second by second log entry, which contains time, consumption from both lines, and status is created every time the app connects to the apparatus, and this is written to a file in the Android phone.  The app also has a reset feature that sets consumption of both lines back to zero when billing is likewise reset.


The only limitation of this apparatus is the accuracy of the flow meters.  According to the supplier of the meters, they have an error of 3%, give or take.  Fortunately, the customer tolerates the flow meters' margin of error, which in our test shows that it is usually in his favor.  Since the apparatus is electronic, and it is setup to operate outdoors, it requires protection from the elements, so the electronic components are housed in a wooden case, and it is plastic wrapped for added protection.  The front of this setup is actually covered.

The client can now be assured that his consumption maximizes savings from the low priced supplier without human intervention.  Through the log file, he can monitor the company's fluid consumption, which can then be cross checked with the suppliers' bills.  And before he leaves the office, he can see if any of the fluid lines were left open, and take appropriate action.

No comments:

Post a Comment