Welcome Guest ( Log In | Register )

Hey there! While you are enjoying browsing the site, why not take a few seconds to register for an even better experience! It's absolutely free and a painfree process!
Here are some of the benefits of registering: Registering is so easy and quick, we don't even require you to deal with those annoying CAPTCHA graphics! Register Now!

Continuing on...

Posted by auto_man, Jan 12 2010, 12:10 AM

Well now that I have my 1-wire working now it is time to expand it. A few things planned for right now:

1. Power meter using laser to track rotations of power wheel. I plan on implementing something similiar to this: Link

2. Add sensors to monitor a/c coil drop as well as last filter change.


Off to do more work will post my pics once I have them.


Perl / Php graphing software for 1-wire data logging

Posted by auto_man, Dec 28 2009, 11:53 PM in 1-wire

How to log 1-wire temperature data to a mysql database and view via php script on web server.
To start it off you must satisfy the basic requirements to achieve the task:
1. Apache(or equivalent) server
2. PHP installed on server
3. Mysql installed on server
4. Permissions to run a cron(or equivalent) on server
5. Digitemp Software
6. Ds9097 or other digitemp supported 1-wire device
7. Ds18s20 sensors or other digitemp supported 1-wire device

Now time for the software, to sum it up I execute 3 basic steps:
1. A cron runs a perl script to get the data from the 1-wire bus an put into a mysql database
2. A php script is called to build the images for the web page
3. Serve the page via Apache web server

Step one:
Setup digitemp on your webserver. To do this you must follow the README in the digitemp software package. The steps involve creating a config file for digitemp to use on each run. This config file tells what serial port to use in addition to other sensor information.

Step two:
Setup the mysql database to receive digitemp data. This was acutally quite easy thanks to Brian Lane the maker of the digitemp software. If you download the digitemp software there is a Readme in the perl directory as well as an sql setup file(make_mysql.sql). Using these you can create the mysql database. The command is 'mysql digitemp -u root -p < make_mysql.sql'

Step three:
Copy my scripts(attached) to your web server. Once on the server you must change a few things:
my $Output_dir = "/var/www/localhost/htdocs/"; --> web server directory you want the output page to be placed
my $Output_file = "index.html"; --> name of output web page
my $digitemp_config = "/tmp/digi.cfg"; --> path and filename of your digitemp config file
my $digitemp_binary = "/usr/bin/digitemp"; --> path to digitemp binary on your webserver
my $db_name = "digidb"; --> database name
my $db_user = "username"; --> database username
my $db_pass = "password"; --> database password
Find each iteration of thermo/jp.php and thermo/thermometer.php ---> change to match the path on your machine. **These files are attached. I will describe jp.php and thermometer.php in future posts.

Step four:
Test the gettemps.pl script by executing manually. You should get no errors and be able to load your index.html output in your browser. If all looks correct setup the cron.

Step five the Cron:
I run the cron every 5 minutes using the command below:
*/5 * * * * perl /var/www/localhost/htdocs/thermo/gettemps.pl


*********A few things to note. I just discovered tonight my data was incorrectly sorted on one of my graphs. Odd that it is only one as both graphs use the same query. currently I use the following query to find the last 288 data points(approx 24hrs of data). ""SELECT Fahrenheit FROM digitemp where SerialNumber = xxx order by time desc limit 5""
See updated jp.php attached.

Attached File(s)
Attached File  automanfiles.zip ( 3.48K ) Number of downloads: 58
Attached File  jp.php_new.txt ( 1.37K ) Number of downloads: 44


Ds9097 and Digitemp Working

Posted by auto_man, Dec 27 2009, 01:37 PM in 1-wire

A couple days ago, a set off on a journey to build a 1-wire network in the house. As of today completed my first maxim one wire adapter(ds9097). Currently it is tied to only one ds18s20 temp sensor, that will change in the future. The plan is to monitor inside temperature, outside temperature and A/C(heat) coil drop.

Here is a picture of my adapter:
Ds9097-1
Ds9097-2



The Mysql database was queried using PHP and then I drew a graph using Jpgraph.

Here is the output of my temp sensor from my web server:
24Hr Log


A few links that helped me to build this project:
Ds9097 Schematic
Maxim Ds18s20 1-wire Temp Sensor


It works..

Posted by auto_man, Dec 28 2008, 02:10 PM in Power Monitor

XXXXX
         
Well I got my circuit working. I found a wiring problem on my board, I hate when that happens. Once that was fixed the results from my current transformer correlate to the results from my greenlee current probe(clamp on) and my kill-a-watt .

My setup was as follows:
110V a/c ----> kill-a-watt ----> current xfmer/clamp on probe ----> 100 watt light bulb


Having issues

Posted by auto_man, Dec 24 2008, 01:12 AM in Power Monitor

I will post pics of my setup in the next couple days. Today I made another attempt at correlation, but was unsuccessful. When I measure current with my greenlee current probe it appears to be correct, I know this because I am using a 100 watt light but and the math works. I can't seem to make my LEM55-p current transformer give any other result than .5 volts. It is .5 volts whether I have current flowing or not.


Got this party started

Posted by auto_man, Dec 23 2008, 12:24 AM in Power Monitor

Well I got this power monitor party started. I built my power supply from an old computer power supply. This is gives me +-12 and +-5 and plenty of it. I built a little board with my current transformer mounted on it. All seems to work, I am just trying to correlate my numbers against my fancy current probe.