Weather Clothes Recommender - Dress Appropriately
by TechMartian in Circuits > Arduino
1400 Views, 5 Favorites, 0 Comments
Weather Clothes Recommender - Dress Appropriately
This is a mini local weather station that can be setup either on your backyard or even on your bedside window. It uses information gathered about the weather using sensors and an Arduino to make an appropriate recommendation given the weather outside.
BoM
- Arduino
- LCD Display
- Temperature sensor - TMP36
- Breadboard
- Jumper cables
- Breadboard cables
Wiring
Follow the table below for a concise guide for wiring the peripherals with the Arduino Board.
I/O | I/O Pin# | Arduino Pin# |
---|---|---|
Temperature Sensor | 1 | GND |
2 | A0 | |
3 | 3.3V |
LCD Pin# | Potentiometer Pin# | Arduino Pin# |
---|---|---|
1, 5, and 16 | 1 | GND |
2 and 15 | 3 | 3.3V |
3 | 2 | |
4 | 12 | |
6 | 11 | |
11 | 5 | |
12 | 4 | |
13 | 3 | |
14 | 2 |
Code
// built in arduino library
#include <LiquidCrystal.h> LiquidCrystal lcd(12,11,5,4,3,2);
int tempVal; //raw reading variable float volts; float tempC; float tempF;
void setup() { lcd.begin(16, 2); // clear old screen data lcd.clear(); // text to be dispalyed on the screen Serial.begin (9600); }
void loop() { //read the temp sensor and store it in tempVal tempVal = analogRead(A0); //converting that reading to voltage by multiplying the reading by 3.3V volts = tempVal * 3.3; volts /= 1023.0;
//calculate temperature celsius from voltage tempC = (volts - 0.5) * 100 ; // Convert from celcius to fahrenheit tempF = (tempC * 9.0 / 5.0) + 32.0; Serial.println(tempC); // (column 0) of the second line (line 1): lcd.setCursor(0,0); lcd.write ("Temp: "); lcd.setCursor (7, 0); lcd.print (tempC, 2);
lcd.setCursor (13, 0); lcd.write ("C");
if (tempC <0){ lcd.setCursor (0, 1); lcd.write ("wear winter coat") }else if (temp <20){ lcd.write ("wear light coat");} else if (tempC<25){ lcd.write ("windbreaker");} else if (tempC>30){ lcd.write ("beach weather!!!")}
// for farenheit temperatures /* lcd.setCursor(0,1); lcd.write ("Temp: "); lcd.write (tempF);
lcd.setCursor (10, 1) lcd.write ("F"); */ delay(1000); }
Mount
Snake the wires through to the outside of your window under the screen. It's easiest to remove the screen, mount the temperature sensor and then replace the screen.
Enjoy!
Enjoy your build!
And wear weather appropriate clothing, stay warm, stay cool (depending on your hemisphere)!!!