Introduction: Particle Core - Temperature Sensor

Picture of Particle Core - Temperature Sensor

Particle core is great for its IoT applications and one of such applications is to take common electronics to the internet, in this tutorial I'm going to show you how to connect a temperature sensor and read the values over the internet. You can read through my previous instructables before going through this one as there are a lot of simple projects to get started.

So lets get started...

Step 1: Tools and Components

Picture of Tools and Components

Here is all that you need to get started -

  • Particle Core or Photon
  • Lm36
  • Breadboard
  • Jumper Wires

Step 2: Circuit

Picture of Circuit

The circuit is really simple, it has a lm36 IC connected at analog pin 0 and the power supply for the sensor. The addition of the capacitor is optional and is only required to keep the senor stable and reduce the noise. An alternative IC would be Lm35 IC.

Step 3: Code

Picture of Code

The code can be found below -

#include
#define PRINTF_BUFFER_SIZE 128 void Serial_printf(const char* fmt, ...) { char buff[PRINTF_BUFFER_SIZE]; va_list args; va_start(args, fmt); vsnprintf(buff, PRINTF_BUFFER_SIZE, fmt, args); va_end(args); Serial.println(buff); }

double temperature = 0.0;

void setup() { // Use serial port for debug print Serial.begin(9600);

// register API variable Spark.variable("temperature", &temperature, DOUBLE); pinMode(A7, INPUT); }

void loop() { int analogValue = analogRead(A7); double voltage = 3.3 * ((double)analogValue / 4095.0);

// http://www.analog.com/static/imported-files/data_sheets/TMP35_36_37.pdf temperature = (voltage - 0.5) * 100; Serial_printf("voltage=%g temperature=%g", voltage, temperature); delay(500); }

Comments

ThegizW (author)2017-01-30

what capacitor did u use value ?

About This Instructable

6,367views

7favorites

License:

Bio: Hi, I just launched an Indigogo campaign support my projects by backing it. https://www.indiegogo.com/projects/tinker-usb-a-wifi-based-badusb#/
More by ThisIsSteve:Linkit One Text to SpeechLinkit One Kitchen TimerIntel Edison Talks to Linkit One
Add instructable to: