New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
indivisualist
Old
(Last edited by indivisualist; 3rd August 2012 at 07:50 PM.)
#1  
Junior Member - OP
Thanks Meter 1
Posts: 16
Join Date: Jan 2012
Calculator Looking for a USB "controller" like Arduino ...

I am looking for something specific, but don't know what … maybe you guys can help me out.

Let me provide some background first. There are special controllers for espresso machines available which act as a PID controller for temperature regulation. To simplify things: They read the temperature of the water and regulate the heating element to a specific temperature with much greater precision than the integrated "mechanical" thermostat is able to.
Today there are kits for various espresso machines available, but they are rather expensive. So I was thinking: Well, what about some homebrew stuff (no pun intended)? I could fit more functionality in there and – here comes the interesting part for the XDA community – connect the controller to my Galaxy Nexus!

My first idea was grabbing some development platform (e.g. Arduino or IOIO), but I'm not sure if this is the right approach. Let me explain what the perfect board can do:
- read two or three temperature probes
- read a water level sensor
- read and control four switches
- provide some kind of CPU for acting as a controller
- provide a clock to "wake" the machine in the morning
- provide a USB connection for controlling from Android and programming/flashing from OS X
- optional: Bluetooth functionality for wireless Android control

I can figure out how to wire the stuff together and how to write some PID software. But the most interesting part will be the Android connectivity, but I have no idea what platform I can use …
It would be awesome to plug a USB cable in (or connect via Bluetooth) and read the live temperature data, start/stop the brewing process and so on. The PID has to regulate the machine without the phone – depending on the switch state (i.e. "pull a shot" or "make steam") the heating element would be regulated.
Of course there are even more interesting applications, like sending a tweet ("I just brewed a coffee!") or a pressure readout …

As far as I understand, I just have to look for a single-board microcontroller with some analogue and digital inputs, some digital outputs and a USB connection. Is this possible with something like an Arduino? Or do I need something more complex?
 
abouttocrash
Old
#2  
Junior Member
Thanks Meter 3
Posts: 18
Join Date: Dec 2010
Hey! Nice to see another homebrewer! They sell chips like that already. People have converted freezers to kegerators, and the chip manages the temp, turning on the freezer around 55 degrees F.

Sent from my SCH-I535 using xda premium
 
SirLalala
Old
#3  
Junior Member
Thanks Meter 1
Posts: 2
Join Date: Aug 2012
I would suggest you toying with Android ADK

This is a board you could use is: arduino.cc/en/Main/ArduinoBoardADK it's a bit pain in the ass to set it up for the first time but once you get used to it it's pretty simple
 
indivisualist
Old
#4  
Junior Member - OP
Thanks Meter 1
Posts: 16
Join Date: Jan 2012
Freezer? 55 degrees? I'm talking about brewing espresso … The problem there is temperature stability within 1° Celsius.

I already learned more about the Arduino platform and I think it is the right idea for my small project.
As far as I know a bluetooth connection via Android can be established, too.
 
thedrcarl
Old
#5  
thedrcarl's Avatar
Junior Member
Thanks Meter 2
Posts: 12
Join Date: Jul 2010
You should definitely check out a book called;

"Programming Your Home: Automate with Arduino, Android and Your Computer"

Author is Mike Riley.

Publisher is The Pragmatic Bookshelf, Dallas Texas - Raleigh, North Carolina.

I'm pretty sure it's available as an e-book and is full of projects combining these technologies.

The first project has a ball float incorporated in it so I think it's perfect for your idea.

I'm working on a sous-vide immersion circulator at the moment, but it isn't too complex.
A PID controller does all the hard work.

PS
No barista in their right mind would let a machine steam milk!

---------- Post added at 05:48 PM ---------- Previous post was at 05:41 PM ----------

...almost forgot - ISBN-13: 978-1-93435-690-6
 
pankaj013
Old
#6  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Jan 2012
You can pretty much do everything including put the PID into the Arduino. You though will need to create the shield board with the extra sensors you need. Once that is available talking to the Arduino from Nexus is a cake walk. The USB Host and well as USB Accessory mode API is pretty straight forward and you can use either depending on how you want to interface the two. If you use some other microcontroller board other than Arduino then you will probably not be able to use Accessory mode but will have to use the USB Host with the microcontroller board exposed as a CDC class device using the USB as virtual serial port (Atmel, MicroChip controllers provide this interface). Also you will need to hack your Nexus to provide additional power supply (probably using Pogo pins) as USB port will be powering your controller board.

Best of luck!
 
