I have a electric go cart with a mechanical relay breaking the high side to turn the motor on and off. i have an Arduino measuring current, voltage and some other things. The Arduino writes data to an SD card and wireless. All works perfectly. Except when I connect a 0.96" OLED display. The display works as expected until the motor is turned off--then the Arduino locks up (hence so does the display). Generally i can get the system to fail after 3-5 turn on and turn off's of the motor. My wires to the display are 18 gage solid conductor and around 7 feet long.
I've tried
pull up resistors for SLC and SDA - no help
pull down resistors for SLC and SDA - no help
caps of different values between SLC and SDA and ground - no help
caps of different values between SLC and SDA and +5 VDC - no help
but...
A current limiting resistor 470K on both SDA and SCL, the unit will not lock up until 30-40 pulses of the on/off switch. But I still don't trust the system to work. I'm guessing some electrical pulse is getting sent through the steel car frame and feed into the display wires--i don't know and I really don't know how to diagnose this.
Now for my question
are there different values for the current limiting resistors I should use?
should the resistors be connected near the arduino or the display
any other components needed caps
how abut an optical isolator?? would it go near the arduino or display?
Any other thoughts?
Anyone live in Northern Alabama and would be willing to take a look?
tried pullups on SDA and SCL, used 10K though--no difference
I have an Arduino UNO
no flyback, not sure why the need since i'm breaking the high side. If I were going to use a diode any recommendations on what one? motor brush type and is 24 VDC, and draws around 20 amps.
tried pullups on SDA and SCL, used 10K though--no difference
I have an Arduino UNO
no flyback, not sure why the need since i'm breaking the high side.
Twisted pair, the way I described, works over that distance.
Always keep clock and data well separated (different pairs).
The Uno has no physical pull up resistors. The internal (weak) ones are used.
The display might have 4k7 pull ups. Not sure.
~1k7 is the minimum combined value for standard I2C.
As said, add two 3k3 resistors to be on the safe side.
No difference if you switch high-side or low-side. The motor will kick back if you switch it off.
That could generate a spike of several hundred volt that has to go somewhere.
The Arduino wiring could pick up that hash.
A 20A schottky diode could solve your problem. Plenty of them in old computer supplies.
KrisKasprzak:
maybe a zenor on both SDA and SCL?
5.1volt zeners are sometimes used on I2C lines.
But I have learned that you don't start fixing things untill you know the problem.
If you do, you could introduce a second problem.
Leo..