Thanks alot for all your fast answers.
oric_dan(333):
- adequate bypass caps on the microcontroller.
- reverse diodes across the relay coils.
- snubbers on the relay contacts [do google search on "snubber"].
Also, in general, you cannot drive a 5V relay directly from an Arduino I/O pin, as 5V relays
typically require somewhat more current than the pins can provide, so people typically use
NPN transistor inverters between the I/O pin and relay.
Thanks I will try the snubber, and for the bypass cap on the microcontroller, where can i conect it if im using an arduino duemilanove?
Sorry i forgot to mention, Im using an external supply of 5V with the ground connected with the arduino gnd.
Im also using the transistor conection like this: http://www.arduino.cc/playground/uploads/Learning/relays.pdf
MarkT:
I'd also add more supply decoupling on the 5V rail right next to the relay and its transistor. 220uF or so. Replace that 1N4007 with a fast recovery rectifier, its too slow.
Thanks alot, i will try both, ¿the capacitor is ceramic or electrolytic?, ¿what diode can you suggest me?
kf2qd:
You mentioned that you have no bypass caps. That would suggest that you think it would really be practical to use them but you either didn't bother, or couldn't be bothered. Add a larger cap to the power supply side and some smaller ones to the display and the lines going to the relay control.
I read i needed some, but i was afraid cause im new using capacitors.