Home › Forums › Mayfly Data Logger › Changing I2C address of RTC
- This topic has 2 replies, 3 voices, and was last updated 2020-08-07 at 11:23 AM by Shannon Hicks.
Viewing 2 reply threads
-
AuthorPosts
-
-
2020-08-07 at 12:28 AM #14455Hello. I’m currently working on trying to take measurements from a CO2 sensor (k30) using my Mayfly data logger (version 0.5b). The sensor is an analog and I’m using the I2C port connectedHello. I’m currently working on trying to take measurements from a CO2 sensor (k30) using my Mayfly data logger (version 0.5b). The sensor is an analog and I’m using the I2C port connected to the SDA and SCL pins on the Mayfly.
The sensor comes preprogrammed with the hexadecimal address 0x68. After quite a bit of testing to attempt to get the sensor working, I realized that the RTC on the Mayfly is an I2C chip with the hexadecimal address 0x68––the same as my sensor.
Obviously if I had another microcontroller, I would rewrite the address for my CO2 sensor. However, I only have a Mayfly on hand, so it’s impossible for me to change the address of the sensor while the microcontroller can’t distinguish between the sensor and the RTC.
My question is whether or not it’s at all possible to change the RTC chip address using I2C commands. Any advice is greatly appreciated!
-
2020-08-07 at 10:15 AM #14457The address of the DS3231 isn’t changeable – it’s permanently set when the chip is manufactured. Is there any other way your sensor can communicate? Does it have a physical addreThe address of the DS3231 isn’t changeable – it’s permanently set when the chip is manufactured. Is there any other way your sensor can communicate? Does it have a physical addressing method? Many I2C sensors have an “addr” pin that you can set to be high or low to change the address. Can it communicate via SPI or UART so you can use one of those to change the address?
-
2020-08-07 at 11:23 AM #14459I just read through various manuals and datasheets for the K30 sensor, and it is technically possible to change the I2C address of the sensor, but it’s not easy so I wouldn’t suggest it.I just read through various manuals and datasheets for the K30 sensor, and it is technically possible to change the I2C address of the sensor, but it’s not easy so I wouldn’t suggest it. But the manual says the board also does serial UART output so you can just follow their example code for Arduino UART to modify it for working with the Mayfly’s correct pins and it should work. You’ll also want to power the board from the switched 5V output pin of the Mayfly since it needs 5v at 300ma to operate, which is a lot. If you run the board continuously, the aux supply regulator on the Mayfly will probably get a little warm and if you’re running this on a battery, it’ll drain pretty quickly. Is this going to be powered continuously by a benchtop supply or a battery?
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.