AWS Partner Network (APN) Blog

Building Carbon Accounting Solutions with TensorIoT on AWS

By Nicholas Burden, Wan Ping Chua, Adom Taylor and Herman Liu – TensorIoT
By Aditi Suresh and Edmund Chute – AWS

TensorIoT-AWS-Partners-2022
TensorIoT
Connect with TensorIoT-2

Carbon accounting refers to the method of identifying, quantifying, and reporting the carbon footprint from various sources of greenhouse gas (GHG) emissions associated with an organization’s operations. These emissions include direct emissions from onsite activities (Scope 1), indirect emissions from purchased energy (Scope 2), and emissions from the value chain, including suppliers and customers (Scope 3).

Organizations are under increasing pressure to report and reduce their carbon footprint due to mounting concerns from regulators, investors, and consumers. Chief Sustainability Officers (CSOs) and their teams often face challenges in gathering and analyzing the necessary data for accurate carbon footprint measurement, company-wide reporting, and decarbonization planning to meet sustainability targets.

The resource burden of data capture, analysis, and reporting can result in low accuracy of carbon footprint measurement and lack of actionable insights for decarbonization. This is where TensorIoT, with its proven expertise in sustainability and technology, steps in to make a difference.

As an AWS Specialization Partner and 2022 AWS Sustainability Partner of the Year for North America, TensorIoT is at the forefront of integrating sustainability solutions into the digital landscape. Its team of experts specializes in developing and implementing cutting-edge tools to help businesses tackle their sustainability challenges, with a focus on carbon accounting and decarbonization.

By leveraging the Guidance for Carbon Accounting on AWS, TensorIoT enables organizations to accelerate the creation of an automated carbon footprint measurement system. This reduces reporting time and increases data accuracy, delivering critical and actionable insights for sustainability teams.

Unlocking the Power of Carbon Accounting Solutions on AWS

The Guidance for Carbon Accounting on AWS is built upon the Guidance for Sustainability Insights Framework on AWS, which provides a set of well-architected technical accelerators for the carbon footprint measurement application.

The guidance provides the following advantages:

  • Adaptability: Offers the flexibility to manage emission factors from multiple sources and establish or adapt calculations in response to evolving methods and standards.
  • Transparency and auditability: All data sources are versioned, with calculation inputs and outputs logged. This helps with the traceability and repeatability of calculations.
  • Data security and integrity: Adheres to security best practices, including least privilege permissions, data encryption, and secure key management.
  • Efficiency and accuracy: By automating data collection and calculation, it reduces the burden of manual data handling and lowers the risk of human errors.

Carbon Footprint Measurement Application for Scope 2 Emissions

TensorIoT has leveraged the Guidance for Carbon Accounting on AWS to create a carbon footprint measurement application focused on Scope 2 emissions from electricity consumption. Designed for Sustainability Managers and Facility Managers, this application enables users to track and compare Scope 2 emissions from electricity consumption across their portfolio of facilities in the United States.

Users input the facility zip code and electricity consumption (in kWh) or facility square footage, and the application calculates the resulting Scope 2 emissions per facility based on the electricity grid mix of the region.

For this example walkthrough, emission factors and building consumption data are sourced from the U.S. Environmental Protection Agency (EPA) Emissions & Generation Resource Integrated Database (eGRID) and the U.S. Energy Information Administration (EIA) Commercial Buildings Energy Consumption Survey.

In the next section, we provide a technical walkthrough of the solution deployment and setup process, showcasing how TensorIoT experts can help a customer to build their own carbon accounting solution on AWS.

Technical Walkthrough

Using the below steps, you’ll deploy a React-based application that will use the Guidance for Carbon Accounting on AWS to help calculate the Scope 2 carbon footprint of facilities from electricity consumption.

You will deploy the solution via AWS Cloud Development Kit (AWS CDK) utilizing a single-tenant and single-environment deployment. Due to the multiple build steps and tooling requirements to build and deploy the solution, the solution creates an AWS CodeBuild project. You can also deploy the solution manually by following the deployment walkthrough.

Prerequisites

  • AWS account
  • Knowledge of AWS CDK
  • Familiarity with AWS services and Guidance for Sustainability Insights Framework on AWS
  • Administrative permissions to run CDK bootstrap and CDK deploy

