Indoor Environment Monitoring

Indoor Environment Monitoring

Experimental introduction

In this experiment we will use three modules to collect data such as light, temperature, humidity and atmospheric pressure. At the same time, the data is sent and displayed on the LCD12854 through the serial port.

Experimental Materials

1X  Adeept UNO Board

1X  DHT-11 Module

1X  Photoresistor Module

1X  Barometer Module

1X  LCD12864 Module

1X  Breadboard

Some jumpers

Experimental connection diagram

Experiment code

File name:   AdeeptLCD12864.ino
Author: Tom
Date: 2019/03/20 
#include <Adeept_LCD12864RSPI.h>
#include <Adeept_DHT11.h>
#include <Adeept_BMP180.h>
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
Adeept_DHT11 Adeept_dht11;
Adeept_BMP180 Adeept_bmp180(0x77);//I2C address of BMP180
#define DHT11PIN 2  //Set the digital 2 to the S pin

int photoresistorPin = 0;          // photoresistor  connected to analog pin 0
unsigned char show0[]=" photoresistor";         //Test the code
unsigned char show1[]=" analog:       ";     
unsigned char show2[]="";  
unsigned char show3[]="DHT11 sensor";      
unsigned char show4[]="Humi:       %";    
unsigned char show5[]="Temp:       %";
unsigned char show6[]="   Pressure  ";       
unsigned char show7[] = "Pr:          Pa ";
unsigned char show8[] = "Atm:       ";
unsigned char show9[] = "Alti:        M  ";

int btnpin1 = 12;           //Set the digital 12 to button module interface 
int btnpin2 = 13;           //Set the digital 13 to button module interface      

int pageNumber = 1;
void setup()
    pinMode(photoresistorPin, INPUT);//Set analog 0 port mode, the INPUT for the input
    Serial.begin(9600);   //opens serial port, sets data rate to 9600 bps
    pinMode(btnpin1,INPUT); //Set digital 12 port mode, the INPUT for the input
    pinMode(btnpin2,INPUT); //Set digital 13 port mode, the INPUT for the input
    Adeept_12864.Initialise(); // The screen is initialized
void loop()
    double dataphotoresistor = 0;
    char strphotoresistor[5];
    double temphumidity = 0;
    double tempTemperature = 0;
    char strhumidity[5];
    char strTemperature[5];
    char strPressure[7];
    char strAtm[3];
    char strAltitude[5];
    dataphotoresistor = analogRead(photoresistorPin);
    Serial.print("photoresistor: "); //send data to the serial monitor
    Serial.println(dataphotoresistor); //send data to the serial monitor;
    temphumidity = Adeept_dht11.humidity;
    Serial.print("humidity: "); //send data to the serial monitor
    Serial.print(temphumidity); //send data to the serial monitor
    Serial.println("%"); //send data to the serial monitor

    tempTemperature = Adeept_dht11.temperature;
    Serial.print("temperature: "); //send data to the serial monitor
    Serial.print(tempTemperature); //send data to the serial monitor
    Serial.println("C"); //send data to the serial monitor

    double dataTemperature = Adeept_bmp180.GetTemperature(); //MUST be called first
    float dataPressure = Adeept_bmp180.GetPressure();
    float dataAtm = dataPressure / 101325; // "standard atmosphere"
    float dataAltitude = Adeept_bmp180.calcAltitude(dataPressure); //Uncompensated caculation - in Meters

    Serial.print("Temperature: "); //send data to the serial monitor
    Serial.print(dataTemperature); //send data to the serial monitor
    Serial.println("C"); //send data to the serial monitor

    Serial.print("Pressure: "); //send data to the serial monitor
    Serial.print(dataPressure); //send data to the serial monitor
    Serial.println("Pa"); //send data to the serial monitor

    Serial.print("Atm: "); //send data to the serial monitor
    Serial.println(dataAtm); //send data to the serial monitor

    Serial.print("Altitude: "); //send data to the serial monitor
    Serial.print(dataAltitude); //send data to the serial monitor 
    Serial.println("M"); //send data to the serial monitor 

      dtostrf(dataphotoresistor,4,0,strphotoresistor);//Converts a floating-point number to a string
      Adeept_12864.DisplayString(0,0,show0,AR_SIZE(show0));//Display: photoresistor
      Adeept_12864.DisplayString(1,0,show1,AR_SIZE(show1));//Display: analog: 
      Adeept_12864.DisplayString(1,4,(unsigned char *)strphotoresistor,4);//Display photoresistor data

      dtostrf(temphumidity,5,2,strTemperature);//Converts a floating-point number to a string
      dtostrf(tempTemperature,5,2, strhumidity );//Converts a floating-point number to a string
      Adeept_12864.DisplayString(0,1,show3,AR_SIZE(show3));//Display: DHT11 sensor
      Adeept_12864.DisplayString(1,1,show4,AR_SIZE(show4));//Display: Humi:     %
      Adeept_12864.DisplayString(1,4,(unsigned char *)strTemperature,5);//Display humidity data  
      Adeept_12864.DisplayString(2,1,show5,AR_SIZE(show5));//Display: Temp:     C
      Adeept_12864.DisplayString(2,4,(unsigned char *)strhumidity,6);//Display temperature data

      dtostrf(dataPressure, 6, 2, strPressure); //Converts a floating-point number to a string
      dtostrf(dataAtm, 2, 2, strAtm); //Converts a floating-point number to a string
      dtostrf(dataAltitude, 4, 2, strAltitude); //Converts a floating-point number to a string
      Adeept_12864.DisplayString(0, 0, show6, AR_SIZE(show6)); //Display: Temp:      C
      Adeept_12864.DisplayString(1, 0, show7, AR_SIZE(show7)); //Display: Pr:        Pa
      Adeept_12864.DisplayString(1, 2, (unsigned char *)strPressure, 8); //Display temperature data
      Adeept_12864.DisplayString(2, 0, show8, AR_SIZE(show8)); //Display: Atm:         Pa
      Adeept_12864.DisplayString(2, 2, (unsigned char *)strAtm, 4); //Display temperature data
      Adeept_12864.DisplayString(3, 0, show9, AR_SIZE(show9)); //Display: Altitude:     M
      Adeept_12864.DisplayString(3, 3, (unsigned char *)strAltitude, 6); //Display temperature data  
  if(digitalRead(btnpin1)==LOW)              //Detection button interface to low
      delay(10);                              //Delay 10ms for the elimination of key leading-edge jitter
      if(digitalRead(btnpin1)==LOW)           //Confirm button is pressed
        Adeept_12864.CLEAR();//Clear screen
  if(digitalRead(btnpin2)==LOW)              //Detection button interface to low
      delay(10);                              //Delay 10ms for the elimination of key leading-edge jitter
      if(digitalRead(btnpin2)==LOW)           //Confirm button is pressed
        Adeept_12864.CLEAR();//Clear screen


