Random i2c errors, need help to stomp them out please!

SparksAlot:
I put in one decoupling capacitor and the 1.5k resistors. It did seem to help, but still get freezing. Just after longer periods :~

I put in the decoupling capacitor before the RTC but after the pull up resistors. Can I put another capacitor before the pull up resistors? That would seem to give a clean signal to the i2c clock and data lines maybe?

Can I put as many capacitors as I like all over? Or are there problems in doing so?

To ask again, would putting decoupling capacitors on clock and gnd and data and gnd between each light do anything? Or would that destroy the signal instead of stabilize it?

Just to reiterate -- capacitance is the probable problem, not the solution.

The reason why you want to put capacitance on the power lines is that to smooth them out. Nice steady power is good. Any spikes or changes are harmful noise -- you want to get rid of them.

With your signal, on the other hand, you don't want to smooth out the transitions. The transitions are not noise; they are signal. Capacitance will smooth the transitions and harm your signal. In fact, your 5 meters of ribbon cable probably exceeds the 400 pF maximum capacitance that the i2c standard permits. So although the device works, there are occasional problems.

The problem seems likely to be either noise or sloppy signal, or both. From the fact that your device freezes every now and then, I suspect noise. Ribbon cables are not good for noise. Using a Cat5 cable with signal and ground wires in twisted pairs will help combat noise.

But the rather long, rather high-capacitance ribbon cable seems to point to sloppy signal instead of noise. If you have access to an oscilloscope, that might tell the tale. It would be interesting to see if you have a squarish type signal or more of a sawtooth.

As people have mentioned, a buffer might help. Sorry that I don't know of any i2c buffer breakout boards. Good luck with the project.