SGP30 for Flora

I am currently working on a workshop to integrate an air quality sensor into a wearable for my students. I am having no luck integrating the sgp30 into my flora project. The serial monitor doesn't seem to be picking anything up. Any Suggestions?

jahrndt

Posts: 12
Joined: Sun Sep 02, 2018 2:45 pm

Re: SGP30 for Flora

Post your code and show us how you have things connected so we can help.

franklin97355

Posts: 21486
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: SGP30 for Flora

Here is my Code it is just the example code for the SGP30 sensor. I have hooked up the flora exactly like the diagram.

Code: Select all | TOGGLE FULL SIZE
`#include <Wire.h>#include "Adafruit_SGP30.h"Adafruit_SGP30 sgp;/* return absolute humidity [mg/m^3] with approximation formula* @param temperature [°C]* @param humidity [%RH]*/uint32_t getAbsoluteHumidity(float temperature, float humidity) {    // approximation formula from Sensirion SGP30 Driver Integration chapter 3.15    const float absoluteHumidity = 216.7f * ((humidity / 100.0f) * 6.112f * exp((17.62f * temperature) / (243.12f + temperature)) / (273.15f + temperature)); // [g/m^3]    const uint32_t absoluteHumidityScaled = static_cast<uint32_t>(1000.0f * absoluteHumidity); // [mg/m^3]    return absoluteHumidityScaled;}void setup() {  Serial.begin(9600);  Serial.println("SGP30 test");  if (! sgp.begin()){    Serial.println("Sensor not found :(");    while (1);  }  Serial.print("Found SGP30 serial #");  Serial.print(sgp.serialnumber[0], HEX);  Serial.print(sgp.serialnumber[1], HEX);  Serial.println(sgp.serialnumber[2], HEX);  // If you have a baseline measurement from before you can assign it to start, to 'self-calibrate'  //sgp.setIAQBaseline(0x8E68, 0x8F41);  // Will vary for each sensor!}int counter = 0;void loop() {  // If you have a temperature / humidity sensor, you can set the absolute humidity to enable the humditiy compensation for the air quality signals  //float temperature = 22.1; // [°C]  //float humidity = 45.2; // [%RH]  //sgp.setHumidity(getAbsoluteHumidity(temperature, humidity));  if (! sgp.IAQmeasure()) {    Serial.println("Measurement failed");    return;  }  Serial.print("TVOC "); Serial.print(sgp.TVOC); Serial.print(" ppb\t");  Serial.print("eCO2 "); Serial.print(sgp.eCO2); Serial.println(" ppm");  delay(1000);  counter++;  if (counter == 30) {    counter = 0;    uint16_t TVOC_base, eCO2_base;    if (! sgp.getIAQBaseline(&eCO2_base, &TVOC_base)) {      Serial.println("Failed to get baseline readings");      return;    }    Serial.print("****Baseline values: eCO2: 0x"); Serial.print(eCO2_base, HEX);    Serial.print(" & TVOC: 0x"); Serial.println(TVOC_base, HEX);  }}`

jahrndt

Posts: 12
Joined: Sun Sep 02, 2018 2:45 pm

Re: SGP30 for Flora

I am trying to create a wearable C02 sensor with the Flora and the SGP30 sensor for a series of workshops. Any suggestions? right now if I hook up them both at the same time the SGP30 stops sensing and shuts down. Any help would be appreciated.
Attachments
Screen Shot 2019-05-27 at 7.42.30 PM.png (347.28 KiB) Viewed 917 times

jahrndt

Posts: 12
Joined: Sun Sep 02, 2018 2:45 pm