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.
I just stumbled on to this thread because I had a similar idea of using the android platform to run an automated brewing system. Having beersmith files being pulled in was never a thought of mine since I don't use it. However, that would be a great feature for those that do.
 
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

Hi

By the time you get valves and stuff like that in the mix, you will need quite a bit of power at some voltage. Low voltage is always going to be a bit safer than running them off of 110 or 220. I'd go with a $10 bulk supply at +12VDC and get the relays / valves / what ever to match than voltage. +24 is also a reasonable choice, but the relay boards are a bit harder to find / more expensive.

Bob
 
So looking for a cheap plastic enclosure, I can get away with anything as small as 12x10x4. Waterproof isnt a huge deal for me as my plan for panel location is away and/or protected from general splashes. Any ideas?
 
So just got together a wiring diagram. I think its good, but wanted to get opinions.

Control%20Box.PNG
 
So a few things I am curious about.

What pumps are you using? I hadn't thought about finding a DC pump, but now that i do, that would be pretty sweet being able to control the pump speed. If that is what you are doing, you may want to have some low pass filtering to smooth out the ripple from the DC-DC SSR if you are using PWM.

Why the 4 pole switches on your elements? Looks like you have your interlock control circut feeding through 2 of the poles. That seems either redundant or defeating the purpose depending on how they switch in relation to each other.

I'm guessing all the input to ground resisters are pull down resistors. Is that required in this setting?

That's all I can see right now, other than that everything looks good to my non-electrician eye.
 
The pumps are Topsflo 15PV and can run on up to 24VDC, Im not regulating the flow with pwm just simple on/off control.

The switches are 3 position switches, with a set of Normally Open to talk to arduino via 5VDC to know whether the arduino or android is setting the desired temp. The second set of Normally Open is to give power to the 120v coil and The last set are Normally Close for the interlock and needs to go through both positions to make sure no power is able to go to the elements.

You are correct with the resistors and is needed otherwise the arduino registers inputs fluctuating with noise
 
I have been looking at the Raspberry Pi for some other projects. The problem I see with the Pi (and a minor one that is easily worked around) is the lack of inputs/outputs for sensors and parts. There are workarounds that are easy and well documented (a lot use an arduino to communicate with the Raspberry Pi) but still its extra work. And since the Arduino mega is more than enough to control what I need there really isnt a need for it. Now if I was planning something crazier then maybe
 
Ok little update to the project, ended up getting a metal 12x12x6 enclosure, its gonna be a little tight but i think having only the one arduino instead of multiple PID controllers will help. Got the start of holes drilled and just ordered the last receptacle from ebay. So next week hopefully Ill get the last of the parts and can do the wiring. Will post pics once everything is wired.

I also added in the ability to change the elements to PID or manual mode and also set a power percentage. Working on just getting the arduino side done right now and will do the programming for the android side while deployed. Also switched from 4 buttons to a joystick. This gives me the same functions as the buttons, but require less resistors and connections and easier to install.
 
Adeering, I have sooo many questions, mostly about symbols on your line diagram. I do not want to dominate or bore this thread, could you please recommend a book to learn this symbology. thanks.
 
The interlock is in bottom left corner, correct? It's interlocked with the pumps, and heaters? It turns the system off when these devices fail, or what?

Why a hard switch between Arduino and Android? Is that a function that is switchable mid-program? Like if you want to roam with Android and monitor/control?
 
The interlock is a safety relay so that the system cannot turn on unless all the switches are in the off position. This is a safety precaution to ensure that the power to pumps and elements are applied when the total system is turned on.

As for the diagram read theelectricbrewery.com for information What symbols are you curious about?

The hard switch between the android and the arduino on the components is so that there isnt a conflict of control between the two. You can switch the control at anytime throught the brew and wont effect the results. The only effect is that the element/pump will momentarily turn off while switching the switch from one to the other. But will turn right back on since the switches dont actually change anything except where the arduino gets the signal from. The way its set up is the arduino does all the work, the only difference is that when set to android, the android sends the set points for the elements and pumps, instead of the arduino. But the arduino then takes those setpoints and controls the SSRs.

