Temperature Sensor Setup LM35 take one

From Federal Burro of Information
Revision as of 05:47, 7 March 2010 by David (talk | contribs) (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` \ ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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

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='1 hour ago' +%s` --end `date +%s` \
         DEF:mytemp=1k_5v.rrd:speed:AVERAGE                      \
         LINE2:mytemp#FF0000

and first prize for ugly mutt goes to.....

http://www.quadratic.net/1k_5v.png