123W AC Motor, I2C, an why the arduino freezes up

Hi folks,

I'm having a bit of trouble with my latest Project. I have:

A Coffee Grinder with 130W AC Motor, controlled by a relais. An OLED Display controlled via I2C. The Arduino that sits in close proximity to the motor.

The Problem:

On Turn-On/Off of the motor the display/Arduino freezes. This got better when I wrapped the wires that go to the display in tin foil and connected them to the metal enclosure.

My guess: On turn on/off of the motor I'm getting EM spikes wich interfere with the arduino and cause it to lock up. So my next step would probably be wrapping the arduino in tin foil as well to shield it from EM. The Tin foil should be connected to the enclosure which in turn is connected to the earth wire of the AC plug and the shielding of the USB cable wich supplies the Arduino. Correct?

Did you use a snubber circuit across the relay contacts.

If that doesn't help, post a diagram and picture of the setup. And how you have powered it. Leo..

Hi,
Maybe this recommendation it is too late but why not use an SSR. Since the SSR it is an opto couple interface to the Arduino it will give you an isolation between the high motor voltage and the micro.

Thanks for the Replies!

The Relais board is a pre-made opto-couple Relais with protection diode etc. the problem never occured when using the relais (many many times during testing) So I'm sure it's the AC motor. So SSR won't help in this case.

Before shielding the cables with tin foil the problem was much worse, killing the display almost every time the motor was started. I was also able to observe display artifacts on turn on/off of the motor. So I'm pretty certain it's the EM spike.

Hi,
Just try what Wawa recommended you. Snubber it is a resistor of 100 ohms in series with a .01uf capacitor connected in parallel with the relay contact.

Ah I think I misread that! By relais contacts you mean the ones going to 230V AC?

You should probably have a suitable snubber circuit across the relay contacts - your load is inductive. Snubbers have to roughly match the load, google how to choose component values. Remember for mains use capacitors must be mains rated, class X I believe.

I found an 0.1uF cap and a 10W 44Ohm Resistor. This is as close as I can get to the suggested values. The cap was part of a wall wart so it is mains rated. As far as the resistors are concerned, I found out 1-2W are sufficient, but it was either two 5W 22Ohm Resistors in sieries or about 20 1k69Ohm resistors in parallel.

As far as my understanding goes the larger capacitor 0.1uF instead of 0.01uF as suggested sould flatten the EM spike even more. The lower resistance would counteract this by a quicker charging time. so... capacitance times 10 and resistence divided by two. Results in 5 times slower charge/discharge?

Hi,

The Relais board is a pre-made opto-couple Relais with protection diode etc. the problem never occured when using the relais

So what are you using now?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you post a copy of your project so we can see yor component layout?

Thanks… Tom… :slight_smile:

This is how it is wired :slight_smile:

Check the complete build on (german):

Hi,
Thanks for the pictures and "circuit??" diagram?


Please can you provide a complete circuit diagram, I am surprised you do not have a comprehensive schematic.

IMPORTANT... Do not turn it on again until you have removed ALL of the foil and used proper earthed shielded cable with insulation. Foil will splinter and fall into your circuitry.

Remove the relay from where it is next to the Arduino and place it where the 230Vac wiring is NO WHERE near the input and low voltage wiring of the Arduino.

The Relais board is a pre-made opto-couple Relais with protection diode etc. the problem never occured when using the relais

If the problem doesn't occur with the opto relay, why aren't you using it?

What does your project do? What is its application?

Tom.... :slight_smile:

I am using the opto-coupled relay :-) It is a pre-made board so I never troubled myself with the exact schematic for my plans other than "switch". It is properly equipped to be controlled by a uC. I am still using the arduino power supply to drive the coil of the relais, so it strictly speaking isn't completely opto-coupled any more. However I see no reason to drive it any other way since the arduino is well capable of supplyingthe ~60mA it is using. Also the Nano has no pin-out from the USB input so unless soldering onto the board the optionsaren't that great.

I don't have any schematic since I mainly made it up as I went along. It's not that complicated and since it's just sensors and I2C and SPI there is nothing really critical that wouldn't survive being shorted. The only component to watch out for is the relay driing the AC motor, but apart from that everthing is just low voltage/current. The mains wiring is done properly with the appropriate connectors/screws.

The tin foil is surely not ideal but will work for a few months until the proper board is finished. The wiring will be replaced by appropriatly shielded wire. Also note: no mains wiring is wrapped in tin-foil and all the mains connections are shielded by those white plastic thingies.

It's a quite elaborate modification of a coffee grinder, adding timer functionality and digital gind-level read-out. Check the link, the pictures should explain it better than anything ;-)

jazzar: I am using the opto-coupled relay...

I am still using the arduino power supply to drive the coil of the relais...

So no opto isolation.

Driving the opto LED with the Arduino and powering the coil with the Arduino effectively shorts the opto coupler. Leo..

No, the arduino is supplying voltage to the transistor side of the opto coupler via the +5V pin. The input of the opto couple is driven by a digital pin. I'm not sure if thats what you mean with shorting out. There are no shorts on the board. Strictly speaking it is not making use of the opto coupler as is could be used, but still soundly wired.

Hi,

" I am still using the arduino power supply to drive the coil of the relais"

I have a question. You said that your are using the +5 to drive the relay? Did you check how much current does the relay used? Maybe this also add to your problem. That when you enable the relay your Arduino voltage dropped causing to freeze it.

Also can you explain more in detail what this mean? "Strictly speaking it is not making use of the opto coupler as is could be used, but still soundly wired." Did you wired the Arduino directly to the transistor bypassing the opto?

I think we need a complete schematic how you have everything wired from the arduino up to the reay.? It maybe a good idea try to find/locate the schematic for the relay board.

Nothing is wrong with the relais >.<