That is the same pump as im using
 
The circle labeled 240V is a lamp, active when pump is on?

The two mirrored rectangles below Mega are two position switches (on/off?) for pumps?

Three positions of heater switches are off/Arduino/android?

Why aren't these switches inline with the 5V SSR circuits?

Those 8 circles that form the interlock make no sense to me. It seems to me that the functioning interlock is similar to an SSR? It's not an SSR?

After some study, I think I get it the diagram now. Now for some wiring questions?

How are the resistors sized?

Why both SSR and coil relay on heaters?

Why are there no feedback controls on this diagram?

Why does the interlock circuit need to go through both sides of these switches?
 
The two circles are lights that go on when the elements are on. I havent decided if I want to keep them or not.

The two mirrored rectangles below the mega are 3 position switches with 2 NO connectors and 2 NC connectors. The normally closed connectors are for the interlock (the top and bottom part of the rectangle) the 2 NO connectors are for the main switch to talk to the arduino.

Yes, the pumps/elements are three position switches Arduino/OFF/Android they talk to the arduino to let it know whether to look internally or to the android for the information on how to drive the SSR. The arduino works as a PID or can control the level of power to the elements/pumps

The interlock is similar in principle to a SSR but works differently. But basically the current from the interlock circuit has to be able to go all the way through the path to allow the current to contactor to allow the power from the main power

Resistors can really be any size as they are pull-up/down resistors, basically they are their to prevent noise from the switches, if you didnt have them the arduino would register small current and keep switching back and forth

SSRs have a small amount of leakage (about 4V for 120V system from what Ive seen with testing) while the coil relays do not. Also Im using the coil relays as a switch so that only one can be powered at any given time. This prevents me from accidently drawing more than 30A since Im doing a 30A system. If I was doing 50A I could run both, but would still use the coil relays as they prevent leaking current through which is safer.

What feedback controls are you expecting? Ive got the temp probes on their, that is the only one as of now that Im using, Im going to incorporate differential pressure sensors later for volume measurements but that is a future upgrade.

The circuit relay needs to include both positions of the 3 position switch that power goes through. Basically what it does is you create a path that when everything is off is a complete circuit with NC connectors on the switches, that way if a switch is not in the center OFF position the circuit goes to open and the circuit isnt complete.

I would recommend going to TheElectricBrewery.com its very informative and its where I got a lot of my information from.
 
Thanks

Oh I see temp now. It's unreadable in the rasterized image.

I would not say that I was expecting it , but I was looking for these things:
1. Measurement and control of flow in pipe, or pressure or level in pots. How does the pump know when the pot is empty? Or full? And no valve controls. That's all manual?

2. Reverse chilling flow control.

3. Mash stirring.

4. Valve controls to a fermenter.

I'm planning to automate pumping first; looks easier. Once I get that, I'll try my hand at the fill PID. Then a heat PID. :)

Edit: and what are the three positions of the switches on the pumps, on/off/auto?

Again thank you.
 
Just a small update, waiting on the 8pin plug-in for the interlock to get here from china. Just ordered a heatsink from heatsinkusa.com. Good prices and can get different sizes cut to length so got one that covers the space needed. Did a little test fit with the parts. Gonna head to Home depot this weekend pic up some paint and need more connectors. Once I paint it, get the heatsink drilled and installed Im going to mount everything and start wiring. Still need to get a hole saw for the 3 plugs and drill those holes. And heres the pic.

2012-08-17%2007.30.31.jpg


all the yellow cables are the for the switches and temp probe hookups. Still need to wire in the SSR outputs but that will be simple 4 wires out the opposite side of the enclosure. Last thing for the enclosure is the joystick needs to be mounted properly.

Heres another shot with the DC power supply

2012-08-17%2007.30.43.jpg
 
Last edited by a moderator:
Adeering-

I take it that you'll be wired from your Android to the Arduino? You're not going wireless? If so, why not? Was there any particular reason you decided to go wired? I'm curious because I'm tossing around the idea of doing something similar but via BT (preferably BT 4.0).

