Temperature Monitoring and Control with Arduino

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.
To erock2112:

If you go to arduino website and do search for DS18S20 it has a page about it. Its a little over my head but I managed to get it up and working. That being said I don't quite understand all of it but its slowly sinking in.

Nice work on the GUI for arduino. Is that code in the files you put up for download. I would like to look at and see how you accomplished this. I am not a coder and I find it works best for me if I have an example so I can see how it works and step through the code.
 
The brewtroller forum is also 'closed'. I tried to join it to ask some questions but the site said they don't accept new members. So..... didn't even bother with it....

That's just a bug, the site is up, and working well, we're talking to the site admin to figure otu why its broken. I use brewtroller and troll the forums/irc regularly. If you cant get to the site, we have an irc channel

irc.freenode.net #brewtroller.

We're trying to figure out why the site says "closed"

Edit: it should allow new signups now... as an aside, really cool stuff going on here w/ the arduino!

~Phil
 
To erock2112:

If you go to arduino website and do search for DS18S20 it has a page about it. Its a little over my head but I managed to get it up and working. That being said I don't quite understand all of it but its slowly sinking in.

Nice work on the GUI for arduino. Is that code in the files you put up for download. I would like to look at and see how you accomplished this. I am not a coder and I find it works best for me if I have an example so I can see how it works and step through the code.

Thanks. The GUI code is incomplete in the zip file that's up right now. I'll try to post the updated version in the next hour or so.
 
To erock2112:

If you go to arduino website and do search for DS18S20 it has a page about it. Its a little over my head but I managed to get it up and working. That being said I don't quite understand all of it but its slowly sinking in.


The DS18s20 is a digital device. Instead of changing its resistance like a thermistor, the DS18S20 returns a serial stream which equals the number of discrete steps in degrees Celsius. For the original DS1820 each step was equal to 0.5 degrees Celsius. The DS18S20 has a finer resolution.

So, for example, a value of 37 decimal would mean that the sensor was reading a temperature of 18.5 degrees Celsius.

There is a fairly involved handshake involved in initializing, interrogating, and reading the value. Fortunately, there is plenty of code out there where this has already been worked out.

I have a simple digital thermometer breadboarded using a DS1820, a PIC microcontroller that displays the temperature on an LCD screen.

-steve
 
hi all,
I've been tinkering with the main user interface that will be based on the controlling P.C.

I intend to use a touch screen so I went with this design:
http://www.obzest.com/Brewing/ControllerUI.htm

The temperature controls are a custom component I put together.

If anyone would like the system state images then pm me and I'll send them to you. :mug:
 
Well I'm writing mine in .Net (C#) and I'll make any bits available for others to use.

I'm planning on using the Arduino as a sensor / actuator controller and most of the control logic will sit on the p.c.

I'll get around the issue of loss of communications by implementing a heartbeat between the p.c. and the Arduino. If communications is broken, both the p.c. and Arduino will know about it and act accordingly.
 
Good luck with the Arduino platform, it will be interesting to follow the development of the necessary interface hardware for analog control. Are you planning on stylus or finger control on the touch screen?.
 
Reviving this thread... I finally had some time to work on this. I've rebuilt the sensors with ethernet cables, but haven't put them in thermocouples yet. I'm getting some wierd numbers when I plug everything in. The thermistors are reading around 80 F, and my thermostat says it's 74 F in here. I'm thinking the extra wiring is creating a significant enough amount of resistance that it's throwing off the reading. Anybody have an idea about adjusting for this? There's 10ft of cable on each sensor, the cable is plugged into an RJ45 jack which is then wired over to the arduino.

There's a major problem with the wiring for the LM34. It was reading somewhere around 300F. I pressed my finger on it to see if the reading would changed and it burned me pretty bad. I'm not sure if the sensor is ruined. I thought I wired it correctly, according to the schematic about halfway down this page: http://www.makingthings.com/teleo/teleo/cookbook/temperature_sensor.htm#diagram

Any ideas?
 
Reviving this thread... I finally had some time to work on this. I've rebuilt the sensors with ethernet cables, but haven't put them in thermocouples yet. I'm getting some wierd numbers when I plug everything in. The thermistors are reading around 80 F, and my thermostat says it's 74 F in here. I'm thinking the extra wiring is creating a significant enough amount of resistance that it's throwing off the reading. Anybody have an idea about adjusting for this? There's 10ft of cable on each sensor, the cable is plugged into an RJ45 jack which is then wired over to the arduino.

There's a major problem with the wiring for the LM34. It was reading somewhere around 300F. I pressed my finger on it to see if the reading would changed and it burned me pretty bad. I'm not sure if the sensor is ruined. I thought I wired it correctly, according to the schematic about halfway down this page: http://www.makingthings.com/teleo/teleo/cookbook/temperature_sensor.htm#diagram

Any ideas?

w.r.t. the thermistor, they're not very consistent from what I understand anyway. You're going to need to calibrate them. Check freezing temp and boiling temp (compensated for your altitude). Also, if you have a multimeter, a quick check of the cable resistance and stanard thermistor resistance will tell you if you need to be concerned or not.

