NodeJS temperature server and logger for DS18B20 digital temperature sensor on the Raspberry Pi
JavaScript Shell
Pull request Compare This branch is 2 commits ahead, 6 commits behind talltom:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


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.


  • - bash commands to load kernel modules
  • server.js - NodeJS server, returns temperature as JSON, logs to database and serves other static files
  • temperature_plot.htm - example client front-end showing live temperatures
  • temperature_log.htm - example client front-end showing time-series from database records
  • - shell script to create database schema
  • sample_database.db - example database with real world data from the Pi recorded in UK Jan-Feb 2013


  • With sensor attached load kernel modules: sudo
  • Start server: node server.js



Temperature time-series plot

Temperature plot

Screenshot of temperature plot

Raspberry Pi & DS18B20 digital thermometer