Experimental phenomena

Press the two buttons to control the LCD12864 to display page turning, switch display information such as illumination, temperature and humidity.

122 Replies to “Indoor Environment Monitoring”

  1. Pingback: psiholog
  2. Pingback: Suicide Squad 2
  3. Pingback:
  4. Pingback:
  5. Pingback:
  6. Pingback:
  7. Pingback: KremlinTeam
  8. Pingback: link
  9. Pingback: A3ixW7AS
  10. Here at Leslie’s Pugsland Breeder, Our beautiful fawn pug has given birth to 4 healthy Pug puppies.
    She is our beloved family dog and this is her 1st litter.
    Both mum and dad are AKC registered with 5 gen pedigree certificate. Both from Top Champion bloodlines.Mum and Dad can be seen. Puppies have been wormed weeks 2,4,6,8 and will have had a flea preventative treatment before leaving us.
    They will have their vet check, 1st vaccinations and microchip.
    To view all available puppies and recent pictures, Search us in google as LESLIE’S PUGSLAND BREEDER or click on our website link bellow :

    Pug Puppies for sale | pug for sale near me | pug puppy for sale | pug puppy | pug for sale | pug puppies for sale in va | black pug puppies for sale

  11. Pingback: ukraine
  12. Pingback: vechernyy urgant
  13. Pingback: Porno
  14. Pingback: 66181
  15. Pingback: blogery_i_dorogi
  16. Pingback: bender na4alo 2021
  17. Pingback:
  18. Pingback: chelovek-iz-90-h
  19. Pingback: what is in cialis
  20. Pingback: top
  21. Pingback: generic cialis
  22. Pingback: site
  23. Pingback: Ukrainskie-serialy
  24. Pingback: video
  25. Pingback: topvideos
  26. Pingback:
  27. Pingback: projectio-freid
  28. Pingback: psy2022
  29. Pingback: psy
  30. Pingback: news news news
  31. Pingback: 4569987
  32. Pingback: Zakhar Berkut hd
  33. Pingback: price of cialis
  34. Pingback: viagra
  35. Pingback: Viagra Gold
  36. Pingback: viagra vs cialis
  37. Pingback: is viagra safe
  38. Pingback: viagra coupon
  39. Pingback: cialis for sale
  40. Pingback: buy cialis online
  41. Pingback: Glock 17
  42. Pingback: Grand Power CP380
  43. Pingback: GLOCK 48
  44. Pingback: cach vao 12 bet
  45. Pingback: idrpoker
  46. Pingback: nagaqq
  47. Pingback: jaguarqq
  48. Pingback: fun88vnd
  49. Pingback: tutors
  50. Pingback: THC Carts for sale
  51. Pingback: Sonus Complete
  52. Pingback: w88
  53. Pingback: tong trong lo de
  54. Pingback: CBD Spray
  55. Pingback: vpn with webmoney
  56. Pingback: keto pills
  57. Pingback:
  58. Pingback: Skrotbilar hämtas
  59. Pingback: w88tips
  60. Pingback: slotxo
  61. Pingback: Homepage
  62. Pingback: How to lose weight
  63. Pingback: look at this site
  64. Pingback: Qənnadı şokolad
  65. Pingback: ship a car
  66. Pingback: republic of Panama
  67. Pingback: parcourir le site
  68. Pingback: 토토사이트
  69. Pingback: großer Schwanz
  70. Pingback: prediksi hk

Leave a Reply