Programming Language?

Oh yes! Everything you ever wanted to know about equipment or ask about equipment, this is the place to be! Share photos or ideas about equipment here.

Moderator: Post Moderators

User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Programming Language?

Post by backyard brewer »

I'm sketching out what my next brew system will be like and I'm playing with different ideas for automation, information and control. I am looking at the Love controllers, Ranco controllers etc and I think it would be the ultimate in 8) to use my old laptop to monitor and control the brewery as needed. Anyway, I'm looking at a serial temperature logger kit and a parallel port relay kit or maybe a serial I/O module that has 4 inputs as well.

So my thought would be to have a graphical representation of my brewery with all of the critical temperatures displayed and a point and click interface to turn pumps or burners on/off as needed.

I know a lot of you program, what language (preferably open source) would you guys recommend I learn for this project? I have a little experience programming in a structured language way back when and BASIC way back when so while I understand conceptually what's happening, the actual language will be all new to me. Something that I could use in the real world would be great of course.

That little temp logger is actually very cool. It'll monitor 4 different temperatures. The magic is really in the sensor which is not just a thermistor but it's own little packaged device that sends data streams. The relay board is just a straightforward relay board and I haven't read much about the I/O module. It says it can be "programmed" via a serial cable but I'd rather just have it pass-through information and react when told too.

I could add a fermentation control routine as well. For a while now I've thought it'd be cool to have a "lager" routine that'll lower the temp X* every X hours until lager temp is hit. Phase two would be having the system email or text me if the temperatures went too far out of parameter.
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

I'd suggest looking at something like Arduino. You could do the same temperature monitoring, plus control the relays for the pumps, and push the information over USB. I built a simple temp logger / digital thermometer for fermentation monitoring and it was really easy. The language to program the Arduino is C++, on the client/PC side I would use something like Python or Ruby.

How do you plan to waterproof those DS1820's? You'd probably need to put them in a thermowell, or you could probably use the same temp probe you have now. I'd be nervous about putting the probe I built into the wort itself.
User avatar
jward
Posts: 2103
Joined: Mon Feb 21, 2005 10:22 pm
Location: Irvine, CA
Contact:

Post by jward »

I think those temperature sensors are from Dallas Semiconductor. You can run those suckers off of one wire (but 3 are better). I think I have a kit you can borrow if you want to (and I can find it). I believe that I have the parallel port connector version. There is free software for reading and running the protocol the sensors use. You can have a lot of sensors on one set of wires. Each sensor has an ID and you can ask each one individually to send their temperature. I came across these when a tech here was using them to make a security device.

You should be able to seal the sensor in silicone. The friend that made the circuit I use to control the fan on my foam box on a fridge fermenter box thing sealed the thermistors in some kind of silicone. It looked like they were dipped in a viscous liquid and not the gooey gel sealant that comes in a tube, so it should be easy to apply.
Image
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

Those are the one wire sensors that you're thinking of John. I was looking at them when I built my project, but I ended up going with the LM34 instead. If you're going to run a string of them, the one DS1820s are probably the better solution.

I've also seen people cut up SS tubing from a keg dip tube and seal the sensor in there with epoxy so that it could go in liquid. I just used heat shrink and hot glue on mine.
User avatar
jward
Posts: 2103
Joined: Mon Feb 21, 2005 10:22 pm
Location: Irvine, CA
Contact:

Post by jward »

You might contact SoCalDoug on the B3 forum. He builds controllers for living and build his own pH and temp readers. He was recommending (I think) thermocouples. You can get them in SS and use them just like you did with the Taylor or Polder thermometer you had in your Igloo mash tun. One measures the resistance to read the temperature. He was very big on their direct reading of the liquid and other benefits.
Image
User avatar
Rezzin
Posts: 1154
Joined: Mon Jan 09, 2006 7:00 pm
Location: Orange, CA
Contact:

Post by Rezzin »

It's over my head too but I still like reading about it - who knows, maybe someday I'll go this route and I'll have a little 'background; from reading this thread.
Image New Brew Club, Free Photo hosting, Yeast Library, Forum
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

brahn wrote:I'd suggest looking at something like Arduino. You could do the same temperature monitoring, plus control the relays for the pumps, and push the information over USB. I built a simple temp logger / digital thermometer for fermentation monitoring and it was really easy. The language to program the Arduino is C++, on the client/PC side I would use something like Python or Ruby.
OK, I'll check that out.
brahn wrote:How do you plan to waterproof those DS1820's? You'd probably need to put them in a thermowell, or you could probably use the same temp probe you have now. I'd be nervous about putting the probe I built into the wort itself.
I'll build them into copper or SS themowells, something permanent, not just a thermowell to slide the DS into.
jward wrote:I think I have a kit you can borrow if you want to (and I can find it). I believe that I have the parallel port connector version. There is free software for reading and running the protocol the sensors use. You can have a lot of sensors on one set of wires. Each sensor has an ID and you can ask each one individually to send their temperature. I came across these when a tech here was using them to make a security device.

