Simple NodeJS server and SQLite3 logger for the DS18B20 digital temperature sensor on the Raspberry Pi.
A NodeJS server for the DS18B20 GPIO temperature sensor on the Raspberry Pi. The sensor is accessed using the w1-gpio and w1-therm kernel modules in the Raspbian distro. The server parses data from the sensor and returns the temperature and a Unix time-stamp in JSON format, this is then written to an SQLite database on the Pi. A simple front-end is included and served using node-static, which performs ajax calls to the server/database and plots temperature in real time or from a time-series, using the highcharts JavaScript library.
npm install
in this directoryload_gpio.sh
script as root to load kernel modules for the sensorbuild_database.sh
script to create "piTemps.db". Note this wil drop any existing database of the same name in the directoryhttp://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/temperature/
Screenshot of temperature plot
Raspberry Pi & DS18B20 digital thermometer