Changing I2C Address of Sensors

The register contains the 8-bit version of the address so:
Wire.write( 0x50 << 1); // new I2C address

How much current does the airflow sensor draw? If it's under 40 mA you can power it from an Arduino output pin. That would allow you to cycle the power (turn it off and on again). Then you can not only set a new address but test if it is working at the new address after the required power cycle.

If 'multiple' means some number above about 3, you might want to have your sketch get the desired addresses from a table or from Serial input. That way you don't have to edit and re-upload the sketch for each address you want to program.

1 Like