Temperature Sensor Setup LM35 take one: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
(New page: k8055 connected to an lm35 with a1k resistor at 5v. here's how I get the data into an rrd and graphed: <pre> rrdtool create 1k_5v.rrd \ --start `date +%s` \ ...) |
No edit summary |
||
Line 9: | Line 9: | ||
RRA:AVERAGE:0.5:1:24 \ | RRA:AVERAGE:0.5:1:24 \ | ||
RRA:AVERAGE:0.5:6:10 | RRA:AVERAGE:0.5:6:10 | ||
</pre> | |||
new more robust rrd: | |||
<pre> | |||
rrdtool create 1k_5v.rrd --step 300 \ | |||
DS:temp:GAUGE:600:0:256 \ | |||
RRA:AVERAGE:0.5:1:2592000 \ | |||
RRA:MIN:0.5:12:2400 \ | |||
RRA:MAX:0.5:12:2400 \ | |||
RRA:AVERAGE:0.5:12:2400 | |||
</pre> | </pre> | ||
Line 19: | Line 30: | ||
<pre> | <pre> | ||
rrdtool graph 1k_5v.png \ | rrdtool graph 1k_5v.png \ | ||
--start `date --date=' | --start `date --date='3 days ago' +%s` --end `date +%s` \ | ||
DEF: | DEF:myavg=1k_5v.rrd:temp:AVERAGE \ | ||
LINE2: | LINE2:myavg#FF0000 \ | ||
DEF:mymin=1k_5v.rrd:temp:MIN \ | |||
LINE2:mymin#00FF00 \ | |||
DEF:mymax=1k_5v.rrd:temp:MAX \ | |||
LINE2:mymax#0000FF | |||
</pre> | </pre> | ||
Revision as of 03:11, 10 March 2010
k8055 connected to an lm35 with a1k resistor at 5v.
here's how I get the data into an rrd and graphed:
rrdtool create 1k_5v.rrd \ --start `date +%s` \ DS:speed:GAUGE:600:U:U \ RRA:AVERAGE:0.5:1:24 \ RRA:AVERAGE:0.5:6:10
new more robust rrd:
rrdtool create 1k_5v.rrd --step 300 \ DS:temp:GAUGE:600:0:256 \ RRA:AVERAGE:0.5:1:2592000 \ RRA:MIN:0.5:12:2400 \ RRA:MAX:0.5:12:2400 \ RRA:AVERAGE:0.5:12:2400
drop this in a 5 minute while loop:
rrdtool update 1k_5v.rrd `date +%s`:`/usr/local/projects/k8055/src/k8055 -q -num:10 -delay:1000 2>/dev/null | cut -d ";" -f 3 | awk '{sum=sum+$1}END{print sum/NR}'`
rrdtool fetch 1k_5v.rrd AVERAGE --start `date --date='1 hour ago' +%s` --end `date +%s`
rrdtool graph 1k_5v.png \ --start `date --date='3 days ago' +%s` --end `date +%s` \ DEF:myavg=1k_5v.rrd:temp:AVERAGE \ LINE2:myavg#FF0000 \ DEF:mymin=1k_5v.rrd:temp:MIN \ LINE2:mymin#00FF00 \ DEF:mymax=1k_5v.rrd:temp:MAX \ LINE2:mymax#0000FF
and first prize for ugly mutt goes to.....