Indoor Environment Monitoring with ESP32 & LCD Screen
Indoor Environment Monitoring with ESP32 & LCD Screen using SPG30 & DHT11 Sensors. Air Quality Monitor with ESP32 LCD Screen & SPG30 DHT11
- Suitable forB.Tech/Diploma ESP32/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
This is a simple Indoor Environment Monitoring Project with ESP32 & LCD screens. We will utilize the Indoor Environment Expansion board made using DHT11 Humidity & Temperature Sensor and
SPG30 Air Quality Sensor
. The expansion board is used for measuring CO2, TVOC, Temperature and Humidity. Earlier we used
BME680 Sensor
the Indoor Air Quality.
The LCD Screen used here is having an ILI9488 driver with a screen size of 3.5″ & a screen resolution of 320×480. It is basically a TFT touch screen but we will not be using the touch function but rather use it as a colorful display.
As a first project, we will display the Temperature, Humidity & CO2 value in a beautiful gauge. The three gauges will show the increase or decrease in circular widgets pattern. Similarly, as a second project, we will display the CO2 & TVOC value in a graphical format. The graphs will rise and fall on the basis of an increase or decrease in CO2 & TVOC value. The ESP32 & TFT LCD Display can be used in Indoor Environment Monitoring.
Bill of Materials
Following is the list of components that you need for making this project. You can purchase all these components online.
S.N.
Components
Description
Quantity
Purchase Links
1
ESP32+TFT Touch Display
ESP32 3.5\" TFT Touch(Capacitive) with Camera
1
Makerfabs Link
2
Indoor Environment Expansion board
SPG30 + DHT11 Sensor + Buzzer
1
Makerfabs Link
3
USB Cable
Type-C USB Cable for Programming
1
Amazon
AliExpress
3
Connecting Wires
Male to Female Jumper Wires
3
Amazon
AliExpress
ESP32 3.5″ TFT Touch(Capacitive) with Camera
This is a beautiful
3.5” touchscreen display
, based on
ESP32-WROVER chip
, with a built-in
2M pixel OV2640 camera
. The combination of all these gives a perfect platform for multiple ESP32 Applications & Projects.
The TFT LCD driver is basically
ILI9488
& has a dimension of
3.5″
with
320×480
screen resolution. The
ILI9488 LCD
uses SPI for communication with the ESP32 chip. The SPI main clock could be up to
60M~80M
, make the display smooth enough for videos.
While the camera is not used, you can freely use all these pins with the breakout connectors. You can then connect the ESP32 display with sensors or modules & use it for any
IoT applications
. The ESP32 chip support Arduino or MicroPython programming
The board is having a
micro SD-Card slot
for attaching an external SD-Card. The SD Card can be used for storing files and images. There is a
type C USB Port
, basically a USB to UART converter for ESP32 programming. You can connect a Type-C data cable to the board & directly upload the code to the Board.
Specification
1. 3.5 inch display,
320×480
2. Capacitive/Resistive Touch
3. ESP32-WROVER Controller
4.
WIFI/ BLE
Connection.
5. Onboard USB2UART convertor for ESP32 programming
6. 2M pixel OV2640 Camera
7.
OV2640
supports output images up to 2 million pixels
8. LCD 3.5-inch Amorphous-TFT-LCD for mobile-phone or handy electrical equipment
9. LCD Driver: ILI9488
10. LCD Resolution: 320*480
11. Micro SD card slot on the board
12.
NS2009
: A 4-wire resistive touch screen control circuit
13.
FT6236
: single-chip capacitive touch panel controller Integrated Circuit
14. Power supply:
5V
, Type-C USB
Check some of our previous projects using this TFT Touch Screen Display:
1.
ESP32 TFT Touch Display Video Games
2.
ESP32 TFT Touch & Camera Projects
3.
Ultrasonic Range Finder
4.
Wind Speed Display
5.
Temperature Humidity Monitoring
ESP32 Touch Indoor Environment Expansion
This is an Indoor environment expansion board for the ESP32 3.5 Touch Screen. The ESP32 3.5 TFT touch can also be used as a hardware expansion, with the expansion connector.
The Indoor environment expansion integrates the temperature & humidity sensor DHT11 and SGP30 Air Quality Sensor, to detect the CO2 and TVOC, so you can create an indoor environment detector easily. There is also an onboard buzzer that can be used for the alarm.
Installing Necessary Libraries to Arduino IDE
1. TFT_eSPI Library
This is a TFT graphics library for Arduino processors with performance optimization for STM32, ESP8266 & ESP32. The library is targeted at 32-bit processors. It supports “Four wire” SPI and 8 bit parallel interfaces. The library supports some TFT displays with drivers for ILI9163, ILI9225, ILI9341, ILI9488, ST7735 etc.
You can download the library from the
Github
directory. But the library requires some modification for our project. So here is an edited version of the library. You can download and add it to the library folder.
Download:
TFT_eSPI Library
2. DHT11 Library
To read the temperature and humidity we need any temperature humidity sensor. For that DHT11 is the best and cheap sensor. We need to install DHT11 Library for that. Download the library from below and add to the Arduino IDE.
Download:
DHT11 Library
3. Adafruit SPG30 Library
To read the environmental CO2 & TVOC Data, we need SPG30 Sensor. The Adafruit SGP30 Gas/Air Quality I2C sensor library measure equivalent carbondioxide as well as Total Volatile Organic Compound.
Download:
Adafruit SPG30 Library
Indoor Environment Monitoring on Gauge
Let us use the ESP32 & LCD Screen for Indoor Environment Monitoring. The LCD Screen will display the value of temperature, humidity, and CO2 level in Gauge format.
The below code uses two files one as a .ino file and the other as a .h file.
Main Code
Copy the following code and paste it on your Arduino IDE and save it as .ino format.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
// Meter colour schemes
#define RED2RED 0
#define GREEN2GREEN 1
#define BLUE2BLUE 2
#define BLUE2RED 3
#define GREEN2RED 4
#define RED2GREEN 5
#define TFT_GREY 0x2104 // Dark grey 16 bit colour
#include \"alert.h\" // Out of range alert icon
#include `TFT_eSPI.h` // Hardware-specific library
#include `SPI.h`
#include `Wire.h`
#include \"Adafruit_SGP30.h\"
#include \"DHT.h\"
#define BUZZPIN 5
#define LDO_PWR_EN_PIN 19 //AP2112K enable pin
#define BUZZER_ON digitalWrite(BUZZPIN, HIGH)
#define BUZZER_OFF digitalWrite(BUZZPIN, LOW)
#define LDO_1V8_ON digitalWrite(LDO_PWR_EN_PIN, HIGH)
#define LDO_1V8_OFF digitalWrite(LDO_PWR_EN_PIN, LOW)
#define DHTPIN 18 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT11
DHT
dht
(
DHTPIN
DHTTYPE
)
;
Adafruit_SGP30
sgp
;
#define I2C_SDA 26
#define I2C_SCL 27
TFT_eSPI
tft
=
TF
This is a simple Indoor Environment Monitoring Project with ESP32 & LCD screens. We will utilize the Indoor Environment Expansion board made using DHT11 Humidity & Temperature Sensor and
SPG30 Air Quality Sensor
. The expansion board is used for measuring CO2, TVOC, Temperature and Humidity. Earlier we used
BME680 Sensor
the Indoor Air Quality.
The LCD Screen used here is having an ILI9488 driver with a screen size of 3.5″ & a screen resolution of 320×480. It is basically a TFT touch screen but we will not be using the touch function but rather use it as a colorful display.
As a first project, we will display the Temperature, Humidity & CO2 value in a beautiful gauge. The three gauges will show the increase or decrease in circular widgets pattern. Similarly, as a second project, we will display the CO2 & TVOC value in a graphical format. The graphs will rise and fall on the basis of an increase or decrease in CO2 & TVOC value. The ESP32 & TFT LCD Display can be used in Indoor Environment Monitoring.
Bill of Materials
Following is the list of components that you need for making this project. You can purchase all these components online.
S.N.
Components
Description
Quantity
Purchase Links
1
ESP32+TFT Touch Display
ESP32 3.5\" TFT Touch(Capacitive) with Camera
1
Makerfabs Link
2
Indoor Environment Expansion board
SPG30 + DHT11 Sensor + Buzzer
1
Makerfabs Link
3
USB Cable
Type-C USB Cable for Programming
1
Amazon
AliExpress
3
Connecting Wires
Male to Female Jumper Wires
3
Amazon
AliExpress
ESP32 3.5″ TFT Touch(Capacitive) with Camera
This is a beautiful
3.5” touchscreen display
, based on
ESP32-WROVER chip
, with a built-in
2M pixel OV2640 camera
. The combination of all these gives a perfect platform for multiple ESP32 Applications & Projects.
The TFT LCD driver is basically
ILI9488
& has a dimension of
3.5″
with
320×480
screen resolution. The
ILI9488 LCD
uses SPI for communication with the ESP32 chip. The SPI main clock could be up to
60M~80M
, make the display smooth enough for videos.
While the camera is not used, you can freely use all these pins with the breakout connectors. You can then connect the ESP32 display with sensors or modules & use it for any
IoT applications
. The ESP32 chip support Arduino or MicroPython programming
The board is having a
micro SD-Card slot
for attaching an external SD-Card. The SD Card can be used for storing files and images. There is a
type C USB Port
, basically a USB to UART converter for ESP32 programming. You can connect a Type-C data cable to the board & directly upload the code to the Board.
Specification
1. 3.5 inch display,
320×480
2. Capacitive/Resistive Touch
3. ESP32-WROVER Controller
4.
WIFI/ BLE
Connection.
5. Onboard USB2UART convertor for ESP32 programming
6. 2M pixel OV2640 Camera
7.
OV2640
supports output images up to 2 million pixels
8. LCD 3.5-inch Amorphous-TFT-LCD for mobile-phone or handy electrical equipment
9. LCD Driver: ILI9488
10. LCD Resolution: 320*480
11. Micro SD card slot on the board
12.
NS2009
: A 4-wire resistive touch screen control circuit
13.
FT6236
: single-chip capacitive touch panel controller Integrated Circuit
14. Power supply:
5V
, Type-C USB
Check some of our previous projects using this TFT Touch Screen Display:
1.
ESP32 TFT Touch Display Video Games
2.
ESP32 TFT Touch & Camera Projects
3.
Ultrasonic Range Finder
4.
Wind Speed Display
5.
Temperature Humidity Monitoring
ESP32 Touch Indoor Environment Expansion
This is an Indoor environment expansion board for the ESP32 3.5 Touch Screen. The ESP32 3.5 TFT touch can also be used as a hardware expansion, with the expansion connector.
The Indoor environment expansion integrates the temperature & humidity sensor DHT11 and SGP30 Air Quality Sensor, to detect the CO2 and TVOC, so you can create an indoor environment detector easily. There is also an onboard buzzer that can be used for the alarm.
Installing Necessary Libraries to Arduino IDE
1. TFT_eSPI Library
This is a TFT graphics library for Arduino processors with performance optimization for STM32, ESP8266 & ESP32. The library is targeted at 32-bit processors. It supports “Four wire” SPI and 8 bit parallel interfaces. The library supports some TFT displays with drivers for ILI9163, ILI9225, ILI9341, ILI9488, ST7735 etc.
You can download the library from the
Github
directory. But the library requires some modification for our project. So here is an edited version of the library. You can download and add it to the library folder.
Download:
TFT_eSPI Library
2. DHT11 Library
To read the temperature and humidity we need any temperature humidity sensor. For that DHT11 is the best and cheap sensor. We need to install DHT11 Library for that. Download the library from below and add to the Arduino IDE.
Download:
DHT11 Library
3. Adafruit SPG30 Library
To read the environmental CO2 & TVOC Data, we need SPG30 Sensor. The Adafruit SGP30 Gas/Air Quality I2C sensor library measure equivalent carbondioxide as well as Total Volatile Organic Compound.
Download:
Adafruit SPG30 Library
Indoor Environment Monitoring on Gauge
Let us use the ESP32 & LCD Screen for Indoor Environment Monitoring. The LCD Screen will display the value of temperature, humidity, and CO2 level in Gauge format.
The below code uses two files one as a .ino file and the other as a .h file.
Main Code
Copy the following code and paste it on your Arduino IDE and save it as .ino format.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
// Meter colour schemes
#define RED2RED 0
#define GREEN2GREEN 1
#define BLUE2BLUE 2
#define BLUE2RED 3
#define GREEN2RED 4
#define RED2GREEN 5
#define TFT_GREY 0x2104 // Dark grey 16 bit colour
#include \"alert.h\" // Out of range alert icon
#include `TFT_eSPI.h` // Hardware-specific library
#include `SPI.h`
#include `Wire.h`
#include \"Adafruit_SGP30.h\"
#include \"DHT.h\"
#define BUZZPIN 5
#define LDO_PWR_EN_PIN 19 //AP2112K enable pin
#define BUZZER_ON digitalWrite(BUZZPIN, HIGH)
#define BUZZER_OFF digitalWrite(BUZZPIN, LOW)
#define LDO_1V8_ON digitalWrite(LDO_PWR_EN_PIN, HIGH)
#define LDO_1V8_OFF digitalWrite(LDO_PWR_EN_PIN, LOW)
#define DHTPIN 18 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT11
DHT
dht
(
DHTPIN
DHTTYPE
)
;
Adafruit_SGP30
sgp
;
#define I2C_SDA 26
#define I2C_SCL 27
TFT_eSPI
tft
=
TF
Technologies used
Hardware components
- ESP32
- ESP8266
- Arduino
- STM32
- DHT11
- SD Card
Software & tools
- Arduino IDE
- MicroPython
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.