Android Controlled Electric Brewery Part 1

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Adeering

Well-Known Member
Joined
Jan 25, 2012
Messages
661
Reaction score
48
Location
Sherwood
Ive decided that instead of going a premade controller (like brewtroller or the BCS-460) Im going to program my own. I have experience with android programming (See BrewAide app) but havent worked with arduino yet. I just ordered a Arduino Uno to start playing with and learning.

The plan is to get the programming and control systems programmed and ready while im deployed and get everything ordered and ready so when I come back can put it all together.

Its going to be a modified version of a Brutus 20 system, all electric and controlled by the arduino uno (maybe mega) and my samsung 10.1 tablet.

The idea behind the control is im going to take the code I have from my android app and use it to take a beer recipe from either BeerSmith or any BeerXML format and it will load in the app and generate the required information. Next I will be able to either manually control the elements (set temps, turn on/off) and the pumps or start a sequence for either the mash or the boil and it will automatically go through a series of steps based on the recipe.

The android part will be easy to send and receive signals based on the recipe. Since ive already made the BrewAide app I have all the required code to open and read the recipes, just need to make the interface and have it send the info. Planning on using bluetooth to connect and send the inputs.

Heres what I dont know yet and will be researching/hoping for help with:
1. Controlling temp with the Arduino, I know theres a PID library so Im assuming I will use that and send a temp setting to the arduino which will then use the PID library to control the element

2. Can one Uno handle two elements and two pumps or will I need multiple arduinos or one mega

This is going to be a learning process and going to use this thread of a thinking box to get ideas and help

Build Starts on Post #40
 
Sounds interesting, but would ditch the arduino and look at a M3 cortex board to build from, same or lower price and so much more capability. If you are interested in a wireless interface then look at a Murata SN8200 module so you could link the brewing control platform to the tablet.
Having done the control hardware and software for the automation you describe, be prepared for quite a few hours of programming to make it work.
 
I just built an eBrutus2.0 and my friend kept suggesting Arduno, so this is interesting to me. However, I opted for caveman PIDs out of China.. I'll stay subscribed to see how yours works out and maybe I can give a little input on the hardware end of things. Cheers!
 
Sounds interesting, but would ditch the arduino and look at a M3 cortex board to build from, same or lower price and so much more capability. If you are interested in a wireless interface then look at a Murata SN8200 module so you could link the brewing control platform to the tablet.
Having done the control hardware and software for the automation you describe, be prepared for quite a few hours of programming to make it work.

Hi

Plan on multiple arduino's if you go that route. The ARM will indeed be a better bet ....

Consider that the code will need to be pretty much stand alone. You don't want the system to go nuts when there's a wireless outage. It needs to *gracefully* handle a few other situations as well. Some of the gotcha's will be easier to handle on one cpu rather than several.

Bob
 
Sounds interesting, but would ditch the arduino and look at a M3 cortex board to build from, same or lower price and so much more capability. If you are interested in a wireless interface then look at a Murata SN8200 module so you could link the brewing control platform to the tablet.
Having done the control hardware and software for the automation you describe, be prepared for quite a few hours of programming to make it work.

I know there's a lot of disdain for arduino in the microcontroller world, but perhaps the two statements in bold here are related. Especially for hardware novices, there's a lot to be said for the wide support base built around arduino hackery.

In any case, I built something similar to what is being described here (though I used HTTP rather than bluetooth to interface). I am a complete amateur with this stuff, but coding was far easier than I expected it to be thanks in large part to the wide availability of sample code.
 
While the Arduino platforms are popular and relevant for simple systems, the analog capabilities are not good. For those that have minimal needs stick with the Arduino, but for systems with greater complexity you run out of resources on the Arduino platform and would be better off with an Arm platform.
Having written applications in both Java and .Net, I have a very good understanding of what is needed to code for a recipe to control application that has run time access to all the recipe and control variables, and the time it takes to write, test, and debug.
 
While the Arduino platforms are popular and relevant for simple systems, the analog capabilities are not good. For those that have minimal needs stick with the Arduino, but for systems with greater complexity you run out of resources on the Arduino platform and would be better off with an Arm platform.
Having written applications in both Java and .Net, I have a very good understanding of what is needed to code for a recipe to control application that has run time access to all the recipe and control variables, and the time it takes to write, test, and debug.

