Arduino freezes completely

Hi,
i have been working on a project, where i read Temperatures and switch relays depending on the temperatures. The relays are switched via a Darlington Array(ULN2003, i also tried normal relay drivers before). I use 12V/10A relays. The 12Volt are fed to the circuit board via an extra plug and the arduino uses it via the Vin Pin( i have a jumper to disconnect it though).
I get random freezes, when i switch a relay that is turning on a 230Volt pump. The Watchdog timer realizes the freeze and restarts the sketch,but i have to unplug it from the power source and USB to get it working again( i guess the FTDI Chip hangs too?!).
In the Serial Monitor i get following output(each Line is a response to a ON/OFF command):
100 OK No Timeout
100 OK No Timeout
100 OK No Timeout
100 OK No Tim

So the serial communication suddenly stops...

I tried these things:
-Disconnected Arduino from 12Volt Power supply => no supply voltage noise problem(i am not sure about this one)
-switching another relay (that is further away) which switches the 230Volt => no EMF noise problem

I use the String library,but this would only hang the Arduino and not the FTDI chip i think?
I have no decoupling capacitors...could that be the reason for the freezes?

Any Idea is appreciated.
Thanks for your help,
Alex

Do you have snubber diodes across the relay coils?

Hi,
i had them in my first design with the transistor relay driver but forgot them in the new design with the ULN 2003. I will add them but since the error also appeared in the first design, i dont think this is the problem, but i will doublecheck, maybe i soldered them the wrong way.
thanks

edit: diodes didnt change anything, still random freezes

alexaustria:
I have no decoupling capacitors...could that be the reason for the freezes?

Certainly doesn't help the situation to not have them.

I have had freezes like that the ADC and the serial use interrupts and both where happening at same time I guess because I added a small delay between them and it fixed it
But always use a cap on the uc power rails

Just to add to what others said.

  1. lot of decoupling caps. on the chips, on the relays, power entry points on the PCB.
  2. don't forget snubber diodes on the relays (and decoupling caps)
  3. Use a regulated power supply.
  4. Is your project in a case? Is the case grounded? I had a project randomly freezing usually after being left alone, and then I go fiddle with the rotary encoder. Grounding the case fixed the random lockups.

I get random freezes, when i switch a relay that is turning on a 230Volt pump.

Crash could be caused voltage spikes, ESD, and the like.

I would look into adding power line suppression capacitors, I think your pump is generating lots of spikes/noise during turn on.
http://www.okaya.com/products/noise-surge/capacitors/capacitors-faq

What are the common uses for these capacitors?

The most common use for X & Y capacitors is in EMI/RFI filtering applications where they are directly connected to the AC Power line. These types of capacitors may also be used to suppress electrical noise generated by motors, inverters and electronic ballasts. They are also used in solid state relay snubbers and spark quenchers for suppression of inductive transients.