12 volt relay activation with 5 amps load makes 7-segment display crazy

Hi everyone,
I have a problem with a small Arduino project.
I have been developing a basketball scoreboard with Arduino UNO r3 and Big 7-segments displays:

http://www.sureelectronics.net/goods.php?id=721

Here you can find more information if you are interested: :grin:
http://code.google.com/p/display-group/
https://plus.google.com/photos/109652469005118520122/albums/5799213099932281809

I am using this power supply:
http://www.ebay.it/itm/300761494964?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

I decide to user a car horn to signal the end of the period, like this one, at 12v 5a:
http://www.ebay.it/itm/310690188112?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

This board with a relay and a phototransistor has everything i needed, and is controllable directly from Arduino:

The board is powered from Arduino (5v and GND) and output 8 is used to switch the relay. Arduino power also a small controller with 12 buttons to control the scoreboard, using 3 analog inputs, as you can see in the electrical layout I have attached. (I am not a professional so the layout is not perfect: I used the most similar symbol for some components.. like the display).

If I trigger the relay without a load everything goes well (I can hear the relay click), but if I connect the horn, as soon as it is turned on, and for all the time it's on, all the displays visualize "8" (all the segments on displays are on).
When the relay switches the horn back off (after a time from the cpu), all the displays show the correct digit again. So it obvious that the cpu did not reset.

I have heard that I should decouple the power line of the horn from the reset of the circuit, because of some spikes at the relay activation, so I tried to use a board like the one you can find attached to this post. This didn't help, the behavior is the same as before.
I will attach also the complete electrical layout, but don't expect it to be a professional one.... XD

The whole circuit is working pretty well, but I would like to use the horn without having the display going crazy! XD
Do you have any ideas?

Thanks in advance!!

Main.pdf (40.9 KB)

Main.sch (246 KB)

decoupling.pdf (11 KB)

decoupling.sch (526 KB)

The car horn is an electromagnetic device and will generate enough EMI to do things to the power bus that can't be discussed in mixed company. Some fairly heroic measures are likely needed. Just as a start, see attached schematic.

Switch the positive voltage to the horn, not the ground.
Put a diode (D1, e.g. 1N4004) and capacitor (C1, e.g. 0.1µF, 100-200V) right on the horn.
C2 and C3 should be at least 100µF electrolytics, maybe as large as 1000µF. C4 is 0.1µF.
I might also put two capacitors on each 7-segment display, one 10µF electrolytic and one 0.1µF, unless there is already adequate filtering and bypass built in to the displays.
L1 is something like 2.5mH to 10mH, with a current rating of at least twice the maximum you expect all the displays to draw. Also check its DC resistance spec, make sure it is as small as practical, certainly less than half an ohm.

Main.sch (393 KB)

Thank you for your hints Jack!

I work on this project only in my free time so I will take some time to get all the components and try them out.
I will report back on this thread as soon as I have some news.

You're welcome. I would save the part about the two capacitors on each individual display until last. Implement the others first, with luck that will take care of the problem.

Electromagnetic horns are simple, crude devices by today's standards,
if you can find a replacement sound source go with it - its a heavy inductive load
(solenoid) being switched with mechanical contacts driven mechanically by the solenoid,
and needs a separate power supply from everything else at the very least. All the wiring
carrying current to the horn will be radiating lots of interference and needs to be kept
clear of all the other circuitry. No parallel cable runs with anything else.

Or I could try with this horn and a different power supply... it's the next test that I'm going to do..

Hi!
I have tried with a different power supply for the horn only, the relay is still switched from the arduino. Arduino and the displays are powered with a different power supply than the horn. BUT THE SAME THING HAPPENS AGAIN!
Looking at the result of this new test I made, I could say that the problem is related to some disturbance that I cannot avoid with signal filtering.. am I right?

Thanks!

I might still try the filtering. Although I would have thought that separate power supplies would have been the worst-case fix. Try the diode and capacitor directly on the horn first, that's easy and inexpensive. If that doesn't work, better filtration on the logic supply is the next thing I'd try (the pi network).

Now that you are using a separate power supply for the horn, don't use Arduino ground to carry any of the horn current. For the horn wiring I suggest you use either twisted pair cable (hand twisted will do, no need to buy anything fancy) or flat twin cable (e.g. speaker cable, if it can handle the horn current). Run the cable from the power supply to the relay, and then from the relay to the horn. The idea is to reduce the area enclosed by the circuit to almost zero, to prevent it from generatnig magnetc fields that will in turn induce voltages in the Arduino and LED circuitry.

I have used the second power supply only for testing.. But I cannot use it in the real mount position....
I can try with the twisted pair but I don't think it will make a real difference, the disturbances are just to "strong" in my opinion.
I would rather use a different type of horn, not an electromagnetic one... do you have any suggestion?
Thanks!

gion86:
I can try with the twisted pair but I don't think it will make a real difference, the disturbances are just to "strong" in my opinion.

That depends on the nature of the "disturbances". If the power-relay-horn circuit encompasses a large area, then the disturbances may be mainly magnetic, and using twisted pair or figure-of-eight wiring will solve it. If a substantial part of the power-relay-horn circuit uses a common ground wire with the Arduino, then avoiding that common ground wire may solve it.

gion86:
I would rather use a different type of horn, not an electromagnetic one... do you have any suggestion?

Yes, use a high-intensity piezo sounder or piezo siren, such as ones that are used for alarms. All the usual distributors sell these. Here are some examples of really loud ones: http://it.farnell.com/jsp/search/browse.jsp?N=2018+213010&Ntk=gensearch&Ntt=piezo+siren&Ntx=mode+matchallpartial&getResults=true.

[EDIT: changed link to point to Farnell Italy]

Thanks for the quick reply and for the clarification on the disturbances.
The piezo siren should be a good choice, but I need it to signal the end of the period in a basketball game.. :smiley:
Maybe there is something more suitable for this purpose....

If you don't want to use a piezo siren, search Farnell for "piezo sounder" and pick one that is loud enough (maybe 95db?). Note that some sounders work from DC, others need AC at the sounding frequency.

Ah, but the car horn is so appropriate. A nice raucous sound, not some sterile electronic tone :wink:

Exactly!!! There is another possibility: the air compressed horns, but the air will be over sooner or later and is not easy to replace on the mount position...

Hi gion86,

after a short look at your main.pdf I found it worth to mention two things.

  1. Always use a "self-induction recuperation diode" (D2 in the example) if using a solenoid. (Don't know if the translation is correct)
    Unpowering the solenoid induces voltages that might destroy attached devices, like the Arduino pin.
  2. Don't power the solenoid directly from an Arduino pin unless you know that the Solenoid never draws more than the max. mA a pin could deliver. In the example an optocoupler is used to drive the solenoid, The Arduino pin only drives the optos LED.

You can find an example schematic here

1pc Optocoupler Relay Module 5v 1-channel H/l Level Triger E for sale online | eBay

I am using this board:

which... is exactly the same as yours.. I guess.. :blush:

But thanks for your considerations!