*Ss Brewing Technologies Giveaway - Enter Now!*

Home Brew Forums > Home Brewing Beer > Brewing Software > Android Programming for Kegerator
Reply
 
LinkBack Thread Tools
Old 11-29-2011, 04:06 PM   #1
Conan
Feedback Score: 0 reviews
Recipes 
 
Join Date: Apr 2008
Location: Tonawanda, NY
Posts: 629
Liked 27 Times on 26 Posts
Likes Given: 4

Default Android Programming for Kegerator

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

__________________
Conan is offline
 
Reply With Quote Quick reply to this message
Old 11-29-2011, 04:11 PM   #2
JerseyBrewer
HBT_SUPPORTER.png
Feedback Score: 0 reviews
 
JerseyBrewer's Avatar
Recipes 
 
Join Date: Nov 2009
Location: West Deptford, NJ
Posts: 92
Liked 3 Times on 2 Posts

Default

Not sure about Android. But check out this link: Kegbot Kegerator Project - Monitor keg volume & control access.

Have fun!

__________________
JerseyBrewer is offline
 
Reply With Quote Quick reply to this message
Old 11-29-2011, 07:56 PM   #3
krenshaw
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
krenshaw's Avatar
Recipes 
 
Join Date: Dec 2010
Location: Lancaster, PA
Posts: 1,089
Liked 48 Times on 44 Posts
Likes Given: 27

Default

neat concept, though depending on the battery life it may die quite quickly unless you always have it plugged into a power source.. last thing you want to have to do is wait for a phone to boot up while you are thirsty for a homebrew

__________________

~ A fine beer may be judged with only one sip, but it's better to be thoroughly sure.

DOWN THE HATCH BREWING
Stainless Hop Spider | Wooden Brew Rig | Dual Hinge Keezer Build

Primaries.. oxy :-(
Keg 1: Apfelwein | Keg 2: BlackEyePA version2 | Keg 3: Summer Saison
Bottles: lots full and even more empty

krenshaw is offline
 
Reply With Quote Quick reply to this message
Old 11-29-2011, 08:03 PM   #4
tochsner
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
tochsner's Avatar
Recipes 
 
Join Date: Sep 2011
Location: Edmonds, WA
Posts: 202
Liked 17 Times on 13 Posts
Likes Given: 2

Default

I'll begin by saying I don't know anything about programming and most of what you said didn't really make sense.
What about one of those pads that you put under the keg to measure the weight. I know those can report wirelessly to a computer?

Tony

__________________
tochsner is offline
 
Reply With Quote Quick reply to this message
Old 11-29-2011, 11:14 PM   #5
Conan
Feedback Score: 0 reviews
Recipes 
 
Join Date: Apr 2008
Location: Tonawanda, NY
Posts: 629
Liked 27 Times on 26 Posts
Likes Given: 4

Default

I'm planning to keep it plugged in always, with probably a small rubber band holding the wire secure.

I thought about one of the scale pads, but I'm trying to do this for free- mostly because my current system (chalk on blackboard paint) is free. And, I would like to learn to program something. But I, too, know nothing about it. We'll see, and thanks for the ideas! Kyle

__________________
Conan is offline
 
Reply With Quote Quick reply to this message
Old 12-03-2011, 07:20 AM   #6
JoyousRuction
Feedback Score: 0 reviews
Recipes 
 
Join Date: Nov 2011
Location: San Francisco, CA
Posts: 51
Default

Well, Android apps run on a special flavor of the JVM - which means that you are restricted to using Java or some other programming language that happens to compile to the JVM that Android happens to use. Java is a language that is often used to teach new programmers how to write programs, so it is not a terrible place to start. The android platform seems to have a good number of people working with it, and a number of those people seem to be happily blogging away about how to do this, that, and the other thing in an Android app. Furthermore, the Android development platform is really nice, there are GUI tools for setting up your GUI's, many pre-written libraries for your convenience, and everything but your creativity should already be there for you.

That being said, I think you may be frustrated with your choice of project. I anticipate a lot of difficulty accurately estimating of beer flow using only a phone's accelerometer to measure tap handle angle. The angles that you are trying to sense are not huge, the timing must be precise, and there are many factors that can affect beer flow rate (keg pressure, temperature, amount tap is opened, etc).

I wish you the best of luck, let us know how it turns out!

__________________
JoyousRuction is offline
 
Reply With Quote Quick reply to this message
Old 12-15-2011, 11:07 PM   #7
Conan
Feedback Score: 0 reviews
Recipes 
 
Join Date: Apr 2008
Location: Tonawanda, NY
Posts: 629
Liked 27 Times on 26 Posts
Likes Given: 4

Default

Joyous,
I've at this point (very busy) dropped the project. Mostly because I was having trouble, in my limited searching, finding info on the tilty function. I'm hoping to look into it more in the coming weeks.

You're right- accurately estimating the true flow will be difficult, but I'm making a few assumptions. Firstly is that the tap is in one of two positions: open, or closed. This isn't terrible inaccurate because with standard taps when I open them partway I get foam. Therefore, it's all or nuthin'. As far as keg-based flow rates, I'm again assuming (backed up by qualitative observations) that the flow rate is ~ constant. Enough for my uses anyway. I generally figure about 54 beers/ keg after yeast sediment and line volume, so when I get this written I'll probably use that number. Thanks for the advice! Kyle

__________________
Conan is offline
 
Reply With Quote Quick reply to this message
Old 12-28-2011, 02:40 AM   #8
JoyousRuction
Feedback Score: 0 reviews
Recipes 
 
Join Date: Nov 2011
Location: San Francisco, CA
Posts: 51
Default

If you are still interested in the app, try searching for Android accelerometer tutorial. There are a couple out there that should show you how to access that part of the android device, and once you know the x,y,z accelerations due to gravity it should be pretty easy to calculate the phone's angle (using basic trigonometry).

__________________
JoyousRuction is offline
 
Reply With Quote Quick reply to this message
Old 01-10-2012, 08:42 PM   #9
Neverfade
Feedback Score: 0 reviews
Recipes 
 
Join Date: Dec 2011
Location: Tempe, AZ
Posts: 1
Default

I think this will help you. It's information on the "tilty-function". You'll probably be most interested in the last section, "Using the Rotation Vector". If you decide to pursue the project again, good luck.

__________________
Neverfade is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
BrewR for Android pivovar Brewing Software 42 03-04-2014 07:41 PM
Brew World for Android mrtrav Brewing Software 3 09-30-2011 12:45 PM
Best program for Android? Oregonducks10 Brewing Software 6 02-24-2011 02:02 AM
Android Brewing Apps oojuxeoo Brewing Software 1 08-25-2010 04:56 PM
HTC Evo/Android software riored4v Brewing Software 8 06-12-2010 10:06 AM