I am building a replacement for dishwasher's controller that burned, using Arduino Leonardo. Arduino is powered through standard 9V AC/DC converter.

Dishwasher uses quite large 220VAC electric pump and a few electromagnetic valves that I control using relay board. Because I was stupid I've bought 12V relay board, not 5V - so I had to power relay board from Vin pin - 9V is enough to do the job.

The layout is pretty tight - I use sealed lunchbox to store the components (wiring is removed at this photo, it looks as a ratnest when fully assembled).

The problem is that serial connection I use to debug my dishwasher code is quite unstable. Sometimes it hangs; if I use TTL wires hooked to pins 1&2 instead of USB I sometimes notice odd characters. Seems that either relays are causing short voltage drops sometimes or the noise from pump and valves are influencing the circuit.

My idea was to add few electrolytic and ceramic capacitors right on the 9V AC/DC's wire. But what worries me is that I've heard multiple times that decoupling capacitors should be installed as close as possible to the circuit. In my case the length of the wire between caps and Arduino's DC jack will be about 5cm. Is it gonna work or this setup will be useless?

  • \$\begingroup\$ Can you extend your circuit with how you connected arduino and your relays? \$\endgroup\$
    – jippie
    Feb 4, 2014 at 18:39
  • \$\begingroup\$ Relay board has VCC and GND pins for power and eight signal pins. VCC is connected to Vin of Arduino (where it gets unregulated 9V from DC source), GND and signal pins are connected to corresponding Arduino pins. This is a pretty straightforward, nothing unusual. \$\endgroup\$
    – Alexander
    Feb 4, 2014 at 18:52
  • \$\begingroup\$ You probably need to decouple the power supply near the relays and their transistors. Do you have the circuit diagram for the relay card? Another problem may be switching the 230VAC so close to the Arduino, are there AC snubbers across the contacts? \$\endgroup\$
    – jippie
    Feb 4, 2014 at 18:55
  • \$\begingroup\$ No, I don't have circuit diagram for relay board - but it looks pretty standard - with transistors and diodes that protect signal pins from the current inducted by coils in relays. \$\endgroup\$
    – Alexander
    Feb 4, 2014 at 19:10
  • \$\begingroup\$ Unfortunately, I can't separate 230VAC part and Arduino - the space is tight, which is why I am using this flat box. Main pump has large snubbers, but smaller valves don't (it is the manufacturer's design which I prefer not to touch) \$\endgroup\$
    – Alexander
    Feb 4, 2014 at 19:13

1 Answer 1


In my case the length of the wire between caps and Arduino's DC jack will be about 5cm. Is it gonna work or this setup will be useless?

It is not feasible to know, without simply trying it. Yes, it's best to put the capacitors as close as possible. If 5cm is the closest you can get, than that's "as close as possible". Certainly adding the capacitors won't make anything worse.

We especially can't know if this will fix your problem because we don't know what your problem is. See Why does connecting a high-current device to my digital circuit cause weird behavior?

  • \$\begingroup\$ It 'kind of' worked - I observe odd behaviour much less frequently, now it is tolerable. The only problem was to fit enourmous 4700mF cap into the box :) I also plan to add a layer of insulation and foil between arduino and relays to reduce the impcat of noise even further. \$\endgroup\$
    – Alexander
    Feb 13, 2014 at 7:21
  • \$\begingroup\$ @Alexander I wouldn't expect the foil to do much, except accidentally short out your circuit. Solving problems like this usually requires determining the source of the noise and eliminating it, making sure your layout is good with small loop areas, proper grounding, etc. \$\endgroup\$
    – Phil Frost
    Feb 13, 2014 at 12:47
  • \$\begingroup\$ I planned to use both foil and a layer of insulation. But your point on determining the source of noise is taken, of course. \$\endgroup\$
    – Alexander
    Feb 14, 2014 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.