I'm not trying to doubt your expertise. In fact, quite the contrary. It's my experience that people who are very good with this stuff often forget what it was like to be looking at hardware process control design problems for the first time.

Arduinos have 10-bit adc, and I can't think of a brewing application that would benefit from more than that. The OP wants to read recipe parameters from a Bluetooth connection and use them to manage four relays, and there's no question that an Arduino can pull that off handily. As for managing an entire library of recipes, I didn't see anything in Adeering's design requirements to suggest that was even desirable, let alone necessary.

If there's a specific requirement of the OP's project that you find to be limited by the arduino hardware, I'd be interested to hear your thoughts. But, the fact that an ARM system is more powerful doesn't make it better. I've done something very similar to what is being described here, and it was a breeze to code and debug even with my very limited experience. Why move to something more complex just for the sake of complexity?
 
Looking at OP, there are more things needed than the 4 outputs listed, valving and PWM for elements.
If Arduino's meet all your needs and you do not want to expand functions as you grow the system, go for it.
IMHO it would be better to start with something that can grow as your level of experience grows with brewing automation, not spend time only to finally realize there is not enough code room, inputs, outputs or resolution to expand.
 
Looking at OP, there are more things needed than the 4 outputs listed, valving and PWM for elements.
If Arduino's meet all your needs and you do not want to expand functions as you grow the system, go for it.
IMHO it would be better to start with something that can grow as your level of experience grows with brewing automation, not spend time only to finally realize there is not enough code room, inputs, outputs or resolution to expand.

Or he could just hop up to an Arduino Mega and not even need to change his pin-out configurations.

I understand what's involved in this setup because, as I keep saying, I've done something very similar to it. On an arduino. Not only can it be done, it can be done without much sweat.

To the OP, if you someday want your controller to browse the HBD archives looking for recipes it thinks you might like and play Counterstrike with you while you wait for your mash to finish, you should start with something more powerful than an Arduino. If, on the other hand, you want a clean and user-friendly way of doing what you've described here with plenty of sample code, a supportive community, and ample room to expand, Arduinos are a great way to go. Let me know if I can help you in any way. :mug:
 
I am currently working on my Arduino controlled system as well, and it is coming along very well. I started out with an Uno and soon realized I would be needing many more output so I got the Mega and it is just the right thing.
My set up is pretty different from the OP's in terms of all the inputs are manual, but the control system I think will be the same idea.
I have four inputs: 4 buttons to choose between which step (HLT, Mash, Sparge, Boil), two dials to set temp and time, and two temp probes.
I then have three outputs: One LCD screen which displays the current temp, brew step, and time running (or whatever I program it to show), and two LED 7 segment displays which show the dialed in Temp and Time.
Aside from that I also have LEDs to show which process is running, manual override switches for all the individual components, and of course a board full of relays which the Mega controls.
On the relay board I have one relay to turn on gas, one for a spark, one for a pump, and a few others relays for some other components, but of course anything could be hooked up to the relays.

As a power supply for the entire thing I got a cheap computer PSU and used the lines from that to power the system.

All in all Arduino has worked very well for me and I would be more than happy to pass on any information you may want.

Good luck
 
Thanks for all the replies and comments. While I agree with the fact that an ARM based board would be more powerful, but as been mentioned I dont need it to do much. I am planning on having the arduino do the following things only:

1. Control Element-will turn it on and off and depending on feasibility use the PID library to control temp
2. Turn pumps on and off
3. Output to tablet and various LEDs and a LCD display

The Idea right now is that the android will do the thinking and just tell the arduino when and what to do. This might evolve once I do more research and turn into more of the android just displaying what the arduino is doing and allow for user input, but well see when I get there.

Question for Malfet (or anyone who can answer)-
Lets say I wasnt going to use the android at all, would a single Arduino Mega be able handle control two elements like a PID and two pumps (basic on/off) based on inputs
 
Question for Malfet (or anyone who can answer)-
Lets say I wasnt going to use the android at all, would a single Arduino Mega be able handle control two elements like a PID and two pumps (basic on/off) based on inputs

Sure, no problem. You would just need four digital pins to control the SSRs. Keeping two PIDs going simultaneously is very manageable. Presumably you'd want a few temperature sensors of some sort too, no? Any valves to drive?

