Gregory MatosAugust BehmEros Vazquez

Photon Athletic Performance Sensor

These sensors aim to measure temperature, humidity, and CO2 levels in two separate areas to determine which is better for athletic activity.

IntermediateWork in progress660
Photon Athletic Performance Sensor

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
Jumper wires (generic)
Jumper wires (generic)
MQ135 Gas Sensor
DHT22 Temperature Sensor
DHT22 Temperature Sensor
Resistor 10k ohm
Resistor 10k ohm

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Google Sheets
Google Sheets

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)


Read more


Casing File

*This file can only be edited in Adobe Illustrator.
*Be sure cutter settings are set according to the material.
Use this to cut out a box casing ( from wood) in a laser cutter.


Sensor Collection Code

Use this code in Particle build, then upload it to a sensor. Be sure to have both( or one) of your sensors properly wired.
#include <Adafruit_DHT.h>

#define DHTPIN 4            // what pin we're connected to
#define DHTTYPE DHT22       // DHT 22 (AM2302)


double hum;                 // current hum
double temp;                // current temp
double co2;                 // current co2 lvl

void setup() {
    pinMode(A0, INPUT);
    pinMode(DHTPIN, INPUT);
    Particle.variable("hum", hum);
    Particle.variable("temp", temp);
    Particle.variable("co2", co2);

void loop() {    
    double checkHum = dht.getHumidity();
    double checkTemp = dht.getTempFarenheit();
    double checkCo2 = analogRead(A0);
    if (checkHum > 0 && checkHum < 100)
        hum = checkHum;
    if (checkTemp > 32 && checkTemp < 100)
        temp = checkTemp;
    Serial.println("Temp: " + String(checkTemp));
    Serial.println("Hum: " + String(checkHum));
    Serial.println("Co2: " + String(checkCo2));

Spreadsheet Recording Code

Use this in the code of a google spreadsheet.
function collectCurrent() {
  "use strict";
    //Replace the device ID below with your Photon's unique device ID
    var deviceID = "200029000347343233323032";
    //Replace the access token below with your Photon's unique access token
    var accessToken = "867739e105b7366392f823d16060d57d6a1ab90d";
    //Replace the value below with you group ID
    var groupID = 404;
    //Replace the room number below with location of the Photon
    var room = 134;
    var sheet = SpreadsheetApp.getActiveSheet();

    // Fetch the value of the testValue variable from the Spark Cloud API.
    // The name of your variable in Particle's cloud must match the variable in the URL below.
    var response = UrlFetchApp.fetch("" + deviceID + "/hum?access_token=" + accessToken);

    // Parse the JSON and extract the testValue.
    var jsonResponse = JSON.parse(response.getContentText());
    var hum = jsonResponse.result;

    response = UrlFetchApp.fetch("" + deviceID + "/temp?access_token=" + accessToken);
    jsonResponse = JSON.parse(response.getContentText());
    var temp = jsonResponse.result;    
    response = UrlFetchApp.fetch("" + deviceID + "/co2?access_token=" + accessToken);
    jsonResponse = JSON.parse(response.getContentText());
    var co2 = jsonResponse.result;  

    // Create a timestamp.
    var timeStamp = new Date();

    // Append the timestamp and the temperature to the sheet.
    sheet.appendRow([timeStamp, groupID, room, temp, hum, co2]);
  } catch (e)
    // If something doesn't work, log it, then rethrow the error.
	Logger.log( + ": " + e.message);
	throw (e);


Gregory Matos

Gregory Matos

1 project • 1 follower
August Behm

August Behm

1 project • 1 follower
Eros Vazquez

Eros Vazquez

1 project • 2 followers


Add projectSign up / Login