الأحد، 6 ديسمبر 2015

Arduino Linear Thermistor Experiment

Thermistor is a semiconductor device made of materials whose resistance varies as a function of temperature. A thermistor can be used to compensate for temperature variation in other components of an electronic circuit.
Here is an Arduino experiment with a famed linear active thermistor chip MCP9700A from Microchip Technology Inc. The chip comprises an analog temperature sensor that converts temperature to analog voltage. Unlike resistive sensors, this linear active thermistor chip does not require an additional signal- conditioning circuit. Therefore, the biasing circuit development overhead for thermistor solutions can be nullified by implementing this low-cost IC. Further, the voltage output (VOUT) pin can be directly connected to the ADC input of a microcontroller.

pin annotation of the linear active thermistor chip
(pin annotation of the linear active thermistor chip)
Although the 3-pin SOT-23 package of MCP9700A is very popular, the experiment was conducted with an MCP9700A in 5-pin SC70 package, purchased from an online store (RhydoLabz). The chip soldered on the SC70 – DIP adapter was linked to an Arduino UNO (R3) as shown below.
connection diagram of the linear active thermistor
(connection diagram of the linear active thermistor)
Next important hardware is a standard 16×2 LCD unit. The experiment was conducted with an Arduino compatible LCD shield, circuit diagram of the relevant section is shown below.
partial circuit diagram of the lcd shield
(partial circuit diagram of the lcd shield)
The shield consists of a 1602 white character blue backlight LCD, and a keypad consists of 5 keys (select, up, down, right, and left). To save the digital I/O pins, the keypad interface uses only one ADC channel (A0) for reading the key values through a 5-stage resistive-voltage divider.
table
real view of the lcd keypad shield
(real view of the lcd keypad shield)
Now it is clear, a MCP9700A temperature sensor connected to the Arduino analog input pin A1 is used to measure temperature. The Arduino sketch for the experiment handles the inputted data and displays the current temperature on the display panel. That’s all!
/*‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Project: Arduino Temperature Monitor
Description: Realized using the simple MCP9700A linear thermistor
connected to pin A1 of the Arduino Uno (R3). The system converts
the output voltage from MCP9700A to a temperature value
and displays it on a 16x2 LCD
Tested at: TechNode PROTOLABZ
Date: November 2015
Author: T.K.Hareendran (with great respect for the inspirations of other designers/coders)
Exclusive for: http://www.electroschematics.com
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐*/
#include <LiquidCrystal.h>
// Arduino pins used for LCD
LiquidCrystal lcd(8, 9,4, 5, 6, 7);
void setup() {
   // initialize the LCD display
   lcd.begin(16, 2);
}
void loop() {
   float temperature = 0.0; // stores the calculated reading
   int sample; // counts through ADC samples
   float ten_samples = 0.0; // stores sum of 10 samples
   // take 10 samples from the MCP9700 sensor
   for (sample = 0; sample &lt; 10; sample++) {
      // convert A1 value to temperature
      temperature = ((float)analogRead(A1) * 5.0 / 1024.0) ‐ 0.5; // 500mV offset corrected – see datasheet of MCP9700
      temperature = temperature / 0.01;
      // sample every 10ms
      delay(100);
      // sum of all samples
      ten_samples = ten_samples + temperature;
   }
   // get the average value of 10 samples
   temperature = ten_samples / 10.0;
   // display the temperature on the LCD
   lcd.setCursor(0, 0);
   lcd.print(temperature);
   lcd.print(" deg. C ");
   ten_samples = 0.0;
}
author’s prototype of the experiment
(author’s prototype of the experiment)
Notes
  • Overall stability of the system can be increased by adding two 100nF capacitors very close to the MCP9700A chip as indicated in the following diagram. This stabilises the power input, and the signal output from MCP9700A
  • The 6 μA (typical) low operating current of the MCP9700A makes it ideal for battery-powered applications. However, for applications that require a tighter current budget, this device can be powered from one Input/ Output (I/O) pin of the Arduino microcontroller. The I/O pin can be toggled to shut down the device
ALT-6

Twitter Delicious Facebook Digg Stumbleupon Favorites More