General Arduino Discussion

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.

98EXL

Well-Known Member
Joined
Mar 28, 2007
Messages
3,131
Reaction score
15
Location
Maryland
General arduino discussion...I had some really stupid intro for this, but lets get down to the nitty gritty.

I know some of you have been using these nifty little boards for quite some time now, and have started to incorporate them into your brewing rigs. I want to get into the Arduinos, my buddy knows PIC really well already. I just picked up a Sanyo 4912, so kegging is around the corner for me. I'm pretty well aware of what I need to do to get that setup, however I really want to mix my love of beer, brewing, and electronics into a nice little project. Part of my problem is I don't know anyone personally to talk about these things, the internet seems a little limited in that, and I don't have one yet either, so I'm sure once I can start to play with one, and create some sketches or drawings in C, or whatever they are called, I'll be good to go. Here is where I am so far on the concept side of things.

I know I can take a Arduino, use it as a temperature controller for the fridge, that part seems pretty easy, except I still don't understand what these 1-wire sensors are, where to get them, and why they are better.

What I would really like this board to do for me is this:
  • be the temperature controller for the kegerator
  • give me CO2 tank pressure
  • text or email me updates when tank pressure is low
  • give me above values on an LCD screen (I've never worked with those before)
  • I'd like to be able to input what brew is in each keg, and when it was tapped, but I don't know if that's possible without reprogramming it

I don't know which board I should get, or what sensors I need, but I think having just a general discussion where we can post code snippets would rock, hardware side I am pretty comfortable, software side I'm fine, just never done both before.

So let the commenting begin
 
You only need a standard Diecimila (ATMega168). A Duemilanove (ATMega328) will do just fine if that's all you can find for sale, but you won't need the extra memory or features.

Use an MPX4250GP sensor for CO2 pressure. It's easy to interface and will register up to ~37 psi.

Use an LM34 temperature sensor (or LM35 if you prefer Celsius). EDIT: 1-wire sensors are cool, and there is plenty of example code for interfacing with them. The DS1820 is a popular one. You get better resolution and potentially faster/more efficient (on the order of nanoseconds) use of your Arduino when using them, but they are a bit more complex. The LM34 would still be my go-to device for kegerator control (simple, cheap, easy).

Get a serial LCD and look at http://www.arduino.cc for example code.

If you use a networked computer to interface with the board, you don't need any more hardware, but you'll need to write some serial code to interface with Arduino and transmit the results. Dynamically changing the LCD titles would be pretty trivial that way. If you want to plug the Arduino directly into the network, look into an Ethernet shield. All of the code could be self contained, but the Arduino code would get a bit more complex.
 
The only reason why I am leaning not towards that is because I'm going to want to use the arduino for other projects, and I want to use the same base controller to do a few of my projects
 
Re-inventing the wheel is fun!!

I prefer the term "parallel inventing".

My project is in it's infancy, and has been pushed to the back burner until my "physical" brewhaus is built, but it has quite a bit of flexibility including some insane possibilities like voice activation. "Brew me an IPA, please!" Though vocal response will most likely be the voice app that I use right away: "Hey, boil point is approaching!".

Those are bells and whistles. What I wanted most was nice charts of my Mash temps.


1-Wire Temperature Monitor
 
My parents are at an age where they prefer me to simply tell them what to buy for Christmas for myself and my family. I will be getting a Duemilanove for Christmas this year. I haven't done any programming for a very long time, but I'm in electronics for a living. I'm still collecting essentials to build my electric brewery, but in the interim I'll have to learn how to program the board. I'll be using it for other applications as well.

I want to monitor my sewer pump, water pump, and heat pump, sump pump, and sump level. The sewage pump will likely be monitored by placing a small 120VAC relay across the pump switch contacts. When the switch is open it will produce 120VAC across the relay coil causing it to activate. I'd like to monitor the duty cycle of the pump so that I know when the filter is getting clogged and needs to be cleaned. There will be an alert level and then an alarm level. I'd like to have a remote alarm panel that is located upstairs away from the pumps.
 
the whole home monitoring aspect really opens up a lot of possibilities...so you have a sewage problem?
 
the whole home monitoring aspect really opens up a lot of possibilities...so you have a sewage problem?


Not a problem, I just have to take care of it myself. I have a holding tank and a pump that send the effluent to an above ground injector a couple of hundred yards from the house. The tank separates solids from liquids but hair and soap crud gets through. I put a filter on the intake to the pump so that the solids that get through don't clog my injector. If the filter clogs too much there isn't enough pressure to eject the nasty. If that happens in the winter, the whole thing freezes up the stack and we no longer have indoor plumbing. That makes SWMBO cranky.
 
Or you could have a look at the Fermtroller at http://www.brewtroller.com. The Fermtroller is based on a Anduino AT-Mega and they have some software already written. Why re-invent the wheel?

Those of us who are interested in the Arduino are tinkerers. We like to build our stuff instead of buying it off the shelf. Nothing more fun that getting a microprocessor to do your bidding.
 
Where would one start to learn programming for an Arduino say, if one was.... completely unfamiliar with anything other than simple database work. And I wrote basic programs on an Apple IIe in 7th grade....lol. Is there a "For Dummies" book or site?
 
Protean Logic makes some neat little BASIC programmable micro-controllers. I used them extensively for telemetry payloads back in my high-power rocketry days.
 
The examples on www.arduino.cc make it easy to learn by progressive editing - pick out a program that does something you can observe, then tweak it a little, see what happens, etc.

Just don't try to make it do too much. I went through an overzealous phase with mine where I built lots of classes with lots of bells and whistles and ran it out of memory pretty quickly. (Hint: strings take up a lot of memory, relatively speaking.) When I backed my expectation down from "it's a standalone PC" to "it's a microcontroller that has communication capability" I got more reliability.
 
Those of us who are interested in the Arduino are tinkerers. We like to build our stuff instead of buying it off the shelf. Nothing more fun that getting a microprocessor to do your bidding.

It's not really off the shelf. The Brewtroller is simply a Arduino AT Mega board with the pin outs neatly organized. Which makes it easier when wiring your project. It's available as a bare board, built or a kit. Jeremiah Dillingham, the designer of the Brewtroller is an avid brewer and member here. True, there is software written for those who choose not to write their own but it is open source and one could modify or write their own software. It's not much different than buying an AT Mega with a USB-BUB and shield to bring the I/O to terminal blocks.

DSC_0006.JPG


dsc_0005.jpg
 
I just ordered an arduino, some tri-color LEDs (yeah, I'm a sucker for oooh shiney), a white on black LCD, temp sensors and a few misc parts....I'm trying to make a nice arduino controlled kegerator. Once I get this part all done, I'll get the kegging guts in there.

I'm as happy as a pig in you know what. Friends of mine think I'm nuts...mixing electronics with beer, I think I'm perfectly sane.
 
Question for all you microprocessor experts out there. Is there an easy way to setup a microprocessor to be driven by a computer? It seems to me a microprocessor is the "brain" of whatever its in control of, i.e. the code on the microprocessor needs to know when to take readings, when to turn something on or off and so on.

The issue I have is I want a program on my PC to be the brain, and the microprocessor to simply be the hardware in charge of turning on and off SSR's and taking readings from sensors when the program on my PC tells it to.
 
Is there an easy way to setup a microprocessor to be driven by a computer?

Hmmm, the core of a computer *is* a microprocessor, with added interface for both input (keyboard, usb, disk drive, microphone, camera) and output (screen, usb, writable disk drive, speakers).

Devices like an Arduino provide an extra layer of input (thermometer, thermocoupler) and output (terminal switches).

I've not worked with an Arduino per se, but imagine that they can be interfaced pretty easily with simple languages like perl (or 'most any language for that matter) to do pretty much anything you'd want them to do.

The setup I'm working on uses a couple alternative devices for input/ouput (I/O), namely because it's what I had laying around to work with already.

The latest addition controls a simple heat pad to bump the temp on my mash tun. It's not PID, but seems to work just fine since it's not having to adjust very quickly.​
 
Hmmm, the core of a computer *is* a microprocessor, with added interface for both input (keyboard, usb, disk drive, microphone, camera) and output (screen, usb, writable disk drive, speakers).

Devices like an Arduino provide an extra layer of input (thermometer, thermocoupler) and output (terminal switches).

I've not worked with an Arduino per se, but imagine that they can be interfaced pretty easily with simple languages like perl (or 'most any language for that matter) to do pretty much anything you'd want them to do.

