1-wire temp sensors

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
raptor_demon
Senior Member
Posts: 141
Joined: Tue Jul 07, 2009 12:55 pm
Location: NC

1-wire temp sensors

Post by raptor_demon »

Hi All,

soon i feel i will have this all in the bag!

One thing left that i am trying to get nailed down is Temp sensors inside and out.

I did some searching and could not find out if 1-wire is supported with housebot, particulary the DS9490R available at hobby-boards.com.

if not what is everyone else using?

thanks in advance

Raptor
menesi
Member
Posts: 51
Joined: Fri Jan 05, 2007 4:48 pm
Location: Debrecen, Hungary, EU

Re: 1-wire temp sensors

Post by menesi »

I'm using some DS18S20-s in parasite mode on 1-wire bus. The schema between 1-wire bus and serial port is the simplest:
Image
On HB server a simplified digitemp (http://www.digitemp.com/) sw runs, fired by a task and a simple script device processes its output file.
Laszlo Menesi
roussell
Advanced Member
Posts: 268
Joined: Wed Dec 15, 2004 9:07 am
Location: Pelham, AL

Re: 1-wire temp sensors

Post by roussell »

menesi,

Are you saying that you use the circuit you posted as an interface between 1-wire and the PCs serial port instead of something like the DS9097U-A adapter? If so, that's a fabulous little design! Thanks for posting, where did you ever find that little gem?

BTW to the OP, I use a 9097 adapter and OWFS on Linux to collect and transmit the data to HB. I will probably mote to digitemp though as I look to consolidate boxes.

Terry
menesi
Member
Posts: 51
Joined: Fri Jan 05, 2007 4:48 pm
Location: Debrecen, Hungary, EU

Re: 1-wire temp sensors

Post by menesi »

This is a web-wide published simple circuit, for example here: http://public.rz.fh-wolfenbuettel.de/~h ... itemp.html, or the better, more understandable figure: http://www.pavolmaria.org/elektronika/d ... s9097e.gif with two DS18S20 sensors in parasite mode (but it works with more sensors too) and a RS-232 DB9F connector on the left side of schema.
Laszlo Menesi
raptor_demon
Senior Member
Posts: 141
Joined: Tue Jul 07, 2009 12:55 pm
Location: NC

Re: 1-wire temp sensors

Post by raptor_demon »

Thanks Guys,

Menesi,

Could you please post how you processed the file and the task?

Do you know if the Digitemp software works with the DS9490R ?

Thanks

Raptor
menesi
Member
Posts: 51
Joined: Fri Jan 05, 2007 4:48 pm
Location: Debrecen, Hungary, EU

Re: 1-wire temp sensors

Post by menesi »

In my solution I've:

1. A Sleep Timer device, named Digitemp Timer, with 10mins Sleep Time, (Repeat=Yes).
2. A task, named Digitemp Update with:

Code: Select all

If (Digitemp Timer.Running is Equal 'Yes') Then Change 'Digitemp Handler.State' to 'Running'
3. Digitemp Handler is a Script Device, with script:

Code: Select all

Option Explicit
On Error Resume Next


Dim objShell, objFSO, objFile
Dim strPath, strLine, strPort, strType
Dim dimStr

	strPath = ".\Config\Scripts\Digitemp\dt_lite."
	strPort = GetPropertyValue ("Digitemp Handler.Serial Port")

	Set objShell = CreateObject ("WScript.Shell")
	objShell.Run strPath & "exe " & strPort & " " & strPath & "out", 0, True
	Set objShell = Nothing

	Set objFSO = CreateObject ("Scripting.FileSystemObject")
	Set objFile = objFSO.OpenTextFile (strPath & "out", 1, True) 
	Do Until objFile.AtEndOfStream
		strLine = objFile.ReadLine
		dimStr = Split (strLine, "|")
		SetPropertyValue dimStr(0) & ".DTID", dimStr(1)
		SetPropertyValue dimStr(0) & ".DTTemp", dimStr(2)
		SetPropertyValue dimStr(0) & ".DTTime", dimStr(3)
		SetPropertyValue dimStr(0) & ".DTDate", dimStr(4)
		Select Case Mid (dimStr(1), 1, 2)
			Case "10"
				strType = "DS18S20 High-Precision 1-Wire Digital Thermometer"
				
			Case "20"
				strType = "DS1822 Econo 1-Wire Digital Thermometer"
			
			Case "28"
				strType = "DS18B20 Programmable Resolution 1-Wire Digital Thermometer"
		
			Case Else
				strType = "Unknown Type"					
		End Select
		SetPropertyValue dimStr(0) & ".DTType", strType				
	Loop
	objFile.Close
	Set objFile = Nothing

	Set objFSO = Nothing	
The simplified digitemp application (http://www.menesihome.hu/download/dt_lite.exe) is started and its output file is processed by this script. Structure of output file:

Code: Select all

Sensor 0|10EE2C71010800E2|21.2|08:34:23|2009-10-17
Sensor 1|103F7771010800F4|18.9|08:34:24|2009-10-17
4. And some Null Devices, named Sensor 0, Sensor 1, etc. with properties DTID, DTTemp, DTTime, DTDate.

That's all. I've no information about Digitemp with the DS9490R, sorry.
Laszlo Menesi
Post Reply