3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Temperature sensor / weatherstation

Step 5Software setup - data acquisition

Software setup - data acquisition
Now that we our sensors in place, we want to gather some data from them.

As root on your linux machine:

1)
Run `digitemp -s /dev/ttyS0 -i -c /etc/digitemp.conf`
This creates the config file digitemp.conf with yoru sensors.
Watch the output to see what number the sensors get.

2)
Check the temperature with `digitemp -aq -c /etc/digitemp.conf`

3)
Dump the output data into a file. I dump to a file within apaches wwwroot, that way I can access the temperature from anywhere.
The command `digitemp -aq -c /etc/digitemp.conf > /var/www/digitemp.txt` puts the output of digitemp into the file digitemp.txt

4)
Automate this process:
type `crontab -e`, this opens roots crontab.
Type `* * * * * digitemp -aq -c /etc/digitemp.conf > /tmp/digitemp; mv /tmp/digitemp /var/www/digitemp.txt` into that file, and save it.
Run `crontab -l` to confirm that the crontab has been installed.
The reason I am piping the output into /tmp and then moving it to /var/www, is that digitemp uses a few seconds to compete its run. If you try to access the output while digitemp is running, you would get an incomplete file. This could mess up other scripts that read data from this file. (This is not included in the screenshot, forgot to do it)

Your weatherstation is now up and running.
Use the data to do whatever you like, graph it, use it to email in case of high/low temp, etc..
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
652
Followers
7
Author:chr
I like microcontrollers and LEDs :D