Nuisance fault messages

Hi -

We have an application where 32 sensors data from Arduino Nano is communicated with a Arduino Mega on i2c, we are experiencing spurious(false) alarm, tried our best to check on the bugs, any help on this would be greatly appreciated.

updateslave-1.ino (1.39 KB)

updatemaster-1.ino (25 KB)

are you receiving duplicate messages or garbage messages?
if duplicate messages you could sequence number them so you can discard duplicates - this would allow you to also check for lost messages
if garbage messages add a checksum to the message frame so you can discard in case of error

rockwellramesha:
Hi -

We have an application where 32 sensors data from Arduino Nano is communicated with a Arduino Mega on i2c, we are experiencing spurious(false) alarm, tried our best to check on the bugs, any help on this would be greatly appreciated.

Please explain ................ what you mean by 'false alarm'. And 'nuisance fault messages'.

We are getting spurious - messages ie., without any updates at sensor - at master we receive change of state(false alarm)

It sounds like there is noise on the I2C line. AFAIK I2C is a very short range system. How long is your connection?

Serial is better for longer connections, and (I believe) RS485 for even longer distances.

Would it increase reliability if your nano sends a message at regular intervals (perhaps 5 or 10 per second) even if the data does not change. That would allow the Mega to be aware of missing (or extra) messages.

...R

could you give more details of the events which lead up to the faulty messages?
e.g. if no events at all are reported at the sensors do you receive messages? does it happen after a certain time? if you only have one sensor attached do you receive faulty messages or after a certain number of sensors are attached?

without any events and no status change at sensors - fault shows - it is random - do not have specific time period - more often the fault comes from sensor 3 and 12, if we isolate those sensors, fault shifts to 4 and 13, isolate 4 and 13 then it shifts to 5 and 14.

i2c distance between nodes(arduino) is 50mm and the cables are looped, from the last sensor to the Master is approx.2 meters.

have you tried reducing the clock speed?
also have a look at the I2C lines with an oscilloscope? are the I2C signals clean ? any noise?
also check the pull up values - have found in the past that the wrong pull up values can cause problems

Thanks! will chk with pull up resistors and reducing the clock speed!