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
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
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
lot of decoupling caps. on the chips, on the relays, power entry points on the PCB.
don't forget snubber diodes on the relays (and decoupling caps)
Use a regulated power supply.
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.
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.