Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Sgp30 gas sensor
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Sgp30 gas sensor

by oldblackcrow on Mon Aug 10, 2020 3:18 pm

Hello all.

I'm trying out the SGP30 gas sensor on the Itsybitsy nRF52840 Express. I have two Itsybitsys and the gas sensor does not work with the Arduino code.

I plug in my Arduino Uno, connect the gas sensor and it works beautifully.

Been trying everything... Checking wires, connections, baud rate, and even used the Vhi and 3v outputs on the Itsybitsys... But no luck.

It won't even state that the gas sensor is not found (in the serial monitor), as the Uno does. The mouse pointer does show a spinning circle about every second as if something is reading something, but aside from that... Nothin'.

Anyone have any ideas?

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by dastels on Mon Aug 10, 2020 3:23 pm

Can you share the output of building in Arduino?

Dave

dastels
 
Posts: 3519
Joined: Tue Oct 20, 2015 3:22 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 9:28 am

dastels wrote:Can you share the output of building in Arduino?

Dave


Didn't know exactly what you needed, so, I'm going to lay it all out...

arduino-gas-sensor-wiring.jpg
Arduino wiring - Red dots indicate connections
arduino-gas-sensor-wiring.jpg (152.64 KiB) Viewed 30 times

New Gas Sensor - Arduino.jpg
New Gas Sensor - Arduino.jpg (29.81 KiB) Viewed 30 times


ItsyBitsy-wiring002.jpg
ItsyBitsy-wiring002.jpg (121.57 KiB) Viewed 30 times

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 9:30 am

ItsyBitsy-wiring001.jpg
ItsyBitsy-wiring001.jpg (142.89 KiB) Viewed 30 times


White wire = VIN
Black = Ground
Blue = SCL
Green = SDA

This is the Serial Monitor:
New Gas Sensor - ItsyBitsy.jpg
New Gas Sensor - ItsyBitsy.jpg (16.64 KiB) Viewed 30 times

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 9:52 am

I know it states this on the website for the ItsyBitsy, "I2C Pins
I2C pins on the nRF52840 require external pullup resistors to function, which are not present on the Adafruit nRF52840 Feather by default. You will need to supply external pullups to use these. All Adafruit I2C breakouts have appropriate pullups on them already, so this normally won't be an issue for you."

However, I thought the gas sensor was an Adafruit model and thus included the pullups.

From the gas sensor pinout page:
"Data Pins
SCL - I2C clock pin, connect to your microcontrollers I2C clock line. Can use 3V or 5V logic, and has a 10K pullup to Vin
SDA - I2C data pin, connect to your microcontrollers I2C data line. Can use 3V or 5V logic, and has a 10K pullup to Vin"

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by dastels on Tue Aug 11, 2020 10:00 am

I was asking about the output from building the code in the Arduino app. Specifically, what board does it think you are using. You need to change that when you change physical boards.

The SGP30 breakout does include I2C pullups (see the schematic at https://cdn-learn.adafruit.com/assets/assets/000/050/060/original/adafruit_products_schem.png?1515783618). And FYI they are typically 10K resistors.

Dave

dastels
 
Posts: 3519
Joined: Tue Oct 20, 2015 3:22 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 10:22 am

dastels wrote:I was asking about the output from building the code in the Arduino app. Specifically, what board does it think you are using. You need to change that when you change physical boards.

The SGP30 breakout does include I2C pullups (see the schematic at https://cdn-learn.adafruit.com/assets/assets/000/050/060/original/adafruit_products_schem.png?1515783618). And FYI they are typically 10K resistors.

Dave


Ah, gotcha... For the Arduino board, I am using the Arduino Uno in the Boards Manager Com Port 5

For the ItsyBitsy, I'm using the ItsyBitsy nRF52840 Express in the Boards Manager Com port 11 or 14 (depending on how it feels).

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by dastels on Tue Aug 11, 2020 10:35 am

OK, that's always the first thing to check. But that sounds good.

Just looking over your photos... I see the problem. You didn't solder the header onto the sensor breakout. It's pretty much guaranteed not to work without doing so.

Dave

dastels
 
Posts: 3519
Joined: Tue Oct 20, 2015 3:22 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 10:40 am

Update... I just re-tested this on my older ItsyBitsy (same everything except for the actual wires) and it works fine... So, I'm guessing the first time I tried it on that board, I probably had a bad wire... however, the new board I just got this week is the one that is not working (using the same wires for the old ItsyBitsy and Arduino) and I probably have a bad board.

I have not soldered anything on the old one either... but I'll try soldering.

I was trying not to solder anything yet because this is going in a very small case and I wanted to test it before I make the final solders.

But maybe you have a work-a-round that would make the new board work or I'll have to exchange it for a new one.

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 10:51 am

dastels wrote:OK, that's always the first thing to check. But that sounds good.

Just looking over your photos... I see the problem. You didn't solder the header onto the sensor breakout. It's pretty much guaranteed not to work without doing so.

Dave

Well, you have proved correct... Sorry to bother you on this... New board works fine after I ensured all connections were firm.

I appreciate your time. According to my wife, I'm an idiot. :-)

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Re: Sgp30 gas sensor

by dastels on Tue Aug 11, 2020 11:40 am

Haha... have fun!

Dave

dastels
 
Posts: 3519
Joined: Tue Oct 20, 2015 3:22 pm

Re: Sgp30 gas sensor

by oldblackcrow on Tue Aug 11, 2020 5:27 pm

Got everything soldered together and it works perfectly. Thank you for your help!

Handheld Guts Working.jpg
Handheld Guts Working.jpg (170.84 KiB) Viewed 19 times

oldblackcrow
 
Posts: 46
Joined: Tue Jun 20, 2017 5:54 pm

Please be positive and constructive with your questions and comments.