The temperature sensor



I have soldered the DS18S20 sensor to a cat5 cable, inserted the sensor in a small plastic bottle and sealed everything with silicone. Ugly, uh?

After doing it I thought I should have filled the bottle with some stuff that is not electricity conductive but conduces heat... Something like vaseline might work... need to Google a bit for this. For now the silicone needs to dry up.

Also decided to use perl instead of php, I am more familiar with it and took me no time to set-up a script to read the serial port and write a html file:

(will paste the code when I can figure how to make the blog ignore the html code embedded)

#!/usr/bin/perl -w -I /usr/lib/perl5/5.10/CGI
open( SERIE, "/dev/ttyS0" ) or die "no abre serie";
while ( <SERIE> ) {
if( ($temp) = /(d+.d+)/ ) {
$date = `date '+%d-%h %H:%M'`;
open( OUT, ">/www/lwa/index.html" ) or die "no abre index.html";
print OUT "<html>
<body>
<h1>Temperatura del agua</h1>
<p>Temperatura del agua a las $date: $temp C</p>
</body>
</html>n";
close OUT;
}
# sleep 5;
}
close SERIE;

This is the page: http://cebollino.homelinux.com/lwa/

And just heard about Pachube! This is an amazing site where you can send input from sensors, store the data, get graphs.... Waiting for my key to upload data.

Comments

Popular posts from this blog

openwrt stuff

The Goal