Re: Adafruit_SGP30 repository
by delsan on Fri Jan 05, 2018 3:29 pm
Hi everyone,
Happy new year.
In continuation of extracting data from the SGP30 using an Arduino Uno, I purchased a couple of Logic Level converter from digikey:
https://www.digikey.ie/products/en?keyw ... 0converterDespite connecting the SGP30 SDA and SCL pins through the level converter, on running the Adafruit_SGP30 sample code, I am still getting "Sensor not found"
The Adafruit_SGP30 sample code is below:
- Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include "Adafruit_SGP30.h"
#define SGP30_ADDR 0x58
Adafruit_SGP30 sgp;
void setup() {
Serial.begin(115200);
Serial.println("SGP30 test");
Wire.begin();
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);
}
void loop() {
sgp.IAQmeasure();
Serial.print("TVOC "); Serial.print(sgp.TVOC); Serial.print("\t");
Serial.print("eCO2 "); Serial.println(sgp.eCO2);
delay(1000);
}
Appreciate your assistance.
Last edited by
franklin97355 on Fri Jan 05, 2018 9:14 pm, edited 1 time in total.
Reason: Please use code tags when posting code or logs to the forums. It preserves formatting and makes it easier for everyone to read the code. Click the code button above the reply box and past your code between the tags created.