As for the LM34, you might just have a bad one. Might want to snag another and try again. I had mine working a while back. I'll try to hook it up again and make sure the wiring is ok.
 
The LM34 worked initially, before it was rewired, although i didn't have the capacitor in there at that point, since there wasn't 10 feet of wire on either side of it. I might have just fried it though. I'll have to calibrate the thermistors one they're in the thermocouples. I'll take a look at the LM34 wiring again and make sure I don't have a short or something...
 
I think your LM34 may be roasted. Considering they regulate at .01V per deg F, It's pushing out 3V which happens to be it's max, 300F.

The cap is probably a filter cap to stabalize the supply voltage.

You didn't reverse bias it or put +5v on the output by accident when you rewired it did you? It only takes once to mess em up. You have a solid 5VDC on the supply side?

I would order another one or two and give it another crack.
 
Farside,

Any update on the .net version of the software? I just got a relay board operating over I2C last night, and now plan to integrate the DS18S20 sensors. Question for all, are the 4k7 resistors necessary when wiring in bus format? As seen here?
 
Yes, it is necessary. The devices communicate using an open drain to pull the data line down to zero. When they are not transmitting it goes to high impedance. The resistor is used to pull the voltage up on the data line when a devices isn't asserting a zero. The diagram you provided shows them running in parasite mode, which means they will get their power from the data line as well. FYI The schematic doesn't show the required charge cap circuit needed at each ds1820 when operating like this.
 
Farside,

Any update on the .net version of the software? I just got a relay board operating over I2C last night, and now plan to integrate the DS18S20 sensors. Question for all, are the 4k7 resistors necessary when wiring in bus format? As seen here?

Sorry, I haven't checked in for quite a while.
Not much progress due to work commitments but from memory, I've completed the hardware abstraction and controller modules. I was working on a hardware emulator to test out the communications.

As far as the front end is concerned, I was thinking of building a web based solution so that it can be controlled and monitored via smart phone or ipad.

I'm happy to share the source code if anyone's interested.
 
Good thread and glad it was resurrected. I think the link to the code a page or two back is broken now so a new link to the source would be very much appreciated. Thanks for your work!
 
I wrote a .net object that generates a 7 segment display of a given value. Good for temperature displays and such.

I wrote it for the web so it will work wherever. There is also a web service and a demo web application in a VS 2008 solution if anyone's interested.
 
Definitely interested in your code, I'm just starting to get to the programming for my system.
 
Farside,

This looks pretty nice. I plan on using WPF, so I will most likely port the code, but the generator logic is excellent. Thanks a lot for sharing.
 
Hey no worries.

I have put up the code I've done so far for the controller. Sorry there isn't any documentation. It's a VS 2005 solution too:
http://www.obzest.com/brewing/code/VirtualBrewerySuite.zip

There are three executables, the main one being vbs.exe. or "Rig". This is the main screen and you will get a heartbeat error on start-up.

The rig is designed so that modules (arduino devices) can be chained together. This way, any physical configuration can be supported with any number of inputs / outputs. The heartbeat is a mechanism where a signal is sent to each module. If the module is operating, it will return the signal with an acknowledged flag. This is used to detect if a module has become disconnected, turned off, or is in some way failing.

The other executables are a device emulator and controller. These are meant to run together and talk to each other but they are not currently working.

The idea is that you can play with the actuator and other sensor settings in the Device Emulator and the corresponding data will appear in the controller. Similarly, you can enter data in the controller and send it to the emulator and the corresponding control will change position.

This was working at some point so it's probably not a big deal to get it working again.

I noticed there is a bug in the rig navigator. When you step to the next stage, you can't progress properly. You need to click the back button a few times to get it enabled again. Click the Back button and then the previous button. Then click the Forward button and click on the next button. This gets you around the bug.

This is obviously a work in progress!
 
OK, I have put an update for the code...
I fixed a few bugs so the emulator and controller are working.

I forgot that this system had a database so I've included a database diagram and a database with some data. I changed the engine from MySQL to SQLite as well because it's so much simpler to distribute.

I also ported the solution from VS2005 to VS2008.
 
Interesting copy of the old and automated steam injection RIMS systems I have built, looks graphics intensive though. The 2 applications for my automated system were built to keep memory and run time loads as small as possible to run on older slower memory limited platforms, so minimal graphics. Any plans to build a system like that, I have some design and operating experience on that type of system, along with an operating control application
 
Interesting copy of the old and automated steam injection RIMS systems I have built, looks graphics intensive though. The 2 applications for my automated system were built to keep memory and run time loads as small as possible to run on older slower memory limited platforms, so minimal graphics. Any plans to build a system like that, I have some design and operating experience on that type of system, along with an operating control application

Yes, you insipred my Kladue! One day I'd love to have one of those systems!!

The front end actually just displays a 40 Kb image for whatever state the system is in. There are a lot of images but it only loads them one at a time so it's not as graphically intensive as you might think :D It also keeps memory to a minimum. This is one reason I switched to SQLite instead of MySQL.
 
