node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »



Raspberry Pi driver for the MAX31855 thermocouple amplifier


Uses the bcm2835 C library to talk to the GPIO. If you don't use Node, you're welcome to steal the code in which is not Node-specific.


var max31855pi = require('max31855pi')
var listener = max31855pi()
listener.on('temperature', function (temp) {
  console.log('Current temp =', temp, 'C')

There is also a listener.stop() to stop the listener.

By default, the CS pin is bound to GPIO P1-15 (22) pin, the SO pin is bound to GPIO P1-21 (9) pin and the SCK pin is bound to the GPIO P1-23 (11) pin. You can change this by supplying an options object and overriding the one you want: max31855pi({ cs: 22, so: 9, sck: 11 }).

The default temperature-check frequency is 500ms, supply a new frequency value to listener.start() if this isn't suitable.


node-max31855pi is Copyright (c) 2013 Rod Vagg @rvagg and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.