i2c freezes main program

I'm using Mega 2560 to control VariableFrequencyDrive for the motor. all it needs to be done is just turn it on & off.

I also have 20x4 lcd hooked up to the board & RealTimeClock. RTC connected thru i2c bus.

Program freezes after a couple seconds when arduino turns on VFD. My guess it is caused by radio interference from VFD. without having it on everything runs fine for long time.

before i used 16x2 i2c display & never had problems. it only started to happen with RTC module.

now i have to stop requesting time every time when vfd is running to avoid program lockup.

Is there any program solution for it?

Is there any program solution for it?

No it's hardware add more supply decoupling.

I put 47uf & 10nf to the supply for RTC but no effect. should i use bigger caps?

Here is what it looks like on oscilloscope:

https://docs.google.com/file/d/0B0pUD7N0nY5OVEY5VzdUSS1yNlE/edit?usp=sharing

Hard to tell but it looks bad. Assuming that scope was set a 1V per division and you have a 2V ptp swing on the supply rail you must get it down. Can you identify the frequency of those spikes to see where they are comming from. Curing the source is much better that trying to cure where it is picked up.

I would try those cap values on other parts of the circuit in addition to where you have them. Start with your frequency generator. Maybe go to a 100nF ceramic cap.

as soon as the motor starts up interference goes to 115V AC & shows up as little sine wave disbalance. i cant add a capacitor to my electric box, can I?

Yes look for snubber circuits. You need to use small non polerised caps and inductors.

sounds complicated to me. is there any solutions pre-made that i can use?

should i put this circuit on the input of VFD then?

is there any solutions pre-made that i can use?

Yes just google mains filter.

should i put this circuit on the input of VFD then?

No if the problem occurs when the motor comes on then you put the snubber or mains filter on the motor.

Grumpy_Mike:

is there any solutions pre-made that i can use?

Yes just google mains filter.

should i put this circuit on the input of VFD then?

No if the problem occurs when the motor comes on then you put the snubber or mains filter on the motor.

it is 3 phase motor. I'm getting 3 phase power by converting single phase to a 3 phase with Variable Frequency Drive. I googled mains filter & came up with line reactor for 3 phase. is this what i should use? Or this should be something on a single phase side?

Can i use three phase line reactor on single phase side? just use two of its coils? do i need to add a capacitor to it as well? what capacitance will be the optimal choice?

You should use a line reactor http://en.wikipedia.org/wiki/Line_reactor on the three phase motor because that is what is causing you the interference.

Can i use three phase line reactor on single phase side? just use two of its coils?

You can but I do not suspect it will be very effective.

do i need to add a capacitor to it as well?

Capacitors and inductors essentially do the same thing in limiting the rate of change of current with respect to time. If you are going for a commercial solution then it is likely that it will already contain capacitors.

Got my line reactor today. Installed on the output of the VFD but still have interference.

Every time when motor starts i still have the same output on the scope. interference with a frequence about 9khz 2v peak-to-peak

i ordered 3.3mfd snubber capacitors. hope they will help