It would be better to start with a PLC platform with the industry standard interface modules like I did. That does not exclude the Arduino platforms but you have to do a lot of work to get the necessary analog output voltages for the valves and mass flow controllers needed to make an automated boiler work over a wide range of conditions. There are a fair number of I2C boards available now that offer input interfaces for voltage, 4-20MA loops, thermocouples, but very few analog output choices, and all under 5 volts output.
I have probably put an insane amount of time into the applications, > 2,500 and counting hours writing and testing, but it has been an adventure learning first Java, MySql, and then C# while converting the Java application to C# this last couple months. Latest feature I am working on is speech synthesized audible alarm annunciation and manual activity prompts to have something to do to kill time.
 
Thanks for the heads up Kladue. I'm not married to the hardware yet and I have an electronics background so building analog driver circuits isn't over the top for me.

My biggest challenge is going to be in building the equipment. I have never worked metal, welded, brazed or anything like that. I don't even have the tools lol!

Does your setup interface with a pc at all? I was looking at wireless networking for the rig and then building a web server to monitor the operation etc so I can keep tabs on what's going on from anywhere.

Did you get any improvements by changing languages? I remember your Java version was pretty memory hungry...
 
The Opto 22 hardware I use is the oldest version out there, and the factory built control packages do not support the hardware directly. If you us a "Brain Module" you can use some of the pre built packages. If I were to build this for others I would use the new Snap series hardware that is currently sold, and abandon the old G1 hardware. The current hardware communication is RS 422 to the interface module, then Ethernet to the PC. The application tests for cable connection then establishes a port, then initializes the boards and starts scanning the channels. If there is a communication loss the application re-initializes the boards and the resumes scanning. This is an interesting exercise in conversion between decimal, hex, binary and ASCII formats to build and decode the ASCII data streams used by the hardware. All that would be needed to use other PLC hardware would be to rework the communication class to deal with other hardware message formats.
The Java application works but it uses a few tricks to keep the graphics native memory leakage under control, stack memory management is perfect. If you maintain one frame and use Dialog panes for the rest it works, sort of, you have to Iconify the frame and restore it to let operating system recover the lost memory during one second delay between iconify and show the dialog pane.
The C# application uses all dialog pages for graphics, threaded classes for data manipulation, and utilizes 28 Sql tables for the various recipe and control information. At this point most of the code related to the graphics resides on the dialogs instead of spread out in other classes and that has made switching between pages fast.
 
I'm currently using a Netduino, and damn they are nice. The forums at http://www.Netduino.com are very helpful as well. I have communication over I2C in a matter of minutes, controlling my valves. I've also figured out how to wire up LCDs.

There is someone else in the forums discussing PWM and heater control. I'm assuming they are also automating their brewing. I'm currently stuck trying to integrate WiFi with the damn board though. Then my automation POC will be mostly complete. Then it will just require me building up the logic from the simple pieces to control flows, temp, etc.

My goal is to have the control panel wired up this weekend, so next weekend I can go through the first wet test. (Assuming the electrician comes next week to install my 60A service)
 
WiFly shield from SparkFun. I'm also testing it so I can create an Ad-Hoc network for other projects.
 
Kladue, how are you interfacing your PC to I2C? Or, are you using something like Arduino/Netduino? I originally had purchased a USB-I2C interface, however the driver was poor and the support worse. It required bit bashing, which I'd rather avoid. The Netduino is nice in that to write something to I2C required 1 line of code. So far - I am very happy with the Netduino purchase, and it came out at just the right time. Otherwise, I would have been too far down the path of USB-I2C interface to go back without wasting tons of time. Now, instead of worrying about the interface details, I can concentrate on the logic to run the temp probes and heating elements (and eventually the UI).
 
The plan is to build a new system around an ARM9 board with 7" touch screen and connect the I/O boards to the on board I2C connection. Analog interface, digital interface, and the PWM boards would be using the I2C bus to communicate and the application would be controlling. The current C# application for the Opto 22 hardware would be edited down and new graphics built to work on 800 X 480 format. Other than graphics the communications class is all that needs rebuilt to work with the new hardware, and then the SQL information tables would be switched from MySQL to SQLlite and a few tweaks made.
10 volt dc outputs would be derived from a RC circuit and a PWM output so the Belimo valve actuators would work for proportional control, as all of the inexpensive analog output boards are 5V max output.
 
Kladue,

Can't you use a digipot to control the 0-10V supply? I think I found a digipot at Analog Devices that would work... i'll have to find the link. I was hoping I could control a digipot with some other resistors to go from a 24V power supply to 0-10V to control the Belimo's. Of course, you would know better than I the way to go about this, so my thinking may be totally assinine.
 
One comment... From what I've read, copper is not the best thing to use for a thermowell when fermenting. Something about off-flavors and/or poisoning of the yeast?

Yes, it is true copper is not the best thing to use for a thermowell when fermenting.
 
With the 16 channel PWM board, it should take 4 components to get to a 0-10V output, 2 resistors, 1 capacitor, and a 10V zener diode to limit maximum output voltage. The rest of the effort is just a bit of code to set PWM duration and frequency
 

Latest posts

Back
Top