Setting up the Environment

  1. Install Node.
  2. Install AWS Command Line Interface (CLI).
  3. Install AWS CDK.
  4. Configure AWS profile with correct account information.
  5. Clone repository.
  6. Open Terminal in repository root folder.
  7. Run npm install.
  8. Run cdk bootstrap aws://ACCOUNT-NUMBER/REGION
  9. Modify config.json to setup environment:
    • Account – AWS account number.
    • Region – AWS deployment region.
    • TenantID – String to use the as Sustainability Insights Framework tenant ID.
    • adminEmail – Email used to create admin user and email password.
    • environmentName – Name of deployment environment.
  10. Run cdk deploy SifCodebuildStack [–profile=”PROFILE_NAME”] which will create a CodeBuild project called “SifBuildDeploy” that needs to be run once to build and deploy the solution framework.
  11. Run aws codebuild start-build –project-name SifBuildDeploy to run the build project.
  12. You’ll receive your admin password via email. This will be needed to access the application as well as to configure the solution deployment.
  13. Once the solution framework is deployed, run the script to set its initial configuration.
  14. Run cdk deploy CarbonAccountingPortalStack [–profile=”PROFILE_NAME”]

The scripts run in Step 14 are used to set up our reference tables, calculation logic, and pipeline within the solution framework. We create lookup tables, calculations, and a pipeline which is run from the React app.

Methodology

For this walkthrough, you’ll use GHG Protocol Scope 2 Guidance to calculate location-based Scope 2 emissions, determined by averaged emissions data within a specific geographic boundary and timeframe. Precise activity data comes from metered electricity consumption or utility bills measured in MWh or kWh units. In the absence of such data, you can estimate electricity consumption based on average data for specific facility types. To assign the correct emission factor, you need to collect facility zip codes.

Reference datasets and emission factors were identified to support this use case. The reference dataset identified from the EIA Commercial Buildings Energy Consumption Survey 2018 provides the estimated annual facility electricity consumption in kilowatt-hours per square foot, per year.

This reference dataset (see Figure 1) is stored as “BuildingToConsumption” and was imported from the setup script using the following call:

{
   "name": "BuildingToConsumption",
   "description": "Lookup table for building type to consumption",
   "datasetHeaders": [
       "BuildingActivity",
       "BuildingConsumptionKwhPerSqFtPerYear"
   ],
   "data": "BuildingActivity,BuildingConsumptionKwhPerSqFtPerYear\nEducation,9.1\nFood service,40.575\nHealth care,23.375\nInpatient,28.1\nOutpatient,17.5\nLodging,14.225\nMercantile,16.375\nRetail (other than mall),13.075\nEnclosed and strip malls,19.275\nOffice,13.425\nPublic assembly,11.425\nReligious worship,4.725\nService,7.4\nWarehouse and storage,5.8\nOther,31.55"
}

TensorIoT-Sustainability-Guidance-1

Figure 1 – Snapshot of “BuildingToConsumption” reference dataset.

Similar steps are applied to import additional reference datasets required for the calculations. The full JSON file can be found in the GitHub repository. A reference dataset named “BuildingUnitConversion” must be created to allow users to input square footage in either square feet (sqft) or square meters (sqm) by facilitating unit conversions.

TensorIoT-Sustainability-Guidance-2

Figure 2 – Snapshot of  “BuildingUnitConversion” reference dataset.

Similarly, users may provide electricity consumption in kilowatt-hours, megawatt-hours, or a Megajoules (MJ), so a reference dataset needs to be created to enable unit conversions. This reference dataset is stored as “ElectricityUnitConversion.”

TensorIoT-Sustainability-Guidance-3

Figure 3 – Snapshot of  “ElectricityUnitConversion” reference dataset.

The U.S. electricity grid emission factors are broken down into regions known as eGRID subregions. The correct eGRID subregion to assign is based on the U.S. postal code of the facility, as provided by the EPA Emissions & Generation Resource Integrated Database 2023. This reference dataset is stored as “ZipCodeToEfactor.”

TensorIoT-Sustainability-Guidance-4

Figure 4 – Snapshot of  “ZipCodeToEfactor” reference dataset.

In addition to the reference datasets previously mentioned, it’s necessary to incorporate the EPA 2023 Total Output Emission Rate emission factors from the EPA eGRID database of 2023. To do this, the solution imports the emission factor using the following call, which generates a single row per emission factor, complemented by the specified column headers.

The following is sent for each factor:

{
   "name": "InsertName",
   "description": "Insert Description",
   "impacts": {
     "CO2eq": {
       "name": "KG C02 eq per MWh",
       "attributes": { "outUnit": "KG C02 eq per MWh" },
       "components": {
         "co2": { "key": "co2", "value": 1000, "type": "pollutant" },
         "ch4": { "key": "ch4", "value": 1000, "type": "pollutant" },
         "no2": { "key": "no2", "value": 1000, "type": "pollutant" }
       }
     }
   }
 }

Here, Impact_Factor_Name is the name of the impact factor; in this case, the eGRID subregion acronym. Impact_unit is the emission factor unit, while Ref_unit stands for the activity data’s reference unit, which is electricity consumption in this case.

Finally, Total Co2e, co2_co2e, ch4_co2e, and n2o_co2e convey the emission factors as total carbon-dioxide equivalent, as well as the carbon dioxide, methane, and nitrous oxide components (expressed in co2-equivalent).

Calculations

There are two use cases for the calculations:

  • When electricity consumption is provided: Calculate the corresponding carbon emissions using the electricity consumption and the facility zip code.
  • When electricity consumption is not provided: Estimate electricity consumption given a facility type and facility square footage. Once estimated, use the facility zip code to calculate the estimated carbon emissions.

TensorIoT-Sustainability-Guidance-5

Figure 5 – User input form for facility-level electricity data collection.

First, calculate the building area using:

LOOKUP(:BuildingUnit,'BuildingUnitConversion','BuildingAreaUnit','BuildingAreaConversionToSqFt',group='/')*:building_area

This LOOKUP function fetches the conversion factor from “BuildingAreaConversionToSqFt” and multiplies it with the “building_area.”

Second, find the energy consumption per square foot using:

LOOKUP(:BuildingActivity,'BuildingToConsumption','BuildingActivity','BuildingConsumptionKwhPerSqFtPerYear',group='/')*:square_footage

This function retrieves the energy consumption based on the user’s input and multiplies it by the square footage to get the total energy consumption.

Convert this energy consumption to MWh using:

LOOKUP(:ElectricityUnit,'ElectricityUnitConversion','ElectricityUnit','ElectricityConversionToMwh',group='/')*:electrictity_value

Here, a lookup function converts electricity units to MWh by multiplying the conversion factor with the “electricity_value.”

Finally, calculate emissions from total electricity consumption:

IMPACT(LOOKUP(:zipCode,'ZipCodeToEfactor','ZipCode','EgridSubRegion',group='/'),'KG C02 eq per MWh',:impactType)*:electricityMwh

This formula identifies the correct eGRID region, then uses the IMPACT function to return a specific emission factor. This is multiplied by the total electricity consumption to compute the emissions.

Pipeline

This pipeline calculates carbon emissions from the building activity, including estimations for location-based Scope 2 emissions from electricity. An “if” clause chooses between calculating electricity consumption from building area or using user-provided electricity usage data. The complete pipeline is accessible in the GitHub repository.

Results

Users can calculate emissions for up to five facilities at once. After selecting Calculate, results are displayed both individually and as a total for monthly comparison across facilities.

TensorIoT-Sustainability-Guidance-6

Figure 6 – Emissions (kg CO2e) display by month and by facility.

Users can also download the results in .csv format.

TensorIoT-Sustainability-Guidance-7

Figure 7 – Sample outputs in .csv format.

Conclusion

In this post, we walked through a step-by-step technical solution deploying a React-based web application using the Guidance for Carbon Accounting on AWS that demonstrated the power of AWS for helping to calculate the Scope 2 carbon footprint of facilities.

By utilizing AWS services, TensorIoT has successfully delivered a carbon accounting application on AWS by automating the intricate calculations as well as tailoring the application to suite the unique requirements of your organization.

If you’re looking to utilize AWS to reach your sustainability goals, TensorIoT collaborates with businesses of all scales to plan and establish a tailored sustainability solution that tackles your unique challenges and ambitions. Reach out to TensorIoT for guidance on your journey towards a more sustainable future, one step at a time.

You can learn more about TensorIoT in AWS Marketplace.

.
TensorIoT-APN-Blog-Connect-2023
.


TensorIoT – AWS Partner Spotlight

TensorIoT is an AWS Specialization Partner that enables digital transformation and greater sustainability for customers through IoT, AI/ML, data and analytics, and app modernization.

Contact TensorIoT | Partner Overview | AWS Marketplace | Case Studies