sparkfun / SparkFun_DataLogger

Documentation and firmware for the SparkFun DataLogger IoT line of products.
https://docs.sparkfun.com/SparkFun_DataLogger/
18 stars 4 forks source link

Investigate providing alternate I2C addresses for the ACS37800 Power Meter #11

Closed PaulZC closed 9 months ago

PaulZC commented 9 months ago

Based on this Forum post: https://forum.sparkfun.com/viewtopic.php?p=245235#p245235

Investigate if it is possible to add alternate addresses for the ACS37800. Remembering that it will likely clash with the SCD30 and SCD40.

gigapod commented 9 months ago

@PaulZC What addresses do we want to add to this driver?

PaulZC commented 9 months ago

You can change the I2C address by pulling the two IO pins to different voltage levels. Each IO pin supports four states:

image

I think we should go with 0x60 - 0x63, which are the possible addresses for the four possible states of one IO pin when the other is 0v:

image

These will overlap with the SCD30 and SCD40 but those have exact connectedConfidence.

I think attempting to implement all 16 possible states would be unwise. You can also set the address in EEPROM to any valid address. It would be very very unwise to attempt to support all 112!

gigapod commented 9 months ago

Adding these now ... will check in, in a few minutes ...

gigapod commented 9 months ago

This is fixed/added to the system and will be in the next update along with an improved I2C auto load algorithm which will greatly minimize chances of address conflicts during device detection.