Anyway, all that can be handled by a simple Uno, assuming you don't need much more than what you've described already (I'm not familiar with the Brutus 20, though, so I'm not sure what else you might need). The thing that might push you into Mega territory would be if your I/O starts getting complex. If you're just feeding commands to the controller via bluetooth, I suspect you'd be fine, though I haven't used the bluetooth library personally. If you want to start adding datalogging, internet connectivity, LCDs, more sensors, etc., then you might start running low on codespace with just an Uno.
 
I have the BrewAide program and have written Android apps also. This is very intriguing to me. It sounds like you can have the Android device do all the heavy lifting and the arduino would just do basic sensor monitoring (PIDs/sensors) and on/off commands to SSRs.
 
Ok thanks for the reply. To be on the safe side Ill probably go with the mega, for the $20 more I think its worth it for the extra I/O and code space. Also I will probably want to put in backup manually controls to use instead of the tablet as well so it will be nice to have the extra.

Another question, to control the SSRs is there something that I will need to go between the Arduino and the SSRs or can the Arduinos digital outputs control the SSRs directly
 
An Android control interface would definitely be nice. Is it impossible to implement with a BCS or BrewTroller, or did you just want to do it a different way?
 
Ok thanks for the reply. To be on the safe side Ill probably go with the mega, for the $20 more I think its worth it for the extra I/O and code space. Also I will probably want to put in backup manually controls to use instead of the tablet as well so it will be nice to have the extra.

Another question, to control the SSRs is there something that I will need to go between the Arduino and the SSRs or can the Arduinos digital outputs control the SSRs directly

You need to make sure all your power specs are compatible, but in general SSRs can be driven directly from the Arduino's logic pins. Both the mega and the uno provide 40mA per pin, I believe. There are many SSRs that will work fine with that.

The mega will give you a lot more flexibility as far as manual controls go. Those are generally very simple to code, but they will monopolize your pins quickly. Plus, if you've got pins to spare you can always use cheaper parallel rather than more expensive serial LCDs for display.

I have the BrewAide program and have written Android apps also. This is very intriguing to me. It sounds like you can have the Android device do all the heavy lifting and the arduino would just do basic sensor monitoring (PIDs/sensors) and on/off commands to SSRs.

You certainly could do it that way, but personally I've had better luck keeping all the control code directly on the microcontroller. Unless you're trying to do something very complicated and unconventional, the ATMega chips are plenty powerful manage the whole thing. If you keep the brains of the operation on a separate device, you risk having the whole thing fall apart if you have connection difficulties.

The strength of Android in this relationship is its great human interface APIs. If I were designing something in that direction, I'd keep all of the actual control logic on the Arduino and then let the Android handle just user interface and perhaps data visualization. It's easy enough to design a simple command and data protocol that will let the arduino and the android talk to each other over bluetooth or whatever.

But, that's just how I'd do it. There are plenty of ways to skin this cat.
 
Thanks, Ill check the specs for the SSRs Im planning on using and see if they will work.

My general plan is to have the arduino do everything and have the android just be an input source and User interface. Now there will be some android side work based on when to send the signals to the Arduino.

If possible I want the arduino wired to accept input from both the Android device and have manual switches on a control box. This way I can hook up the tablet and have the tablet automate everything based on a recipe to send the right controls to the arduino. Or I can flip switches and set the temps manually on the control box.

Im planning on using the Arduino Mega ADK which has a USB interface already built in that works with android. Google has a library for working with arduino already as well, so the general app should be easy to do. Heres my general thought process right now, let me know if this sounds reasonable or if im missing something big. Also not sure how many pins the things like temp probes and switches will take up

Heres the inputs I see having:
2 - temp probes
2 - basic on/off switches for pump
2 - ARM/DISARM switches for elements (idea will be when using them manually to flip these switches to arm the elements then use the LCD display/buttons to set temp and the PID library will control the output to turn elements on and off)
4 - buttons to control the LCD screen and set temps (Mode, Up, Down, Set)
1 - USB interface (this is already taken care of by the Arduino Mega ADK, this can interface with android devices through USB, which is perfect)

10 - total not counting the USB

