SGP40 default address change

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
abezak
 
Posts: 10
Joined: Tue Apr 11, 2023 4:02 pm

SGP40 default address change

Post by abezak »

Hello everyone,
I’m looking to change the default address for the SGP40 because I’m using more than one which are communicating to a center Al agent. can I simply change the address using I2C Scanner ?

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: SGP40 default address change

Post by adafruit_support_bill »

The address of the SGP40 is fixed at 0x59. If you want to communicate with more than one, you can use an i2c multiplexer like the TCA9548A: https://www.adafruit.com/product/2717

User avatar
abezak
 
Posts: 10
Joined: Tue Apr 11, 2023 4:02 pm

Re: SGP40 default address change

Post by abezak »

Thank you that was helpful!. In my case I have about 5 static SGP40 sensors with their own ESP8266 module which are supposed to communicate with a central microcontroller, this multiplexer would still solve this same address problem ? Is there a better way of handling this issue?

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: SGP40 default address change

Post by adafruit_support_bill »

If you are using i2c for communication between the ESP8266 processors and the central processor, you should be able to make the central processor the i2c 'master' and assign different 'slave' addresses to each ESP8266.

User avatar
abezak
 
Posts: 10
Joined: Tue Apr 11, 2023 4:02 pm

Re: SGP40 default address change

Post by abezak »

Thank you that was really helpful. are the libraries compatible with ESP32 Feather Board https://www.adafruit.com/product/3619 or esp32 boards in general?

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: SGP40 default address change

Post by adafruit_support_bill »

If you are using a recent version of the ESP32 board package for Arduino, both master and slave operation are supported in Wire.h.

There is a "WireSlave.h" workaround for older versions. But your best bet is to make sure you are using the latest: https://forum.arduino.cc/t/i2c-from-esp ... ino/975652

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”