128x64 oled display i2c connection

Hi to all
i am using a small oled 128x64 display with i2c connection to display(measure) some sensors in my car engine.

the distance between the arduino board and the display is almost 5m (16 feet ) long (cable length)

i am using a 2k pull up resistors in my DIY pcb board (where is the arduino) and a 3.3k pull up resistors in the board where i placed the oled screen .
(with a single row 10k pull up resistors i could make the display show anything.)

My problem is that if i have the car in stand by mode (engine doesn't run) the oled display works fine for a long time.
The same when i start the engine and working at idle, the display works fine

when i rev my engine some times then my oled screen freezes ... doesn't refresh any data (arduino working). It seems that for some reason loosing the i2c connection.

(after a small experiment i find out that when you cut the connection in only one of the two i2c cables (sda or scl) and reconnect it then the screen works again fine.. but when i cut out both SDA,SCL and reconnect them just only then the oled screen staying freezed )

if i reset arduino then the display works fine again (until i rev some times my engine again)

Should i try a bigger value of resistors in my oled board ? or is something else ? any suggestions?

is somewhere else the problem and not in my ic2's pull-up resistors value ?

thanks

Allow me to add some more information about that problem .

if the oled display works ok and after some time freezes then if i reset the Arduino or cut off the power and start again the display never gets active .

i remove the arduino and the display and test them (after the above weird problem) with a short cable but was the same... black screen

i tested the oled with an other arduino and it was working

the arduino i had on the pcb was working.. i could read the data in serial connection..

the only way to make it work again with the oled was to upload again the sketch..

after that the oled was working again

(i test it that more than 3 times... with the same results)

Doe you want a real solution or a bodge?

The real solution is to NOT have a long I2C cable. I2C is meant for small distances (like <10cm). Place the Arduino close and extend the sensor wires IF they allow. (Depends on the sensors you use and their signals.) If not, use two Arduino's with something like RS485 in between.

The bodge is to use lower value resistors on the I2C bus and to change the cable to a shielded one. For example a STP cable. Use a twisted pair per signal (twist each with GND) and connect the shield to GND only on the side with the power supply. And hope for the best :wink:

Thanks for the advice :slight_smile:
For the moment i will go with the bodge solution as i want to keep my project simple

if i see that i cant make it work as i want then i will go to a solution of 2 Arduino with Nrf24 to connect them or with a Bluetooth module

About the bodge solution ... i will buy a 6 Stp cable (3 pairs) and i will use one for power (+ , -) and the other two pairs one for SDA and the other for SCL but with in both pairs one of the cable will be grounded only to the pcb where is the arduino .

i guess i have to ground also the cable shield to the pcb.... should i grounded also and in the side of the oled screen ?

thanks again for the suggestions

Of the wire, connect all GND on both sides. Shield only on one side.

What do you mean by " should i grounded also and in the side of the oled screen "? If you mean, shield the oled then probably no. The cables are way more suspect of the noise entering then the oled itself.

And ow, there ARE long range I2C drivers but they are just not that common, especially in the hobby scene.

thanks again

yes i know about the i2c buffers.. i have some IC PHILIPS P82B715PN but for the moment i dont want to use them as i would have to design again my pcb and wait some time to get it..

so i will try the easy solution for the moment to see if i can get the results i want and if not i will think which other method will be best for my project

:slight_smile: :slight_smile: