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 ?
SGP40 default address change
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88136
- Joined: Sat Feb 07, 2009 10:11 am
Re: SGP40 default address change
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
- abezak
- Posts: 10
- Joined: Tue Apr 11, 2023 4:02 pm
Re: SGP40 default address change
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?
- adafruit_support_bill
- Posts: 88136
- Joined: Sat Feb 07, 2009 10:11 am
Re: SGP40 default address change
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.
- abezak
- Posts: 10
- Joined: Tue Apr 11, 2023 4:02 pm
Re: SGP40 default address change
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?
- adafruit_support_bill
- Posts: 88136
- Joined: Sat Feb 07, 2009 10:11 am
Re: SGP40 default address change
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
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
Please be positive and constructive with your questions and comments.