Here are the outputs I see having:
2 - SSRs for the pump on/off control - assuming will need 2 pins
2 - SSRs for the element on/off that will be controlled by the PID library - 2 pins
1 - the USB interface can both send and receive so that will talk to the android
1 - LCD display to display whats happening and select temps for elements to hold - needs 11 pins
4 - Lights to show when pumps/elements are on
1 - Buzzer/Alarm for signalling temp has been reached

10 - total not counting the USB

Also for those not familiar with a Brutus20 here is the link to his page that gives a brief description, his is with Gas but youll get the idea

Some things I can see being added to the output side if I decide to go complete automation, because my system will need the output of the pumps changed throughout the brew day I might decide to go with some valves and what not, so would need those, my current estimate based on my design would be 5 valves, which Ill still have plenty of outputs for that and should be fine.

Thanks for the help, gonna order the arduino and start playing with some simple on/off control to get the hang of it and will continue to update with questions/progress
 
On the whole, looks good. A few things:

Thanks, Ill check the specs for the SSRs Im planning on using and see if they will work.

My general plan is to have the arduino do everything and have the android just be an input source and User interface. Now there will be some android side work based on when to send the signals to the Arduino.

If possible I want the arduino wired to accept input from both the Android device and have manual switches on a control box. This way I can hook up the tablet and have the tablet automate everything based on a recipe to send the right controls to the arduino. Or I can flip switches and set the temps manually on the control box.

I think that's a good approach. The thing is fully controllable by manual controls, but the Android adds the ability to automate and display data.

Heres the inputs I see having:
2 - temp probes
2 - basic on/off switches for pump
2 - ARM/DISARM switches for elements (idea will be when using them manually to flip these switches to arm the elements then use the LCD display/buttons to set temp and the PID library will control the output to turn elements on and off)
4 - buttons to control the LCD screen and set temps (Mode, Up, Down, Set)
1 - USB interface (this is already taken care of by the Arduino Mega ADK, this can interface with android devices through USB, which is perfect)

10 - total not counting the USB

Here are the outputs I see having:
2 - SSRs for the pump on/off control - assuming will need 2 pins
2 - SSRs for the element on/off that will be controlled by the PID library - 2 pins
1 - the USB interface can both send and receive so that will talk to the android
1 - LCD display to display whats happening and select temps for elements to hold - needs 11 pins
4 - Lights to show when pumps/elements are on
1 - Buzzer/Alarm for signalling temp has been reached

10 - total not counting the USB

So, if the purpose of the lights is to tell you when the element is on, you don't actually want it controlled by the microcontroller but rather sitting in circuit with the element itself. This is for safety as much as anything else. You want the light to indicate when the element is on, not when the controller thinks the element is on. (Of course, if everything's working right, the element's being on and the controller's thinking it is will be the same thing, but it's safer to assume your code might have bugs or your hardware might fail.)

Some things I can see being added to the output side if I decide to go complete automation, because my system will need the output of the pumps changed throughout the brew day I might decide to go with some valves and what not, so would need those, my current estimate based on my design would be 5 valves, which Ill still have plenty of outputs for that and should be fine.

Thanks for the help, gonna order the arduino and start playing with some simple on/off control to get the hang of it and will continue to update with questions/progress

Sounds good! Before you start getting to invested in code, consider drawing up your plumbing and wiring diagrams. Once you have a clear sense of what plugs into where mechanically, it'll be easier to figure out how to automate things.

Good luck! Keep us posted.
 
On the whole, looks good. A few things:



I think that's a good approach. The thing is fully controllable by manual controls, but the Android adds the ability to automate and display data.



So, if the purpose of the lights is to tell you when the element is on, you don't actually want it controlled by the microcontroller but rather sitting in circuit with the element itself. This is for safety as much as anything else. You want the light to indicate when the element is on, not when the controller thinks the element is on. (Of course, if everything's working right, the element's being on and the controller's thinking it is will be the same thing, but it's safer to assume your code might have bugs or your hardware might fail.)



Sounds good! Before you start getting to invested in code, consider drawing up your plumbing and wiring diagrams. Once you have a clear sense of what plugs into where mechanically, it'll be easier to figure out how to automate things.

Good luck! Keep us posted.

