Santosh Ambekar
Published © Apache-2.0

IoT - Ambient Temperature OLED Display

Build OLED Display to indicate ambient temperature in real-time.

IntermediateFull instructions provided15 minutes1,384
IoT - Ambient Temperature OLED Display

Things used in this project

Hardware components

Mediatek LinkIt One
Hardware Prototype board for develoment
Grove - Temperature Sensor
Seeed Studio Grove - Temperature Sensor
Grove - OLED Display 1.12'' V2
Seeed Studio Grove - OLED Display 1.12'' V2

Software apps and online services

Arduino IDE
Arduino IDE


Read more


OLED Display for Ambient Temperature


Arduino code for OLED Display for Temperature sensor

 * This file is part of SANTRONIX Mediatek LinkIt Tutorials Project.
 * SANTRONIX Mediatek LinkIt Tutorials Project can not be copied and/or distributed without the express
 * permission of SANTRONIX

#include <math.h>
#include <Wire.h>
#include <SeeedOLED.h>
#include <avr/dtostrf.h>

const int B = 4250;               // B value of the thermistor
const int R0 = 100000;            // R0 = 100k
const int pinTempSensor = A0;

void setup() {
  // put your setup code here, to run once:

  SeeedOled.init();  //initialze SEEED OLED display

  SeeedOled.clearDisplay();          //clear the screen and set start position to top left corner
  SeeedOled.setNormalDisplay();      //Set display to normal mode (i.e non-inverse mode)
  SeeedOled.setPageMode();           //Set addressing mode to Page Mode

void loop() {
    int a = analogRead(pinTempSensor);

    float R = 1023.0/a-1.0;
    R = R0*R;

    float temperature = 1.0/((log(R/R0)/B)+(1/298.15))-273.15; // convert to temperature via datasheet

    //Serial.print("temperature = ");
    SeeedOled.setTextXY(0,0);          //Set the cursor to Xth Page, Yth Column  
    SeeedOled.putString("Temperature"); //Print the String
    SeeedOled.setTextXY(2,0);          //Set the cursor to Xth Page, Yth Column  
    SeeedOled.putString(" C");


Santosh Ambekar

Santosh Ambekar

11 projects • 16 followers
Santosh is an IoT enthusiastic and expert in the field of automation and software development.