0

Thermometer Using ADABOX001
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Thermometer Using ADABOX001

by degroof on Fri Jan 13, 2017 10:51 am

IMG_20170113_093401~3.jpg
IMG_20170113_093401~3.jpg (761.72 KiB) Viewed 1477 times


Goal: Create a thermometer using only parts included in ADABOX001

Parts:
- breadboard
- Feather 32u4 AdaLogger
- 16x2 LCD & contrast potentiometer
- TMP36 Analog Temperature Sensor
- jumpers

Wiring:
- Feather VBATT -> breadboard +
- Feather 12 -> LCD pin 14 (DB7)
- Feather 11 -> LCD pin 13 (DB6)
- Feather 10 -> LCD pin 12 (DB5)
- Feather 9 -> LCD pin 11 (DB4)
- Feather 6 -> LCD pin 4 (RS)
- Feather 5 -> LCD pin 6 (E)
- Feather GND -> breadboard -
- Feather A0 -> TMP36 pin 2 (Vout)
- Feather GND -> TMP36 pin 3 (+Vs)
- Feather 3V -> TMP36 pin 1 (GND)
- LCD pin 1 (VSS) -> breadboard -
- LCD pin 2 (VDD) -> breadboard +
- LCD pin 3 (V0) -> contrast potentiometer pin 2
- LCD pin 5 (R/W) -> breadboard -
- LCD pin 15 (LED+) -> breadboard +
- LCD pin 16 (LED-) -> breadboard -
- contrast potentiometer pin 1 -> breadboard +
- contrast potentiometer pin 3 -> breadboard -

Code:

Code: Select all | TOGGLE FULL SIZE
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(6, 5, 9, 10, 11, 12);
int sensorPin = 0; //temperature sensor

void setup() {
  lcd.begin(16, 2);
  lcd.print("Temperature is:");
}

void loop() {
  lcd.setCursor(0, 1);
 
  int reading = analogRead(sensorPin); 
 
  float voltage = reading * 3.3;
  voltage /= 1024.0;
  float temperatureC = (voltage - 0.5) * 100 ; 
  float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
  lcd.print(temperatureC);
  lcd.print("C ");
  lcd.print(temperatureF);
  lcd.print("F");
  delay(1000);
}


Note: You'll probably need to turn the contrast potentiometer most of the way clockwise to get decent contrast.

You can run it stand-alone using a USB booster pack, or by wiring a 6V pattery pack between + and - on the breadboard.

degroof
 
Posts: 5
Joined: Fri Sep 25, 2015 8:29 am

Re: Thermometer Using ADABOX001

by adafruit_support_mike on Sat Jan 14, 2017 6:57 am

Niecly done.. thanks for posting it!

adafruit_support_mike
 
Posts: 60271
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.