UiTM Smart Environmental Monitoring, Surveillance and Analytics (Public, Environmental and Occupational Health)
What is EMSA? Environmental Monitoring, Surveillance and Analytics. This is technical smart sensor monitoring consist of hardware and software in development of environmental health instrument for monitoring pollutants and predict health outcome. The main Learning Objectives for this course will be:
- Understand the use of IoT Technology in Urban EH Analytics in the application of Big Data Analytics (BDA)
- Develop sensor technology that able to support the BDA for pollutants in community and urban issues
- Develop electronic dashboard that able to support the BDA decision making process to safe-guard environmental health issues in community/ urban
- Analyse the collected data from sensor tchnology, IoT, BDA and utilized machine learning algorithm for making good environmental health decision
This is the official step for my class in UiTM. If you one of the candidate, please do enable yourself "EMSA Kit".
Step for Arduino IDE Setup:
- Navigate arduino website: https://arduino.cc/software
- Download the software according to your Operating System (OS)
- Install the Arduino Software including the related USB Driver
- Copy the following link: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Go to File > Preferences > URL/ Board Manager, paste the above link followed by ","
- Click OK
- Then go to Tool Menu > Board > Board Managers
- In the board manager, type: ESP32
- Click install on the ESP32 by Espressif
- Done Installation
Installation of Libraries *There are two ways to install the libraries, first using the Arduino Library Manager, second using the folder/ zip file.
- Go to Sketch Menu > Include Library > Manage Libraries
- Install the library as you need.
- Navigate the source
- Download the Zip file
- Extract the Zip file
- Rename the folder, remove the "-master" extension if any
- Copy the unzip folder into Arduino library folder
- Paste the folder into Arduino > libraries
- Navigate to the link
- Download
- Extract
- Rename the folder, remove the "-master" name/ extension (if any)
- Copy the unzip and rename folder
- Paste into the Arduino > libraries folder
- rtclib
- rtc by makuna
- MQunifiedsensor
- Adafruit_GFX
- Adafruit_SSD1306
- Adafruit_PM25AQI
- ThingSpeak
- WiFiManager
- SD card if not present link: https://github.com/espressif/arduino-esp32
- Identify the urban environmental health analytics issues to be explore
- Perform secondary data analysis (screening)
- Priotitize the location of interest and start prototyping
- Refer following connection []
- Test each of the sensor using one module at one time
- Follow Chapter 4
The datalogger is define as the sistem/ operation that enable the user to record the data according to the time and date for particular sensor/ sensing process. Its enable the investigator to understand the trend associated with the date and time perspective. The main aim of the datalogger was to simulate the forecasting of the pollutants that exist with the ambient environment.
- Install the SD card module according to the diagram (SPI Connection: https://randomnerdtutorials.com/esp32-microsd-card-arduino/), video link: https://www.youtube.com/watch?v=9cLhrjc6pZY&t=211s
- Install the RTC DS3231 module according to diagram (I2C Connection)
- Software
- Install the ESP32 Board Manager (refer to Chapter 1 & 2)
- Upload Sketch of RTC by Makuna
- Upload sketch of Step 1:
- Connect IR sensor Pin (4)
- Upload code: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/irsensor.ino
- Connect IR Sensor Pin(4)
- Connect the OLED display (SDA, SCL) - I2C
- Upload code: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/irsensor_oled.ino
- Connect IR sensor (4)
- Conenct Oled
- Connect MQ135
- Upload Code: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/irsensor_oled_mq135.ino
- Follow step 1-3 as mention in previous
- Install additional sensor
- Upload code (BMP280): https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/ir_oled_mq_tp.ino
- Upload Code (SHT21): https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/ir_oled_mq_th.ino
- Setup the RTC (Using RTC by MAKUNA)
- Setup the SD Card (Ensure format the SD Card - FAT32) - name file as data.txt
- Upload the CODE: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/ir_oled_mq_tp_datalogger.ino
- Observe the result in SD Card Reader
- Add the PMS7003 sensor (using Serial) into our Datalogger
- Change the view/ update the code
- Upload the code: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/ir_oled_mq_tp_datalogger_pms.ino
- Visualize the output result in SD Card reader
- Follow steps until particle sensor
- Register Thingspeak account > create channel > copy ID + API Write Key
- Ensure to try 2 times, upload with and without comment this LINE: //wifiManager.resetSettings();
- Upload Code: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/ir_oled_mq_tp_datalogger_pms_iot.ino
- Upload Code 2 (Cleaner SD Card Output): https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/final_all.ino
- Connect to internet (Wataverse Technology)
- Go to link: http://192.168.4.1/
- Insert your username + password
- Upload RTC by Makuna
- Edit your Thingspeak ID and API WRITE KEY
- Upload the Code1 (8 parameters) OR: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/final_all.ino
- Upload the Code2 (10 parameters - PMS all): https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/final_fullPMS.ino
- Upload RTC by Makuna
- Edit your Thingspeak ID, API Write Key, Username + Password (WiFi)
- Upload the Code Final (WiFi HardCode): https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/airqualityFinal.ino
- Error on the COM Port - Download driver from the following Link: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads
- Error on the ESP32 Compiling - Uninstall the Arduino IDE, Install Back the IDE, Install the Library
- Error on the ESP32 Compiling - Update the Arduino IDE board Manager
- Check your Thingspeak Channel
- Check your SD Card
- Check the SD Card data into the following column: Date | Time | Temperature | Pressure | co2 | pm03 | pm01 | pm05 | pm50 | pm25 | pm10 | ir detect
The datalogger is now ready for data collection and you should ensure that the power supply is sufficiently provide for the unit together with the stable internet connection. Now is the part where we will import the thingspeak data from the IOT Analytics into the Google Sheet for further action/ dashboard.
Now we will construct normal Google Site for our display of the Thingspeak Chart into the Google Site.
Now this time we will using the Google Sheet as databases retrive from the IOT Thingspeak server.
- Setup the Google Sheet (Insert Relevant Headers)
- Setup the Google App Script
- Copy coding from the following link: https://raw.githubusercontent.com/ismailsakdo/uitm_emsa/main/GOODimportThingspeakFinal.gs
- Activate, save and run accordingly