Conan
Well-Known Member
SWMBO has an older Android phone (Eris, running Android 1.5 "Cupcake") she's about to be done with. There's nothing wrong with it, she just can't stand it anymore. Anyway....I have an idea about automatically keeping track of the beer left in a keg using phone. I have used MatLab and R for programming, but not extensively. I also have the Eclipse software and associated, required stuff to write apps for Android. The trouble is, I have no clue how to do it- even after reading up on the geek boards (isn't this a geek board, too??).
My thought is this. I'd mount the phone to a tap handle and keep it plugged in. When the tap is used, the accelerometer/ orientation sensor moves. The program will always be running, and when the tap is pulled the sensor says "I moved". I'm thinking I'd have an If function, "If sensor x moves 15 degrees, start timing" or something similar. It'll time the pour, basically, by stopping a timer once the tap is closed (sensor moves back towards vertical). If I tell the phone what the rate of flow is when I install the keg, it should be able to determine how much is poured off, right? Example: I setup the system with a new keg, telling it the tap is flowing 1oz/ second. Open the tap, orientation sensor passes through 10 degrees, beer is pouring, timer starts. Close tap after 16 seconds: sensor passes back through 10 degrees towards vertical, beer stops pouring, timer stops. Program operates: "I was open for 16 seconds, that's 16 ounces. Subtract 16 ounces from 5 gallons (640 ounces). Divide result (624) by 16oz in a beer." Program output: You have 39 beers remaining in this keg.
Wow, I hope that made sense. Is it possible to do this, especially with a low amount of programming knowledge? The layout in my mind is pretty easy- it's the actual lines of code that'll get me.
Thanks, Kyle
My thought is this. I'd mount the phone to a tap handle and keep it plugged in. When the tap is used, the accelerometer/ orientation sensor moves. The program will always be running, and when the tap is pulled the sensor says "I moved". I'm thinking I'd have an If function, "If sensor x moves 15 degrees, start timing" or something similar. It'll time the pour, basically, by stopping a timer once the tap is closed (sensor moves back towards vertical). If I tell the phone what the rate of flow is when I install the keg, it should be able to determine how much is poured off, right? Example: I setup the system with a new keg, telling it the tap is flowing 1oz/ second. Open the tap, orientation sensor passes through 10 degrees, beer is pouring, timer starts. Close tap after 16 seconds: sensor passes back through 10 degrees towards vertical, beer stops pouring, timer stops. Program operates: "I was open for 16 seconds, that's 16 ounces. Subtract 16 ounces from 5 gallons (640 ounces). Divide result (624) by 16oz in a beer." Program output: You have 39 beers remaining in this keg.
Wow, I hope that made sense. Is it possible to do this, especially with a low amount of programming knowledge? The layout in my mind is pretty easy- it's the actual lines of code that'll get me.
Thanks, Kyle