This week I have been mostly busy around the design of the flow of data in the system. Working from the high-level architecture presented from this post, the diagram below presents how data flows within the different component of the system.
From the left, the Emission Sensor will transmit CO2 levels and accelerometer over Bluetooth Smart connection to a smartphone application. The accelerometer information will be used by the Smartphone app to determine the vehicle's state (off, idle, running). Using the accelerometer data and GPS information from the smartphone, the mobile app can determine travel time, idle time, and distance travelled, which will then be sent to Sierra Wireless AirVantage application. This defines the first AirVantage application model:
<data> <encoding type="MQTT"> <asset default-label="CarbonMobile" id="mobile"> <variable default-label="TravelTime" path="travelTime" type="double"/> <variable default-label="IdleTime" path="idleTime" type="double"/> <setting default-label="DistanceTravelled" path="distanceTravelled" type="int"/> <setting default-label="CO2Level" path="co2Level" type="double"/> <setting default-label="VehicleState" path="vehicleState" type="int"/> </asset> </encoding> </data>
On the right side of the diagram, data from the environment (indoor/outdoor) sensors, smart plug, and smart switch metrics are transmitted to the Central Hub via WiFi. Some of the metrics include power consumption in Watt-sec, environment conditions. Power consumption will then be translated into equivalent carbon footprint as 1.52 lbs for every kilowatt-hour (references below). The application on the central hub then deducts this carbon usage against the set carbon budget. This defines the second AirVantage application model:
<data> <encoding type="MQTT"> <asset default-label="CarbonHub" id="hub"> <variable default-label="IndoorTemperature" path="indoorTemperature" type="double"/> <variable default-label="IndoorHumidity" path="indoorHumidity" type="double"/> <variable default-label="OutdoorTemperature" path="outdoorTemperature" type="double"/> <variable default-label="OutdoorHumidity" path="outdoorHumidity" type="double"/> <variable default-label="CarbonBudget" path="carbonBudget" type="double"/> <variable default-label="CarbonUsage" path="carbonUsage" type="double"/> <variable default-label="SwitchState" path="switchState" type="boolean"/> <variable default-label="PlugState" path="plugState" type="boolean"/> </asset> </encoding> </data>
The downlink arrows on both sides represents the data being sent to smartphone and central hub apps respectively. Each app subscribes from the events and updates of the other. Central Hub metrics will be used by the mobile app for display, while the mobile app data will be used to determine the carbon footprint of the vehicle and counted against the budget.
References:
http://blueskymodel.org/kilowatt-hour