Mash & Hlt Electronic Temp Control

Australia & New Zealand Homebrewing Forum

Help Support Australia & New Zealand Homebrewing Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Andrew

Well-Known Member
Joined
1/6/04
Messages
209
Reaction score
2
Hi all,
Thisll be a long question.

I use DS18S20 temp sensors connected to a microcontroller-based circuit DIY kit (a picture of it is here http://quozl.netrek.org/ts/ ) which in turn connects via the serial port to an old windows 98 computer.

On the screen I can read as I brew, the current temp of my HLT, Mash, Herms output, and sparge water. :beerbang:

The problem is that the program is in DOS and the numbers are so small they can be difficult to read from a distance.

What Id like to do is to find a way of using my pathetic abilities in VB programming to take the data from the serial port and display it on a form in nice BIG numbers.
I can build a pretty form, but really have no idea how to capture the data from the serial port as it comes in, and send it to the form! Not sure but I think the data comes to the computer in something called ASCII(?) :blink:

There are some links Ive followed, such as this one at www.klein.com/thermd but its all gibberish to me.
A daemon? Isnt that a nasty spirit that does horrible things to your computer? :rolleyes:
This site: http://www.kitsrus.com/soft.html#k145 has info too (The program TLSWinZip is one I currently use) but once again Im way out of my depth.
My VB programming skills are restricted to simple Access databasing and timing programs etc. Never done anything involving getting data from an external source.

Anyhow, looking at VB script websites I found this, it might be useful but I dont know where to stick itI thought it might be good as I could get text boxes on the form to display updates from a textfile?

Title: VBScript Sample - Read information from a serial device (for example: a weight indicator) and write it to a textfile (C:\Output.txt)

Const acERR_SUCCESS = 0
Const strOutputFile = "C:\Output.txt"

Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Const OpenFileForAppending = 8

' --------------------------------------------------------------
Sub ReadStr( o )
str = "notempty"
Do While str <> ""
str = o.ReadString
WScript.Echo "<- " & str
Loop
End Sub
' --------------------------------------------------------------

Set acObj = CreateObject( "ActiveXperts.Comport" )

Wscript.Echo "ActiveComport Serial Port Toolkit " & acObj.Version & " demo."
Wscript.Echo "Expiration date: " & acObj.ExpirationDate & vbCrLf

acObj.Baudrate = 19200
acObj.PortID = 1
acObj.Open
WScript.Echo "acObj.Open, result: " & acObj.LastError

If acObj.LastError = acERR_SUCCESS Then

Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists( strOutputFile ) Then
fso.CreateTextFile( strOutputFile )
end If
Set fsoFile = fso.GetFile( strOutputFile )
Set fsoStream = fsoFile.OpenAsTextStream( OpenFileForAppending )
str = "notempty"
WScript.Echo "Press CTRL-C to terminate the program."
Do While 1 = 1
str = acObj.ReadString
If str <> "" Then
WScript.Echo "<- " & str
fsoStream.WriteLine( str )
End If
Loop
fsoStream.Close

End If

Can anyone out there offer some help or advice? :(

If I can get this thing to work, then like I did with the mash/hop additions brewtimer program from ages ago, I would like to offer it to all brewers for free and also the source code. In fact I could set up a thread for any brewer with no computing or electronics ability whatsoever, that shows where to get the kit in Aus, pics on how to solder it together if you cant follow wiring diags (like me!) and finally a program with BIG numbers that are easy to see.

Help! Anyone?
Cheers.
Andrew
AKA: he who always bites off more than he can chew, and chews like mad
 
Hi Andrew

I have the same temp sensor. I use it in conjunction with this Printer Port Relay Board. Greg Lehey has a similar set up documented here. I couldn't get his program to run on FreeBSD, so I rewrote it (the parts I could understand anyway) to run on my XP box in the shed. I use it to monitor and control the temperatures in my fridges, and will soon update it to control my HLT/HERMS.

This code works well on my PC. :) It could work well on yours. :unsure: Most likely it won't. <_< It wasn't written for wide distribution so you will probably find you need stuff around a bit to get it to work to your satisfaction. As I said, it is also written to control the Relay Board, so you might get some errors from that. Merge the reg file for a better chance at success and install the font file to make it look pretty.

View attachment ThermEstat.zip

The information you need to read the temps from the sensor should be within the MSComm1_OnComm, serial_read and DecodeSerialData subs.

Hope it helps.

Cheers
Bagnol
 
Hi Bagnol,

I have the same temp sensor. I use it in conjunction with this Printer Port Relay Board. Greg Lehey has a similar set up documented here. I couldn't get his program to run on FreeBSD, so I rewrote it (the parts I could understand anyway) to run on my XP box in the shed.
Yup, I have the relay board/temp system/program as Greg. I took an old computer around to him and he set it up. Works like a treat, I access it from this platform thingy called "KDE". If I ever have a hassle with it I take it back to him with a few beers to fix.
This system controls my ferment temps/fridge, it runs, and I am happy to leave it as it is, though the bits of yours I can see in the Vb program looks pretty schmick.

On a second computer, I have a second temp sensor kit to read my brewing temps - no relays or nothing with this one. This is the one I'd like to be able to display a flow of data from a serial port in a VB program.

As I said, it is also written to control the Relay Board, so you might get some errors from that.
Yup, it gets stuck on something called .OpenDriver. Over my head! :blink:

Merge the reg file for a better chance at success
Yup, and shall I give it a buff and shine and offer it a latte while I'm at it? What's a reg file? A cross between a flat file and a ******* rasp? Got them in my shed too! :p

The information you need to read the temps from the sensor should be within the MSComm1_OnComm, serial_read and DecodeSerialData subs.
Found 'em...some of it even looks as if it uses part of the English alphabet. ;)

Sorry Bagnol, not having a go at you or nothing, its just that I'm way out over my depth on this one. :(

I was hoping there would be paste-in commands that did something like:
1. Computer, you have a serial port. Every few seconds there is stuff coming through it.
2. Now, take the four bits of stuff coming in and stick it somewhere, lets call it place "A".
3. You four text-boxes on my form, yes you four, go to where that stuff was stored in Place "A" grab it, show it, and every couple of seconds display an update.

Then I just stick the commands in the right place and it works.

Any ideas? (easy to understand ones) The relay stuff and the graphing stuff would be awesome, but makes it too confusing for me to find what I need.

Cheers
Andrew (that rather slow child sitting in the corner with the dunce cap!)
 
Back
Top