|
| 1 | +# MLX90641 I2C Address Change Utility |
| 2 | + |
| 3 | +This utility changes the I2C address of MLX90641 thermal sensor from default **0x33** to **0x35**. |
| 4 | + |
| 5 | +## ⚠️ Important Warnings |
| 6 | + |
| 7 | +1. **Only ONE MLX90641 sensor** should be connected to the I2C bus during this operation |
| 8 | +2. The address change is **permanent** (written to EEPROM) |
| 9 | +3. A **power cycle is required** after the address change for it to take effect |
| 10 | +4. Make sure no other devices are using address 0x35 on the I2C bus |
| 11 | + |
| 12 | +## Building the Utility |
| 13 | + |
| 14 | +```bash |
| 15 | +# Build using the special configuration |
| 16 | +pio run -c platformio_change_addr.ini |
| 17 | + |
| 18 | +# Upload to device |
| 19 | +pio run -c platformio_change_addr.ini -t upload |
| 20 | +``` |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +1. **Connect only ONE MLX90641 sensor** to the AMSKY01 board |
| 25 | +2. Upload and run the address change utility |
| 26 | +3. Open serial monitor at 115200 baud |
| 27 | +4. The program will: |
| 28 | + - Check for sensor at old address (0x33) |
| 29 | + - Check for sensor at new address (0x35) |
| 30 | + - Write new address to EEPROM using broadcast (0x00) |
| 31 | + - Verify the write |
| 32 | +5. **Power cycle the sensor** (remove and reconnect power) |
| 33 | +6. The sensor will now respond at address **0x35** |
| 34 | + |
| 35 | +## Expected Output |
| 36 | + |
| 37 | +``` |
| 38 | +======================================== |
| 39 | +MLX90641 I2C Address Change Utility |
| 40 | +======================================== |
| 41 | +
|
| 42 | +WARNING: Only ONE MLX90641 sensor should be on the I2C bus! |
| 43 | +
|
| 44 | +I2C bus initialized |
| 45 | +
|
| 46 | +Checking for sensor at address 0x33... FOUND |
| 47 | +Reading current EEPROM address register... 0x33 |
| 48 | +Checking for sensor at address 0x35... NOT FOUND |
| 49 | +
|
| 50 | +======================================== |
| 51 | +Starting address change procedure |
| 52 | +======================================== |
| 53 | +
|
| 54 | +Writing new address 0x35 to EEPROM... |
| 55 | + Broadcasting to address 0x0, register 0x240F, data 0x35 |
| 56 | + Write completed |
| 57 | +SUCCESS: Address written to EEPROM |
| 58 | +
|
| 59 | +======================================== |
| 60 | +IMPORTANT: Power cycle the sensor now! |
| 61 | +======================================== |
| 62 | +
|
| 63 | +After power cycle, the sensor will respond at address 0x35 |
| 64 | +``` |
| 65 | + |
| 66 | +## LED Indicators |
| 67 | + |
| 68 | +- **3 blinks every 2 seconds**: Success - power cycle the sensor |
| 69 | +- **10 rapid blinks every second**: Error - check connections |
| 70 | + |
| 71 | +## Verification |
| 72 | + |
| 73 | +After power cycle, you can verify the address change: |
| 74 | + |
| 75 | +```bash |
| 76 | +# Scan I2C bus |
| 77 | +i2cdetect -y 1 |
| 78 | + |
| 79 | +# Or use the main firmware - it should detect the sensor at 0x35 |
| 80 | +``` |
| 81 | + |
| 82 | +## Reverting to Original Address |
| 83 | + |
| 84 | +To change back to 0x33, modify `change_address_main.cpp`: |
| 85 | + |
| 86 | +```cpp |
| 87 | +#define MLX90641_OLD_ADDR 0x35 // Current address |
| 88 | +#define MLX90641_NEW_ADDR 0x33 // Target address |
| 89 | +``` |
| 90 | +
|
| 91 | +Then rebuild and run the utility again. |
| 92 | +
|
| 93 | +## Technical Details |
| 94 | +
|
| 95 | +- **EEPROM Register**: 0x240F |
| 96 | +- **Data Format**: Lower 7 bits contain the I2C address |
| 97 | +- **Broadcast Address**: 0x00 (responds to all devices) |
| 98 | +- **Write Time**: ~50ms for EEPROM write completion |
| 99 | +- **Activation**: Requires power cycle |
| 100 | +
|
| 101 | +## Troubleshooting |
| 102 | +
|
| 103 | +### Sensor not found at 0x33 |
| 104 | +- Check I2C connections (SDA=GPIO18, SCL=GPIO19) |
| 105 | +- Verify sensor power supply |
| 106 | +- Check if sensor address was already changed |
| 107 | +
|
| 108 | +### Write verification failed |
| 109 | +- This is usually OK - verification can fail when using broadcast address |
| 110 | +- Proceed with power cycle if write succeeded |
| 111 | +
|
| 112 | +### Sensor still responds at old address after power cycle |
| 113 | +- EEPROM write might have failed |
| 114 | +- Try running the utility again |
| 115 | +- Check for I2C bus errors in serial output |
| 116 | +
|
| 117 | +## References |
| 118 | +
|
| 119 | +- MLX90641 Datasheet: Section on I2C address configuration |
| 120 | +- EEPROM address register: 0x240F |
| 121 | +- Default factory address: 0x33 |
0 commit comments