I have a problem with my relay circuit. I am using a ULN 2803 Darlington Array for controlling the relay Omron G5V2. The ULN 2803 has already Transistors and Diodes included. The ULN 2803 is sending the on/off signal to the 5V relay. The relay turns on/off a small waterpump. Nothing really complicated, I thought... But I think I have a principle misunderstanding how the circuit is supposed to work.
The digital pin 2 (low or high) from my Arduino Board goes into the Pin1 of the ULN2803... -> red cable
The signal comes out of the ULN 2803 Pin 18 and goes directly into the relay. -> red cable
For closing the circuit, the relay is directly connected with the Arduino Ground. Am I wrong here?! --> yellow cable
The ULN 2803 Ground Pin is connected with the Arduino Ground -> black cable
The 5V power from Arduino goes into the ULN2803 Pin10 (com) for external Power. As far as I understood I have to do it for inductive circuit. And a relay circuit is inductive one... Am I wrong here?! -> blue cable
The other black and blue cables are the external power cables...
I have checked the soldering already many times with a multimeter. It seems they are all ok. If the relay get direct voltage with e.g. 5V, then it is switching. I can hear it.... Has anyone an idea or an explanation what I am doing wrong?! Thx you very much in advance!
The ULN2803 doesn't actually 'use' the 5V.
The output of the ULN2803 is not supplying anything.
The ULN2803 are a bunch of darlington transistor. They pull the output low. That is all. They have also a large voltage drop of about 1V.
Pin 2 to input of ULN2803 : okay.
Output of ULN2803 to relay : okay.
But the other connection of the relay should be to 5V.
Ground of ULN2803 to GND of Arduino : okay, but that is the current through the relay, I rather would see that going to the ground of a power supply.
Plus of ULN2803 (blue wire) should go to the 5V of the relay. That are the protection diodes for the switch-off current peak. There should also be a capacitor from 5V to GND to collect the current pulse.
thank you very much for your fast reply! Now it is working and switching. It took some time until I understood what I have done wrong...
But still, I am not completely 100% confident, why it is working and I don't completely understand your answers.
Question 1:
Ground of ULN2803 to GND of Arduino<< is not good? why? what do you mean with the current of the relay. Are we talking about the controll circuit? I mean the 5V or higher voltage? If I look on this example. They connect the ULN2803 Ground to the Arduino Ground, too. Or have I misunderstood it?
Question 2:
Plus of ULN2803 (blue wire) should go to the 5V of the relay<<. Ok I did it, and it worked. But why do I need a capacitor? Is it because the current goes in the opposite direction, when the relay is turned off?! But for this case, I thought I have my diodes and everything from the ULN2803, which does the job...
Uiui, even the basics of electronics causes headaches
Follow the current through the relay (activated): 5V -> relay -> ULN2803 -> Arduino GND pin -> Power supply ground.
If the ULN2803 would turn on 8 relays with a lot of current, that current is going through the board of the Arduino.
I would rather have the ground of the power supply with a wire to the Arduino and with a wire to the ULN2803.
But your circuit is only with one modest relay, so it is no problem at all.
Knowing how the ground current will travel is important to know. Especially if also analog signals are used.
You are right. The diode will take care of everything in theory.
But in reality, the relay and the diode have capacitance, and your wires have an inductance. So I would still like to decouple the 5V for the relays with a capacitor
By the way, the relay is an inductance, therefor the current tries to continue in the same direction.
Thx again for the very useful advice! Especially, if I would use 12V Relais, then I have to grounded, like you said, to the ground of an external power supply. This part I fully understand now
This I also understand. But I am not 100 % with the correct wiring and the amount of capacitiy... is 0.01 F (C = 0,05A * 1sec / 5V ) enough? What about these ones?
Here is a rough sketch of the wiring I would do based on advices. Is it so correct?
Those 100nF (0.1uF) are fine.
You should always have some of those around. If for example a project has 20 ic's, every ic should have its own 100nF, even if the ic's are right next to each other.
In the new picture, the relay has no wire to the 5V ?
The capacitor has the (-) at +5V and the (+) at GND. It should be the other way around.
No, sorry, not like that.
Please remove the capacitor and use the wire again from the relay to the +5V.
Perhaps you can keep it like that and don't use the capacitor.
If you do want to try the decoupling capacitor, it should be added to the circuit. You should not remove a wire. The (+) side should be connected to the + of the power supply and the (-) to the ground of the power supply.
Follow the current through the relay (activated): 5V -> relay -> ULN2803 -> Arduino GND pin -> Power supply ground.
If the ULN2803 would turn on 8 relays with a lot of current, that current is going through the board of the Arduino.
I would rather have the ground of the power supply with a wire to the Arduino and with a wire to the ULN2803.
But your circuit is only with one modest relay, so it is no problem at all.
Knowing how the ground current will travel is important to know. Especially if also analog signals are used.
You are right. The diode will take care of everything in theory.
But in reality, the relay and the diode have capacitance, and your wires have an inductance. So I would still like to decouple the 5V for the relays with a capacitor
By the way, the relay is an inductance, therefor the current tries to continue in the same direction.
What should I do If I want to connect 8 relay to ULN2803?
Use an entirely separate supply for the ULN2803 and relays. Just common the ground with Arduino.
Note the ULN2803 drops a lot of voltage, its not really sensible to use it for 5V relays as the relays
will see only about 3.5V. However the built-in diodes are very handy.