Indoor/Outdoor Variable Monitoring System Using An Arduino Uno The most basic co
ID: 2250113 • Letter: I
Question
Indoor/Outdoor Variable Monitoring System Using An Arduino Uno
The most basic configuration needs to use the following:
1. An Arduino Uno R3 microprocessor board
2. Breadboard for wiring up your Arduino and circuitry
3. Resistors, jumper wires, capacitors, LEDs (as required)
4. A 16x2 LCD unit or similar
5. At least one momentary contact switch or push button
6. An LM35 sensor
7. A DHT11 or DHT22 temperature/humidity sensor
Use LEDs as temperature range indicators and an LCD display to report actual temperature and humidity measurements. Use a pushbutton to allow the user to toggle between the indoor and the outdoor measurements on the LCD.
For the indoor temperature and humidity measurements use the DHT11 (or the DHT22) and for the simulated outdoor use the LM35 for measuring the temperature only. Your circuit should toggle between two displays (using the LCD):
• Indoor temperature and humidity
• Outdoor temperature
Toggle between screens every 6 seconds, and use a pushbutton as a user option to switch immediately between the 2 screens. In addition, your outdoor thermometer should use 2 or 3 LEDs to signal in-range or out-of-range temperature (blue, green and red for low, medium and high temperature accordingly). The indoor sensor should be located on the breadboard and the outdoor sensor should be connected to the breadboard via wires so it can be moved away at least 8 inches. The temperature and humidity measured variables have to be displayed on the LCD.
To demonstrate temperature range detection with the LEDs, measure the actual indoor ambient temperature, then turn on a blue LED if the temperature drops more than a 3 degrees, and turn on a red LED if the temperature rises more than 3 degrees bot of these with respect to the ambient temperature. You have to determine the upper and lower ranges.
The display should toggle between the two states periodically, but also transition immediately if the user presses the push button. The values on the screen should show noticeable changes.
Please include C++ code.
Explanation / Answer
/
/PURPOSE: DHT, RTC and LCD show Arduino
/Three cases united to make a temp/stickiness and time show on a 16/2 LCD.
/RTC and LCD utilize i2c port (i2c Gnd 5V and pins a4 sda, a5 scl) DHT-11 BRICK unit utilizes Gnd 5V and stick 2
/Released to general society area
#include <Wire.h>/In standard library
#include <dht.h>
#include <LiquidCrystal_I2C.h>
#include "RTClib.h"/
/* - ( Declare Constants )- - */
/* - ( Declare objects )- - */
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);/Set the LCD I2C address Ox3F (Check yours)
RTC_DS1307 rtc;/Create a RealTimeClock protest (I set the time in another outline)
/* - ( Declare Variables )- - */
DHT;
#define DHT11_PIN 2/utilize stick 2 on UNO to test information from DHT module
void setup()
{
Serial.begin(9600);
Serial.println("DHT TEST PROGRAM ");
Serial.print("DHT LIBRARY VERSION: ");
Serial.println(DHT_LIB_VERSION);
Serial.println();
Serial.println("Humidity % Temperature (C) Time Date");
lcd.begin(16,2);/characterizes it is a 16 character two line show
rtc.begin();/Start the RTC library code
}
void circle()
{
/READ DATA
DateTime now = rtc.now();
int chk = DHT.read11(DHT11_PIN);
Serial.print(DHT.humidity, 1);
Serial.print(", ");
Serial.print(" ");
Serial.print(DHT.temperature, 1);
Serial.print(", ");
Serial.print(" ");
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.print(' ');
Serial.print(now.day(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.println(now.year(), DEC);
lcd.setCursor(0,0);/begin postion of Humidity message on LCD
lcd.print(DHT.humidity, 0);/0 makes entire number, 1 two decimal
lcd.print("% Humidity ");
lcd.setCursor(0,1);/begin postion of temperature message on LCD
lcd.print(DHT.temperature, 0);
lcd.print(" C");
lcd.setCursor(6,1);/begin postion of time message on LCD
lcd.print(now.hour(), DEC);
lcd.print(':');
lcd.print(now.minute(), DEC);
lcd.print('.');
lcd.print(now.second(), DEC);
/You can show in lcd by changing Serial to lcd I have just utilized time above not date
/Serial.print(now.year(), DEC);
/Serial.print('/');
/Serial.print(now.month(), DEC);
/Serial.print('/');
/Serial.print(now.day(), DEC);
/Serial.print(' ');
/Serial.print(now.hour(), DEC);
/Serial.print(':');
/Serial.print(now.minute(), DEC);
/Serial.print(':');
/Serial.print(now.second(), DEC);
/Serial.println();
delay(1000);/screen - test and LCD revive time 1 second despite the fact that DHT say min 2 seconds however works alright.
}
/
/END OF FILE
/