I just finished watching a vid on the Arduino blog and the interviewee mentioned that RedPark is close to releasing a shield for BT 4.0. http://arduino.cc/blog/2012/05/02/ios-and-arduino-a-talk/
 
I decided to go with wired because it required no extra shield and I dont plan on needing to take my android away from the brewery during the brew process. Im not going fully automated as I enjoy the manual part of brewing, just want the control of the electronics. So will still be right there and didnt see a need to try and make it so where I could move the tablet away. For the type of data bluetooth would work perfectly and is a viable option, I just chose to go with wired.
 
So finally finished the control box and everything is working on the arduino side and controlling the SSRs, I dont have the 240V installed in my house so cant test the plugs to make sure its working all the way through but connections are good and everything works great. The 12x12x6 is a tight fit but managed to fit it all in. The inside is a mess of wires as the box was to small to fit nice cable ties and terminals in. So didnt take pics of the inside but heres the ouside painted a dark blue with all switches and the LCD and joystick control. Gonna get the android side done while deployed and finished when i get back. The wires in the pic are for the elements the sleeves for all the cables.

20120901_163303.jpg
 
And heres the side of the case with the plugs, the holes were hard to get the right sized hole saw for the plugs, and since they werent flanged (found these for real cheap on ebay). Used some stuff called Sugru which air cures to mount them and fill in the gaps. Came out pretty good. Need to clean main power outlet as the gorilla glue expanded a little more than expected and came out the sides. So need to clean it up.

20120901_164214.jpg


20120901_164226.jpg


Overall it couldve come out a little nicer but it will do the job and once I order the tags for everything it will be a little easier to look at. And the android interface will make it so much better. Considering I had to improvise on all the tools it works.
 
Ok so stuck overseas for another 3 months but I just placed an order for some stout tanks. Decided to have a nice easy setup instead of trying to install all the ports myself. This is the summary of what I got.

Boil Kettle:
15 Gal with tangential inlet
-Element port added
-Thermowell moved to rear and lowered to allow for easier measurement of 5 gal batches

Mash Tun:
15 Gal Mash Tun with bottom drain
-Rims Module included

Gonna install the elements and temp probes and should be good to go. Will need to still build a housing for the wiring for the elements but have that figured out already.
 
i know you are already off and running, but i wanted to comment on this... maybe it will give someone else an idea of what is required.

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

there is a lot in that list that doesnt need to, or shouldnt, be taking up a pin on the microcontroller.

1-temp probes. you can chain up to several hundred DS18x20 temp sensors on a single input pin.
0- basic on/off switches for pump- pumps can be manually controlled, and probably should be anyway so that they arent turned off when you arent around, lose prime, and start up and burn out on their own. you shouldnt need to be cycling the pumps more than a few times in a 6 hour brew day, so a manual switch should be fine. (unless you are going for 100% hands off automation...)
0 - ARM/DISARM switches for elements- this should be hard wired contactors with nothing in between to fail or have possible software bugs.
4 - buttons to control the LCD screen and set temps (Mode, Up, Down, Set)- OK
2 - USB interface- an atmega chip doesnt have on-board USB, so it uses two pins for TX/RX serial output. thisi is converted via intermediary chip to USB out

0 - SSRs for the pump on/off control- these should be on their own circuit; a simple on/off switch wired to power. an indicator light can be added directly after the switch.
2 - SSRs for the element on/off that will be controlled by the PID library -OK
11 - LCD display to display whats happening and select temps for elements to hold- OK (but there are many other ways to do this)
1- Buzzer/Alarm - OK

only thing im not sure about is the android interface. my guess would be that it will interface with either the serial TX/RX lines, or the FTDI chip that interfaces serial<>USB, so no additional pins are needed.

so you will need 10 pins, plus the LCD display for a total of 21. there are ways of driving an LCD with 5-8 pins, depending on the size of the display and on any intermediary controllers attached to it. you can also have the arduino stream the data to something else, so you wouldnt need 11 extra pins. so this number could be reduced if needed.