The setup I'm working on uses a couple alternative devices for input/ouput (I/O), namely because it's what I had laying around to work with already.

The latest addition controls a simple heat pad to bump the temp on my mash tun. It's not PID, but seems to work just fine since it's not having to adjust very quickly.

Yea, I should have used the term micro-controller, really I was just trying to refer to something like the Arduino.

Reading your setup, very cool BTW, what your doing with the 1-Wire Serial Adaptor is really what I was looking to do with the Arduino. Just some means of connecting external input directly to a computer. I really want to just avoid writing C code on the Arduino and go directly to programming against it using Java, .Net or a more robust programming language than C.
 
...
What I would really like this board to do for me is this:
  • be the temperature controller for the kegerator
  • give me CO2 tank pressure
  • text or email me updates when tank pressure is low
  • give me above values on an LCD screen (I've never worked with those before)
  • I'd like to be able to input what brew is in each keg, and when it was tapped, but I don't know if that's possible without reprogramming it
...

What I'd suggest is a load sensor under the CO2 tank, enter the tare weight of the tank into the system and it will tell you how much CO2 is left. Since the tank pressure is constant (at constant temperature) while there is liquid CO2 remaining a tank pressure sensor is pretty useless. While we are at it, lets put a load sensor under each keg with the system knowing the average tare weight of a keg and let it email/text/tweet the keg status as well as display it on the LCD.

At least that is what I'm thinking when I get the money.
 
Just some means of connecting external input directly to a computer. I really want to just avoid writing C code on the Arduino and go directly to programming against it using Java, .Net or a more robust programming language than C.

Damn! Sounds like you know more programming than I ever will. Sorry 'bout the rambling.

Again, I don't know enough about the Arduino to say, but a 1-wire adapter, and a relay board would work with any language that can 'speak' with the output port (digitemp does a wonderful job of collecting and formating temperatures). I use perl because it needs no compiling and I really don't know any better. Also for my purposes, speed is not an issue.​
 
What I'd suggest is a load sensor under the CO2 tank, enter the tare weight of the tank into the system and it will tell you how much CO2 is left. Since the tank pressure is constant (at constant temperature) while there is liquid CO2 remaining a tank pressure sensor is pretty useless. While we are at it, lets put a load sensor under each keg with the system knowing the average tare weight of a keg and let it email/text/tweet the keg status as well as display it on the LCD.

At least that is what I'm thinking when I get the money.

Money is right - load cells aren't cheap. I was looking into doing something like that and the price went right out the window.

Back to the topic of interfacing an Arduino: they have serial I/O and all you have to do is write a little routine to listen to the input and act.

scoates has a pretty good go-by that he discusses in this thread:

https://www.homebrewtalk.com/f51/arduino-kegerator-temperature-control-40997/#post531366
 
I really want to just avoid writing C code on the Arduino and go directly to programming against it using Java, .Net or a more robust programming language than C.
That's impossible. If you want to avoid programming a microcontroller, then you should look into creating a network of simple serial devices (like the one-wire temp sensors) that you can use to communicate directly with the serial port on a computer.

The Arduino needs a "sketch" to be uploaded. The language used by the IDE is a stripped down version of C++. The sketch could be as simple as a scheme to read and write serial data, but it needs something to make it tick. I'd rather put most of the control code directly on the Arduino and just send data to the computer for display or datalogging. That way a lost data link doesn't result in a loss of process control.

OT: Your comment about robust languages is mildly amusing and largely opinion. Depending on your perspective, C is quite robust, and perhaps more robust than your other examples. However, I do understand what you meant.
 
There are some PIC microcontrollers with onboard 12 bit ADCs. The PIC18 series has a couple of chips capable of 12 bit ADC and PWM, but I don't see any true analog out capability.

You could also use external ADC chips and an SPI interface to get 12 bit resolution with Arduino.
 
Would it be possible to use the arduino to supervise the RS 232 interfaced boards in a small scale distributed manner, or would the available memory for programming be too small.
 
Money is right - load cells aren't cheap. I was looking into doing something like that and the price went right out the window.

Back to the topic of interfacing an Arduino: they have serial I/O and all you have to do is write a little routine to listen to the input and act.

scoates has a pretty good go-by that he discusses in this thread:

https://www.homebrewtalk.com/f51/arduino-kegerator-temperature-control-40997/#post531366

hmmm.... Sparkfun used four of these for their tweeting kegerator. Of course they are weighing the whole kegerator not just the keg. At $20 for a sensor I think you could put the CO2 tank on a small platform assembly with the pressure sensor in there such that with a little math you can get a reliable measure of the weight.
 
hmmm.... Sparkfun used four of these for their tweeting kegerator. Of course they are weighing the whole kegerator not just the keg. At $20 for a sensor I think you could put the CO2 tank on a small platform assembly with the pressure sensor in there such that with a little math you can get a reliable measure of the weight.

I looked at those things too. The application SparkFun shows is a good use but even there he has some trouble with it. (The kegerator on the whole is a tour de force, I love the switches that capture the faucet state.) I was trying to figure out how to get individual weights on the cornies in my keezer and I struggled to imagine a platform that would be able to isolate each keg's weight on its own sensor. Not to mention the environmental operating issues with liquids from spills and condensation. I back-burnered it for now.

If you're doing one relatively static weight though like a CO2 tank I agree this could be a practical solution.
 
I started thinking one through for my own after seeing the keg project at Sparkfun and couldn't get past the idea that I need at least 3 force sensors per item I want to weigh. Otherwise any shift in position at all of what I'm weighing will throw off the weight. $60 per weighed items was more than I'm willing to go... I suppose you could rig a fixture at the base of the tank to make sure it stays in exactly the same place but ultimately that would be a bit "fiddly" for me. I'd love to hear some other ideas on this though because I would LOVE to have a good constant measure of my CO2 tank at least (if not my kegs too.)
 
Yea, I should have used the term micro-controller, really I was just trying to refer to something like the Arduino.

Reading your setup, very cool BTW, what your doing with the 1-Wire Serial Adaptor is really what I was looking to do with the Arduino. Just some means of connecting external input directly to a computer. I really want to just avoid writing C code on the Arduino and go directly to programming against it using Java, .Net or a more robust programming language than C.

Dozer,

There is a sketch that comes with the Arduino software called Firmata. If you go to http://www.acraigie.com/programming/firmatavb/ there are examples of how to communicate via VB. I have uploaded the sketch and tried each of the functions and it seems pretty fluid. To Yuri's point though, if you lose connection with the Arduino than it will do nothing so in most cases it would be better to make the Arduino the work horse and have the PC be the display (basically).
 
i've managed to get my Arduino to input values from several temperature sensors into a java program on my computer. The Arduino sketch simply sends the voltage from each analog input once every second. The java code then simply listens for the input and parses it as it comes in. Here's my project thread: https://www.homebrewtalk.com/f51/temperature-monitoring-control-arduino-155408/


I was just looking at that thread and had to laugh because I'm using my son's Electronics Lab set for a breadboard too! I couldn't find the one I have from college but I've ordered a really nice one from the interwebs. I hope it will be here next week.

I had a look at your Java code and had to hang my head a bit. I've been spending the last few days learning to program the Arduino and it's been going well. I had a look at your Java code thinking I'd like to do the same thing, but damn! That's a lot of code for such a simple app. Now I have to learn another language. The text book is going to cost more than my Arduino.
 
I was just looking at that thread and had to laugh because I'm using my son's Electronics Lab set for a breadboard too! I couldn't find the one I have from college but I've ordered a really nice one from the interwebs. I hope it will be here next week.

I had a look at your Java code and had to hang my head a bit. I've been spending the last few days learning to program the Arduino and it's been going well. I had a look at your Java code thinking I'd like to do the same thing, but damn! That's a lot of code for such a simple app. Now I have to learn another language. The text book is going to cost more than my Arduino.

Haha, excellent. The code could be much more compact; I'm just in the habit of making everything nice and modular so that the simple app can be expanded to do almost anything - side effect of still being a computer science undergrad! :cross: Really all you need is the code to listen for the Arduino output and then process it into useable values as well as any user interface stuff.
 
Back
Top