|Just another Perl shrine|
Cubic inch to litre calculationsby stevieb (Abbot)
|on Feb 09, 2019 at 22:19 UTC||Need Help??|
stevieb has asked for the
wisdom of the Perl Monks concerning the following question:
Good afternoon fellow Monks,
I'm working on some prototype code that will eventually be translated to the Arduino platform that'll perform the task of monitoring a mixture tank of water and chlorine, and when it reaches a certain level (say only 1/4 full), will eventually perform a mixture of these two chemicals in the appropriate relative amounts to re-fill the tank.
I'm in the initial phase here, basically, I'm trying to get the math correct to ensure I'm seeing the tank at the proper level, both how many cubic inches are left in the tank, as well as how many litres are remaining (likewise, how many of each are missing).
Can I please, once again, have our mathematicians have a peek to see if I'm on the proper mathematical path? Calculations seem sane when using different variable values and comparing the percentages on my calculator (within a percent or two), but before I move on, I'm looking for some re-assurance.
Test sample code (if there are any questions or clarifications required, please advise):
For those interested, I'll be using an ultra-sonic distance sensor, a laser level sensor as well as an analog water-level strip to calculate the depth level (to fully ensure as accurate a reading of the depth as possible, as well as for redundancy purposes in case one of the sensors fail). The project will also entail various pumps and solenoids based off of both 12v and 120v relays for the mixing of the chemicals into the mix tank.
All data will be sent over a 433Mhz RF feed from the water purification building back to a central Raspberry Pi, where I'll process the incoming data, and display it both in numerical and graph forms using Dancer2 and a myriad of other Perl distributions and technologies.