Digit Shield Temperature Display


Difficulty Level = 1 [What’s this?]

The Digit Shield makes it trivial to add a numeric display to your project. I’ve used my simple LM34 temperature sensor in many projects, but this is the simplest. Here’s the LM34 sensor connected to analog input pin 0 on the Arduino, with the temperature displayed on the Digit Shield.







The code reads the sensor value, translates to millivolts, and then translates to a temperature (the sensor outputs 10mV per Fahrenheit degree). The Digit Shield library makes it so easy to display the temperature. Here’s the entire Arduino sketch:

#include 

float AREF = 1.1;

void setup() {
  analogReference(INTERNAL);
  DigitShield.begin();
  DigitShield.setPrecision(1);
}

void loop() {
  delay(500);
  int r = analogRead(0);
  int mv = (((float)r/1023.0) * AREF) * 1000.0;
  double t = mv / 10.0;
  DigitShield.setValue(t);
}



Published by Michael, on March 19th, 2011 at 4:27 pm. Filed under: Arduino,Level 1. | 1 Comment |





One Response to “Digit Shield Temperature Display”

  1. Hello

    I am a student at University of Greenwich in London U.K. I am wanting to do my final year project
    I looked at your site and got facinated by Wireless Temperature Sensor using RF Transmitter/Receiver. I want to find out weather it is possible to use this for my project and if so what do I need to do on legal aspect.
    regards

    Frank

    Comment by Frank Marambi on May 19, 2015 at 6:01 AM



Leave a Reply

*