Good points, didnt think about the light being able to be controlled like that and that is a good idea. That will save some I/O connections also.

Ive got a basic diagram of the system currently and it doesnt currently include any valves for the pumps, the connections will be quick disconnects so im planning on switching manually at first. But it might change later when I run out of things to DIY and want something to do :p

Ill keep this forum posted and I have another thread on the overall build as well
 
For those of you using arduino for your control, what LCD modules are you using for your display. I got a basic 16x2 but not sure I like it, or how it will look when mounted so looking for suggestions. Doesnt need to be anything crazy as its going to be just minor display. Also if it has buttons included on it for input that would be a plus
 
For those of you using arduino for your control, what LCD modules are you using for your display. I got a basic 16x2 but not sure I like it, or how it will look when mounted so looking for suggestions. Doesnt need to be anything crazy as its going to be just minor display. Also if it has buttons included on it for input that would be a plus

If you're looking for an alternative to the standard 16x2 LCDs, there are lots of good options. There are a handful presented on all the maker sites, such as this one: http://adafruit.com/category/63

Once you have a sense of what you're looking for, you can find one that fits your precise specifications on something like digikey or mouser.

I've never seen a lcd that combines buttons, as there's not much to be gained by combining the electronics. Instead, you might be looking for a nice enclosure with cut slots for your lcd and controls? Once you have a sense of what you want for that, there are plenty of good options.
 
For those of you using arduino for your control, what LCD modules are you using for your display. I got a basic 16x2 but not sure I like it, or how it will look when mounted so looking for suggestions. Doesnt need to be anything crazy as its going to be just minor display. Also if it has buttons included on it for input that would be a plus

Hi

Displays are a staple item on eBay....

Bob
 
Atempting to do something very similar myself. I have kettles all ready but waiting to gather some more funds and time to do electrical work. I'm developing diagrams for everything right now too so I will gladly share anything as I get it all going.

As for displays, I went with a 20x4 disply which is using the same basic interface protocal as the 16x2 ones you are talking about.
 
Hi

The bigger questions about displays:

1) Do you need / want graphics? There are a lot of places where a graph can come in handy....

2) How about a touch screen? Definitely got the wow factor. Can be a bit exciting to program so it's not a hassle to use.

3) Do you need anything more than an "I'm ok" LED? Web interfaces and phones can do a lot more than any little display will ever do. Can be *very* cheap if all you have is NRF 24L01 acting as a client and something else as a server.

Bob

Bob
 
Im using my android tablet as the primary interface/display. Im going to have it load recipes from either BeerXML or BeerSmith and load the steps that will control the arduino.

I ended up getting both a 16x2 and 20x4 to play with and use, but I think im going to use the 20x4. Now I just need to figure out which buttons to get for buttons underneath the LCD for control, the mini buttons seem really small to be mounted, so would like something a little bigger, but its either those really small ones or the big 35mm ones.
 
Hi

The bigger questions about displays:

1) Do you need / want graphics? There are a lot of places where a graph can come in handy....

Right now I'm using Processing, which is a Java based graphical programing language, to graph out my data. There's also a good controls library called CP5 for it that abstracts away some of the micromangement of coding in buttons and i/o fields.

2) How about a touch screen? Definitely got the wow factor. Can be a bit exciting to program so it's not a hassle to use.

For me, I'm planing on either messing with labview or android for a front end that will make use of a touch screen, but i'm only slowly getting into Java so that's a ways out. Still just wanting to brew something...

3) Do you need anything more than an "I'm ok" LED? Web interfaces and phones can do a lot more than any little display will ever do. Can be *very* cheap if all you have is NRF 24L01 acting as a client and something else as a server.

Bob
yup, this works perfectly well too. Just not quite as flashy. Though checking on your brew while out of the house does have a certain sense of bling to it.
 
.....yup, this works perfectly well too. Just not quite as flashy. Though checking on your brew while out of the house does have a certain sense of bling to it.

Hi

If "no screen" works fine (to grossly over simplify) then it's the easy winner. Less parts = better reliability. Fewer holes for mounting things = more rugged. Less code on the local "little guy" = fewer bugs to track down. Lower cost = more money for beer :mug:

It's easy to get into the "because I can" mode of design and leave the "is it needed?" behind. Been there / done that a lot of times.

Bob
 
