Project Overview - Mnguyen4000/CSSE4011-Vulcan-Yellow GitHub Wiki

Project and Scenario Description

The project requires the users to construct and integrate a network of Bluetooth devices to measure the air quality and to act as a weather station. This would be done through the use of 3 nodes, each having the capability to measure the air quality. The task will be using 2 Thingy52 and 1 SEN54 to detect the air quality. It will involve integrating the systems together to get valuable data on the current weather conditions and will be displayed on a web dashboard viewer for ease of access.

System Overview

Hardware Architecture- block diagram of the system

image

Figure 1, Block Diagram of the Hardware Implementation

Top-level flowchart of software implementation (mote and PC)

image

Figure 2, Flowchart of the NRF52840dk board Software Implementation

image

Figure 3, Flowchart of the Thingy52 Software Implementation

pc flowchart

Figure 4, Flowchart of the PC Software Implementation

Wireless Network Communication

The design will be using a Bluetooth mesh communication to talk between the thingy52 and the nrf52840dk board. The thingy52 will transmit their own sensor data as Bluetooth advertisements, whilst also scanning for any other thingy52 weather stations. If it detects the signal of a thingy52, it will relay the same messages as other thingy52 to the base node. This will allow for further distance communications with the Bluetooth devices as not all stations need to be in proximity of the base node to gather all the data.

image

Figure 5, Different Types of BLE Protocols.

The Bluetooth messaging protocol will be formatted using the Eddystone UUID protocol, as shown in Figure 5, where it allows 10 bytes for its name space ID and 6 bytes for the instance ID. The formatting of the data transfers between each mobile node will include its own unique ID for the name space ID, and the sensor data information in its instance ID. With this format, information about the data and the sender of that data can be established for meshing.

Protocol Diagram Proj drawio

Figure 6, Message Protocol Diagram.

The formatting of the 6 byte instance includes:

Byte 6, Indicates the sensor type.

  • 'V' : TVOC Sensor
  • 'T' : Temperature Sensor
  • 'H' : Humidity Sensor

Byte 5, Displays the Device ID of the Thingy52 the sensor data belongs to.

It ranges from 1 to 9, but as of this project, it will only use 1 and 2 due to only having 2 modules of the Thingy52.

Byte 4 to 1, Sensor Data.

These four bytes will be used to transmit the actual data from the sensors.

Algorithm Scheme: Data Fusion with Time Synchronization

Initialization

  • Initialize variables:
    • sensor_data: An empty dictionary to store sensor data.
    • reference_time: Variable to store the reference time for time synchronization.

Sensor Data Collection

  • For each sensor:
    • Collect sensor data including temperature, humidity, TVOC, air pressure, and timestamp.
    • Store the data in the sensor_data dictionary.

Time Synchronization

  • For each sensor data in sensor_data:
    • Extract the timestamp from the data.
    • If reference_time is None:
      • Set reference_time to the timestamp of the first sensor data.
    • Calculate the time difference between the current timestamp and reference_time.
    • Adjust the timestamp of the sensor data using the time difference.

Data Fusion

  • For each synchronized sensor data:
    • Merge data into synced_data dictionary using timestamp as key.
    • Handle conflicts if multiple sensors report data for same timestamp.

Output

  • Output the fused sensor data to web dashboard viewer.

System Integration

The pair of thingy52 will use their air quality sensors (CCS811) to detect and then relay the information onto the base node (nrf52840dk_nrf52840) via Bluetooth advertising. Once the Thingy52 are powered on, they will initialise their CCS811 sensors and will constantly output the data for their corresponding sensors. The nrf52840dk board will work similarly where, once powered on, will automatically scan for the Thingy52 and receive their information autonomously.

The SEN54 will be equipped with its own VOC sensors to transmit the data to the base node through a I2C connection. The base node will periodically send the data to the PC through UART connection via the USB cable in JSON format.

DIKW Pyramid Abstraction

Data:

The data that will be extract from the project will be the immediate air quality of the vicinity. It will measure the CO2 levels and volatile organic compounds.

Information:

The CCS811 has a TVOC range of 0 to 1187 parts per billion (ppb) and a CO2 range of 400 to 8192 parts per million (ppm).

Knowledge:

Volatile organic compounds are man-made chemicals such as Formaldehyde, which forms in the atmosphere by heating plastics, or Methylene chloride which is present in paint removers, and other flame retardant chemicals. By detecting the atmosphere's VOC levels, we will be able to evaluate if the atmosphere is at a safe level.

Carbon Dioxide is molecule which traps heats in our atmosphere, and is therefore an important green house gas but can also aid global warming. The effects of Carbon Dioxide poisoning are also deadly if exposed in close proximity to it for too long. This would include having headaches, drowsiness and eventual death if the subject does not remove themselves from the vicinity.

Wisdom:

By acquiring the information of the air quality, we can determine if atmosphere is at a safe level solely through technological means instead of sampling the air and testing it through chemicals. It will allow us to get an almost instantaneous value in which we can access at a safe remote distance. For example this could help in environments such as mines, where they could keep a constant reading to let the workers know if the levels reach a dangerous level. Another example could be in more pollutant cities where they take data periodically and compare it with previous data to keep a constant track of the pollution levels.