so this could be done with an arduino mega if you wanted to keep the 11-pin LCD display, or even with a arduino pro mini if you had some other way of displaying the data (like on a PC or something, streamed out via serial/USB).
 
Yeah that initial post i was just getting started with arduino, Ive since learned a lot and have everything wired
 
So In 10 days I get back from deployment and I just got an email from Stout Tanks saying my tanks are done. So I should be able to start the rest of the build soon
 
So I have received my tanks and have almost all the parts required. Ill take some pictures of everything later today. Was gonna try and make my own element housing, but ended up deciding that I would like something that looked as nice as the rest of my setup and just went with the BrewersHardware 2" triclover ones. They are a little pricey for what i wanted to spend, but will go nicely with everything and save me from having to find a welder to use.

Still need to get an electrician out to install the 240v outlet in my garage.

Once I wire the elements cords and the main plug for the control box I should be good to go for a test and hopefully the first brew. Need to do some testing with the Arduino PID settings to make sure it works, but all in all its just about there

The android side of control is on hold for a moment as I need to update BrewAide first with the new interface and bug fixes when I get time.
 
Stout Tanks did a wonderful job with the tanks and brewers hardware has a very nice 3way tri clover ball valve. All in all im very happy and excited to test it out next weekend (hopefully the last few parts make it here in time). Once I test my programming on the arduino Im making my Citrus IPA for my first batch. One that I know how it should taste and have made many times
 
So got the 240 outlet installed yesterday (by an electrician, expensive but better safe than sorry) and tested my control box. Had a problem at first and it kept tripping the GFCI breaker. After rewiring everything and trying again got the same result.

So started following the current and flipping the breakers on the inside to determine what is causing the problem. Found out that I had the laptop charger (which im using to convert 120 to both 12-18VDC and 5VDC to power the pumps and arduino) was causing the problem.

Took a little research and fiddling but found out that I had the neutral going into adapter connected to ground instead of neutral and was causing the trip. Fixed and the box worked great (even with the loud noise from the contactors :) )

Ordered the wrong size element housing from BrewersHardware on accident so had to have him send me two of the right size and returning the other ones, so havent got the elements wired completely yet, but they are coming today.

Need to stop by the hardware store and get some thermal glue to install the temp probe on the brew kettle thermowell and a plug for the rims tube as Im not using a float switch currently.

Later today when I get off work and probably sunday Ill run some test with water to make sure the PID is working right with the arduino and then make my first batch.

Its been about 6 months since I started and looking forward to seeing it in action

As for the Android side of things, Im going on leave for 2 weeks and will have time to finish the interface then. The control box is already setup to talk to the android and viceversa but need to finish the interface and functions on the Android side. Should take me a day or two of solid programming to get it done

(Also will be starting another project as soon as this is up and running, not gonna say much but it will include 4 taps, chilled mixed drinks and automation. So if interested keep eyes open for that)
 
To add legitimacy (which seems to have already happened) to the Arduino / Android build, I figured I'd chime in.

I have a two-vessel Arduino controlled RIMS setup (although I'm currently tearing it apart as I switch to HERMS...). I then used a WIFI shield on the Arduino, and exposed a REST API for control. The Arduino can be triggered to run setpoint and PID control with the temperature probe in the RIMS tube as the feedback. It can also be triggered to run the pump without heating elements active for transferring between vessels.

I then wrote an Android application using PhoneGap (Cordova) which interacts with REST API of the Arduino. This allows me to have a nice touch interface to set up and control the brews. I use my Nexus 7 tablet on brew day, and I designed the interface to work best at that resolution / screen size.

Let me know if there's anything I can help with, although, it seems like you're well on your way. I was thinking of posting my code to github at some point for anyone else to use / improve.

control_box.jpg


overall_setup.jpg


system_setup.jpg


Screenshot_2013-02-16-13-53-26.jpg


Screenshot_2013-02-16-13-53-33.jpg
 
Back
Top