Hi

If "no screen" works fine (to grossly over simplify) then it's the easy winner. Less parts = better reliability. Fewer holes for mounting things = more rugged. Less code on the local "little guy" = fewer bugs to track down. Lower cost = more money for beer :mug:

It's easy to get into the "because I can" mode of design and leave the "is it needed?" behind. Been there / done that a lot of times.

Bob

exactly, I'm planing on starting out just the arduino running a single element at a time and uploading new code each time I need to change a setpoint. GUI and runtime changes in setpoints will come later after I have some batches under my belt.
 
Question about power, Ive been trying to figure out the best way to take the AC power in and have it converted to both 12VDC and 5VDC to power my pumps (12VDC) and the arduino (5VDC). I was thinking/recommended getting an old PC power supply and using that, which would work great but it takes a lot of room up in the control box. So thought a Universal laptop power supply might work. Heres what Im thinking

http://www.ebay.com/itm/90W-Univers..._Chargers&hash=item4ab8215b9b#ht_20629wt_1396

This would allow me to power both pumps from that through DC-DC SSRs and also use the USB plug to power the arduino. Does this seem correct or am I missing something. Also its a lot smaller so it wont take up as much room in the control box.

Also my pumps can run on anything from 8V to 24V so this cant overpower the pumps
 
It's easy to get into the "because I can" mode of design and leave the "is it needed?" behind. Been there / done that a lot of times.

Bob
Can I get a hell yeah!!!! Been there, doing that now. I started out simple and now have a monster growing in my shop. But I am having a blast blinging it out too. Just be carefull because you can go way over bufget if youre not carefull, ask me how I know that....
Wheelchair Bob
 
Question about power, Ive been trying to figure out the best way to take the AC power in and have it converted to both 12VDC and 5VDC to power my pumps (12VDC) and the arduino (5VDC). I was thinking/recommended getting an old PC power supply and using that, which would work great but it takes a lot of room up in the control box. So thought a Universal laptop power supply might work. Heres what Im thinking

http://www.ebay.com/itm/90W-Univers..._Chargers&hash=item4ab8215b9b#ht_20629wt_1396

This would allow me to power both pumps from that through DC-DC SSRs and also use the USB plug to power the arduino. Does this seem correct or am I missing something. Also its a lot smaller so it wont take up as much room in the control box.

Also my pumps can run on anything from 8V to 24V so this cant overpower the pumps

Hi

For just below $2 delivered you can get little universal switching regulator assemblies from any of a number of people on eBay. There are *many* examples, here's one:

http://www.ebay.com/itm/25106600546...X:IT&_trksid=p3984.m1497.l2649#ht_4643wt_1388

If you adjust the output to +6V, you can keep the +5 regulator on your board in place. You can of course strip out the onboard regulator. I'd keep it since that's the easier alternative and it will reduce ripple / improve regulation.

The board will run off of just about anything you have listed. I would not try to get high voltage out of it, but for anything in the +3 to +6 range it should do fine.

The advantage of running the switcher is that you get back to powering everything off of one voltage. That of course *assumes* your heavy loads all run off of the bulk supply and just the digital stuff is running on the +5.

Bob
 
Thanks for the info, Ill look into those and decide. I saw the one you posted on amazon and it was almost $30 so I turned away from it, but thats a lot cheaper on ebay, Ill have to consider. Though I am liking the idea of the laptop charger because it already controls and regulates the output and has the easy usb interface which plugs very nicely into the Mega ADK which im using.

Got a nice little shipment of some parts to start piecing some stuff together so going to start the build part of the thread
 
Ok so heres the first pics of the build:

Temp probes: Before on the left, after on the right, nothing major just attached a plug and covered with a flexible sleeving for appearance

20120718_202928.jpg


Next some work with the arduino, got the LCD wired and 4 buttons to control the pages, total of 5 pages: Overview, MT Element, BK Element, MT Pump, BK Pump. Dont have the temps wired on this one, but the code is there and have tested the probes they work great. Waiting on switches to come from china to test pump relays and element relays more. Also have the Android interface working and have tested with a single button, but need to do the coding and interface for all of that still.

20120718_203307.jpg


Initial outlooks looking good and not going to be as difficult as expected
 

Latest posts

Back
Top