Entropy512
Old
#7  
Elite Recognized Developer
Thanks Meter 21119
Posts: 11,602
Join Date: Aug 2007
Location: Owego, NY

 
DONATE TO ME
Quote:
Originally Posted by pankaj013 View Post
You can pretty much do everything including put the PID into the Arduino. You though will need to create the shield board with the extra sensors you need. Once that is available talking to the Arduino from Nexus is a cake walk. The USB Host and well as USB Accessory mode API is pretty straight forward and you can use either depending on how you want to interface the two. If you use some other microcontroller board other than Arduino then you will probably not be able to use Accessory mode but will have to use the USB Host with the microcontroller board exposed as a CDC class device using the USB as virtual serial port (Atmel, MicroChip controllers provide this interface). Also you will need to hack your Nexus to provide additional power supply (probably using Pogo pins) as USB port will be powering your controller board.

Best of luck!
If you have a device that supports OTG/USB Host, a USB-enabled microcontroller is MUCH cheaper than ADK (which requires the accessory to act as a host).

ADK should be described as "DDK" - Dock Development Kit. The requirement for the "accessory" to act as a host and to provide power makes it limited to dock-style devices. True accessories should be powerable from the device.

Adafruit's ATMega32U4 board is a great one to work with - https://www.adafruit.com/products/296

Another option, much more expensive but allows your device to be network-enabled easily (built-in Ethernet) is the BeagleBone. Lots of GPIOs on 0.1" headers and Ethernet.
*so much sig updating needed*

My Github profile - Some Android stuff, some AVR stuff

An excellent post on "noobs vs. developers"

A few opinions on kernel development "good practices"

Note: I have chosen not to use XDA's "friends" feature - I will reject all incoming "friend" requests.

Code:
<MikeyMike01> Smali is a spawn of hell
<shoman94> ^^^ +!
Code:
<Entropy512> gotta be careful not to step on each other's work.  :)
<Bumble-Bee> thats true
<jerdog> compeete for donations
 
arjag
Old
#8  
arjag's Avatar
Member
Thanks Meter 17
Posts: 65
Join Date: Sep 2011
Location: Adelaide
I would tend to lean towards arduino. It is certainly powerful enough. All the research I have done makes conecting bluetooth really easy. Although serial to android seems a bit more difficult. For the task you are trying to do I would expect a standard arduino (or clone) and a bluetooth module off of ebay (make sure you choose one that can handle 5v) should be a good starting point.

I have only every made diy arduino buy purchasing the usbisp cable and pl-2303 style usb>serial ttl adaptors. If you search on ebay some of them have the dtr line on one of the pins making auto reset easy. They are a bit more rare, but are worth searching for and paying a few dollars more.

I have never done brewing, but fiddle with arduino (atmega8 atmega168 atmega328 atmega644p atmega1284p). Feel free to ask questions.
 
deskwizard
Old
(Last edited by deskwizard; 14th August 2012 at 11:53 PM.) Reason: clarity
#9  
Junior Member
Thanks Meter 1
Posts: 11
Join Date: Aug 2012
Quote:
Originally Posted by arjag View Post
I would tend to lean towards arduino. It is certainly powerful enough. All the research I have done makes conecting bluetooth really easy. Although serial to android seems a bit more difficult. For the task you are trying to do I would expect a standard arduino (or clone) and a bluetooth module off of ebay (make sure you choose one that can handle 5v) should be a good starting point.

I have only every made diy arduino buy purchasing the usbisp cable and pl-2303 style usb>serial ttl adaptors. If you search on ebay some of them have the dtr line on one of the pins making auto reset easy. They are a bit more rare, but are worth searching for and paying a few dollars more.

I have never done brewing, but fiddle with arduino (atmega8 atmega168 atmega328 atmega644p atmega1284p). Feel free to ask questions.
I will have to agree on that one, but only by experience.
those chips are a pleasure to deal with.

I even got my tablet talking to mine before I screwed it up! :P

Hit me up here or on #arduino on freenode (or anyone else there for that matter) if you want any hints or help if you decide to go that route, I'd be happy to help!

DW
 
tsironakos
Old
#10  
tsironakos's Avatar
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Aug 2012
Location: Athens
You should try Arduino board, it's not that difficult to use and they're plenty of resources on the Internets.

Also, you could develop an Android app for controlling it. My team had successfully developed an Android controlled RC-car via Bluetooth.

You could find the source code of the Android app here on Github!

Tags
controller, pid

XDA PORTAL POSTS

Avoid Framework Bootloops on Xperias Running Jelly Bean

If you’re a Sony device owner running a stock Android Jelly Bean firmware and … more

Forum Added for the Samsung Galaxy Mega

What do you do when the Galaxy Note line is simply not big enough? You get theSamsung Galaxy Mega. … more

Voice Control Your Phone with Tasker and AutoVoice – XDA Developer TV

XDA Developer TV Producer Kevin set up his phone to respond to … more

Guide to Take Better Control of Your Volume Levels

Would you like to know one of the things that really annoys me on a daily basis? Tough, … more