You should be able to seal the sensor in silicone. The friend that made the circuit I use to control the fan on my foam box on a fridge fermenter box thing sealed the thermistors in some kind of silicone. It looked like they were dipped in a viscous liquid and not the gooey gel sealant that comes in a tube, so it should be easy to apply.
That'd be cool thanks!

I like the idea of just having them in a thermowell, but a thermocouple would be just as good if not better.

I was explaining the project to Steve and he was foaming at the mouth with the idea of point-n-click controls for the pumps and temperature.
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

brahn wrote:I'd suggest looking at something like Arduino. You could do the same temperature monitoring, plus control the relays for the pumps, and push the information over USB. I built a simple temp logger / digital thermometer for fermentation monitoring and it was really easy. The language to program the Arduino is C++, on the client/PC side I would use something like Python or Ruby.
OK, so... After some very quick reading let me see if I get it....

The Adruino would actually do all the work. Unlike the solution I was looking at, the actual control code would reside on the Arduino and the PC graphical interface would just gather and send new variables to the Adruino for processing as well as gather and display sensor readings. Right?

Did you build your Arduino or buy it assembled? I don't think I could solder or assemble something with all those SMT devices on it. Seems like buying it assembled is the way to go.
dhempy
Posts: 2357
Joined: Mon May 09, 2005 4:10 pm
Location: Santa Rosa Valley, CA

Post by dhempy »

BB .. I need to catch up with you on this one. I have some old links on this topic to share ... let me see if I can dig them out!

Dan
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

I bought my Arduino fully assembled, but they have simple versions that you can build yourself without all the SMD soldering.

Yes, the Arduino would actually control everything and communicate with the PC. The Arduino is nice because it's easy to hook it up to lots of different I/O devices. You could even use something like a simple touchscreen lcd for the display instead of using a PC if you wanted.
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

OK, this is pretty exciting! I think I may order an Adruino here this week. For$35 I'll just get it assembled.

Brent,

Have you done anything with output? At 40mA I don't think it'll be a good idea to drive the relay's directly even if I can find one that'll work with that little current. I think it will need a realy board with some sort of opto coupler on it. More research!
dhempy
Posts: 2357
Joined: Mon May 09, 2005 4:10 pm
Location: Santa Rosa Valley, CA

Post by dhempy »

Hey BB:

I found one link anyway ... looks like this guy is using the arduino now as well. I originally had this guy's page because he was capturing data via parallel and serial ports. There are "C" programming links ... a real plethora of info.


Here you go:

http://www.phanderson.com/

(EDIT) Here's another (see the bottom of the page too!)

http://www.lemis.com/grog/brewing/tempe ... ontrol.php

Dan
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

The only output stuff I've done with the Arduino is to an LCD and over USB. You're right that you can't drive the relay directly. You can use an optocoupler, and I think I've seen people use a transistor to amplify the current as well.

This guy used a relay that the Arduino can trigger directly:
http://www.uchobby.com/index.php/2007/1 ... hermostat/

This has a schematic to drive a relay:

http://www.arduino.cc/cgi-bin/yabb2/YaB ... 1170031658
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

jward wrote: He was recommending (I think) thermocouples. You can get them in SS and use them just like you did with the Taylor or Polder thermometer you had in your Igloo mash tun. One measures the resistance to read the temperature. He was very big on their direct reading of the liquid and other benefits.
Thermocouples generate a voltage (millivolts) proportional to the temperature. Thermistors will change resistance. It looks like the thermistor is very easy too hook up as you just use it to create a voltage divider and then have a table in memory that relates to temp.

The thermocouple would apparently need to be use with an IC that converts its output to a digital output. It looks like, despite the additional complexity, it's a better way to go though. Especially since I wouldn't have to build a chip into a probe. The direct read thing does make it a lot easier.

The DS1820 can indeed be run off a single wire and a ground and runs off what Dallas calls "parasite power". Kind of cool, you set the wire high first, the voltage is stored in an onboard cap long enough for you to send a read and get an answerfrom the chip. Several can be run in a string on the same wire as they all have their own addresses. Kinda neat.
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

If I remember right the thermocouple isn't as accurate as the thermistor, DS1820, or the LM34. It's probably not really a concern for this project as I don't think you're worried about tenths of degrees. Depending on the voltages that your thermocouple generates, the Arduino's analog input may do the conversion for you. What makes the thermocouple a better solution for this project?

BTW, the LM34 is really easy to use too, but you can't run a string of them like you can with the DS1820. Hook it up to +5 and GND and the middle pin gives you 1mV/degree F * a multiplier based on the input voltage. This is nice since it scales linearly, unlike a thermistor.
Post Reply