Pete Hoffswell
Published © MIT

Intel Edison and ARTIK Cloud Temperature Monitor

Connect your Intel Edison to a temperature sensor, and then track data over time with ARTIK Cloud.

IntermediateFull instructions provided2 hours748
Intel Edison and ARTIK Cloud Temperature Monitor

Things used in this project

Hardware components

Intel Edison
Intel Edison
Specifically, the IOT edition with development Board
Grove starter kit plus for Intel Edison
Seeed Grove starter kit plus for Intel Edison
Or simply the Grove shield, display and temperature sensor

Software apps and online services

ARTIK Cloud for IoT
Samsung ARTIK Cloud for IoT


Read more


System hookup

Connecting devices with the Grove kit is very easy. Simply connect your display to an I2C port, and your temperature sensor to the A0 port


Edison Nodejs code

/* Thermometer

Connect Intel Edison with Seedstudio Grove Starter Kit Plus Temperature sensor and display to make a Thermometer.

Publish temperature to ARTIK Cloud

Intel Edison Kit for Arduino
Grove Starter Kit Plus, containing - 
    Base Shield
    Temperature Sensor
    LCD Display
Connect the LCD to and I2C Port
Connect the temperature sensor to A2 port
Set shield for 5 volts
August, 2016

// Configure these variables - 

var ID = '<device id>';  // Your Device Id from ARTIK Cloud
var TOKEN = '<device token>'; // Your Device Token from ARTIK Cloud


// configure jshint
/*jslint node:true, vars:true, bitwise:true, unparam:true */
/*jshint unused:true */

var mraa = require('mraa'); // mraa library for access to gpio
var mqtt = require('mqtt'); // mqtt messaging library for communicating with ARKTK
                            // If this errors out, be sure to "root@edison2:~# npm install mqtt"
var lcd = require('jsupm_i2clcd');

var display = new lcd.Jhd1313m1(0, 0x3E, 0x62);
var analogPin0 = new mraa.Aio(0); //setup access analog input Analog pin #0 (A0)
var analogPin1 = new mraa.Aio(1);
var B = 3975; // B value of termistor 
var delay = 3*1000; // delay between reads/display
var display_temp;

console.log('ARTIK Thermometer');
console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the console

display.setColor(0, 100, 100);  // R G B display background color

var PROTOCOL = 'mqtts';
var BROKER ='';
var PORT = 8883;

//Create the url string
var URL = PROTOCOL + '://' + BROKER;
URL += ':' + PORT;

var requireds = { username: ID, password: TOKEN };
var mqttConfig = { 'url': URL, 'requireds': requireds };

var client = mqtt.connect(mqttConfig.url, mqttConfig.requireds);
var TOPIC = '/v1.1/messages/'+ID;

client.on('connect', function () { // Connect MQTT to ARTIK
    console.log('ARTIK connected');
    setInterval(function () { // Every 10 seconds publish!
        console.log('Published ' + '{"Temperature":'+display_temp+'}');
        client.publish(TOPIC, '{"Temperature":'+display_temp+'}');    
    }, 10*1000);//Keeps publishing every 10000 milliseconds.    

read_display(); // start the loop

function read_display() {
    // read the temperature sensor, convert to celsius/fahrenheit, display on console and LCD.
    var tempSensor =; //read the value of the analog pin
    var resistance = (1023 - tempSensor) * 10000 / tempSensor; //get the resistance of the sensor;
    var celsius_temperature = 1 / (Math.log(resistance / 10000) / B + 1 / 298.15) - 273.15; //convert to temperature via datasheet ;
    var fahrenheit_temperature = (celsius_temperature * (9 / 5)) + 32;
    display_temp = fahrenheit_temperature;   // Change this to celsius_temperature if you wish
    display.write('Temp: ' + display_temp);  
    console.log('Temp: ' + display_temp);


Pete Hoffswell

Pete Hoffswell

10 projects • 58 followers
Network Engineer for All the People. Internet advocate. Microcontroller Fan. Maker.