Relay causes errors on MAX7219 7 segment displays

Ok, i can not draw a diagram at the moment but basically, i am using TRACO POWER 1-2450 5V power supply for each. Wallwart (9V) connects to all 3 of them. So one 1-2450 for relay, one for MEGA and one for UNO. After a lot of testing and having each of them have its own power supply i was able to greatly reduce interference and noise from MAX7219 chips on other components and sensors.

I can not find that relay online any more, got it long time ago but something like this:

and power supply:

Many thanks,
Alek

reading about using PN2222 as a switch... will have to test it out

So you feed 9V into the 5V relay modules? Please check each relay module separately, perhaps one has already been damaged.

DrDiettrich:
So you feed 9V into the 5V relay modules? Please check each relay module separately, perhaps one has already been damaged.

no no no, maybe i was not clear, i am feeding 9V into each Traco 2450 DC/DC converter that then outputs 5V to each, UNO, MEGA and relay.

elcrni:
reading about using PN2222 as a switch... will have to test it out

No, that makes no sense. The relay module you have already contains the switching transistor, That is not the problem.

The problem is the wiring layout. You need to keep all the wiring from module to module tightly bundled, forming no open loops separating supply from ground or control signal from ground, which can variously radiate or pick up impulse interference.

While those DC-DC converters look good, they clearly have minimal capacitance across the output (or indeed, input). Put a 470 µF capacitor across the Vcc and Ground connections of the actual relay module. It already includes the "kickback" diode.

But note the need to keep the wiring to the relay contacts also paired and away from all the other logic wiring.

DrDiettrich:
So you feed 9V into the 5V relay modules? Please check each relay module separately, perhaps one has already been damaged.

You are not likely to damage a 5 V relay (module) by feeding it 9 V. :astonished: Certainly not in a hurry.

(90 mA x 9 V - 810 mW)

OK, just connected the transistor PN2222 and it works without errors on 7 segment displays BUT, i have a feeling i am doing something wrong here.
It does work, it does break the circuit and turns LEDs ON and OFF but when they are OFF they still flicker slightly, not visible in bright conditions but when i turn of light in the room i can clearly see it.

GND from power supply goes into PIN1 of the transistor, PIN12 from MEGA goes to base middle pin and then GND goes out from PIN3 of the transistor.
I have 1k resistor on MEGA to BASE pin.

Ah i just seen the replies... one thing that bothers me with relays is that they "click" :slight_smile: and even i do love relays, i would like some other solution here that does not "click" when switched ON or OFF.

I DO have 220uF capacitors added on all 3 1-2450 step down modules.

And yes, need to tidy up the wiring a bit indeed

Any other suggestion would be appreciated.

Many thanks guys!
Alek

Hi,
When you can, a schematic (even pencil/paper) and a picture of your project please.

Thanks.. Tom... :slight_smile:

Ok, i've put 470uF on the relay and the same thing happens again, messes up 7 seg displays after a random number of turn ON/OFF cycles.

I use 2 physical switches, one controls LEDs only and the other one both all displays and all leds. Errors happen only when i turn ON/OFF the second one that controls displays and LEDs.
If i cycle switch for LEDs only, it doesnt seem to affect displays.

Interesting thing is, if i turn OFF LEDs with LEDs switch and then just cycle ON/OFF the displays alone, no error happens.

So it ONLY happens when i control both, LEDs and displays at the same time.

TomGeorge:
Hi,
When you can, a schematic (even pencil/paper) and a picture of your project please.

Thanks.. Tom... :slight_smile:

Unfortunately i still don't have a scheme of my rig and to make it would require days, as my setup is quite complex.
I can perhaps only make a scheme of how relay connects to the rig...

Many thanks,
Alek

Ok, got it all working nicely with PN2222. this is now resolved.
Many thanks to all!

Hi,

Unfortunately i still don't have a scheme of my rig and to make it would require days, as my setup is quite complex.
I can perhaps only make a scheme of how relay connects to the rig...

That would be fine, please show how you have the relay module connected to the controller with the PN2222 and the relay to the load and its power supply.

If your project is now so complex hardware wise, now is a good reason to make a good schematic for future reference and troubleshooting.
In doing so you may find other potential problems or wiring redundancies.

Thanks... Tom.. :slight_smile:

In case you control the power to the entire display including the MAX, then you should disconnect not only power but allso all signal lines. After turning the display on again the MAX has to be initialized again.

Yes indeed! Been putting it off for too long but it's the time to make a detailed schematic.

I am now using MOSFET IRF520N for switching LEDs and my problems seems to went away, no more display errors.

Now, the only thing that i am not sure about are resistors on MOSFET, in some schematics i see a resistor (usually 1k) is connected between Arduino PIN and GATE pin on MOSFET and somewhere 10k resistor connected between Arduino PIN to GATE and GND... to prevent floating pin state because of high impendence, which as far as i know is a problem on INPUT pins and not on OUTPUTs as in this case...

Confused...

apart from that, my rig is 99% finished!

Many thanks,
Alek

DrDiettrich:
In case you control the power to the entire display including the MAX, then you should disconnect not only power but allso all signal lines. After turning the display on again the MAX has to be initialized again.

No, i am using "shutdown" function tu turn displays ON and OFF, i am not breaking the circuit by hardware.

elcrni:
Now, the only thing that i am not sure about are resistors on MOSFET, in some schematics i see a resistor (usually 1k) is connected between Arduino PIN and GATE pin on MOSFET and somewhere 10k resistor connected between Arduino PIN to GATE and GND... to prevent floating pin state because of high impedance, which as far as i know is a problem on INPUT pins and not on OUTPUTs as in this case...

Ah, but you see, when the Arduino is reset the pin is an INPUT until your code actually starts up and your code makes it an OUTPUT, so the resistor holds the FET off until that happens.

It all depends on whether having the FET randomly switch on or switch on only partially as the system starts up, will cause any trouble. :astonished:

Paul__B:
Ah, but you see, when the Arduino is reset the pin is an INPUT until your code actually starts up and your code makes it an OUTPUT, so the resistor holds the FET off until that happens.

It all depends on whether having the FET randomly switch on or switch on only partially as the system starts up, will cause any trouble. :astonished:

Hmm, BUT, as soon as the program starts, "setup loop" tells it the pin is OUTPUT, or is that not soon enough?
In any case, FET only breaks the circuit for cca 10 LEDs, so nothing bad would happen in either state of the FET at reset or startup... also, my rig is not going to power up or reset often at all.
Many thanks,
Alek

And that is the point - if you don't care, it doesn't matter, but sometimes you really do not want the thing you are controlling to flash on for a fraction of a second. :roll_eyes:

Paul__B:
And that is the point - if you don't care, it doesn't matter, but sometimes you really do not want the thing you are controlling to flash on for a fraction of a second. :roll_eyes:

Yes, it's all clear now! When its really important to keep the pin LOW until you explicitly tell it it's HIGH, we need a resistor. Learned a lot!
Many thanks,
Alek