Electronic – Relay with notifications circuit

circuit analysis

(see update at the end)

This is a continuation of my previous question about a relay: Question

What I want is a notification LED for both power and if a switch is on, which controls the relay.

Below is the circuit I have in mind:

schematic

simulate this circuit – Schematic created using CircuitLab

Below are my calculations and reasons.

  • S1: Adapter 9V DC
  • D1: Voltage reducer, 1N4148, Vfw = 0.7 V
  • D2: Power indicator, Blue 3mm, Vfw 2.8-3.2 V. 5 mA is enough for a LED indicator.
  • R1: Resistor for power voltage indicator LED. V = I*R. R = V / I = (9 – 0.7 – 2.8) / 0.005 = 1,100 R -> 1,000 R … A will be V / R = (9 – 0.7 – 2.8) / 1000 = 5.5 mA.
    For minimum: A will be V / R = (9 – 0.7 – 3.2) / 1000 = 5,1 mA.
  • Relay_vcc will be 9 – 0.7 – 2.8 = 5.5 V, which is in spec (5 V , 120% is 6 V). The minimum value is 9 – 0.7 – 3.2 = 5.1 V
  • D3: Switch indicator LED. Should be around 5 mA. Green 3mm, VFw = 1.8-2.2 V
  • R3: Resistor for switch indicator LED. V = I * R.  R = V / I = (9 – 0.7 – 1.8) / 0.005 = 6.5 / 0.005 = 1300 R -> 1200 R, resulting in I = V / R = 6.5 / 1200 = 5.4 mA. In case of Vfw = 2.2 : V / R = (9 – 0.7 – 2.2) / 1200 = 5.1 mA

I'm wondering mostly if I miss something, and if my values are 'ok'.
I hope this is not a too broad question, the reason I ask is since in my previous question I forgot to add the extra diode, so supplying around 6-7 V to the VCC (since I missed the 1N4148 diode).

UPDATE

I found out:

  • CH1 does not need has requirement regarding current, in examples from Arduino there is not a resistor between a GPIO and CH1 (or IN).
  • VCC probably uses the nominal current for the coil, which is about 75 mA.

However, my main question is:

Since VCC of the relay needs 75 mA, and D2 will burn when 75 mA is applied, but also D2 is used as voltage limiter, what should I do?

I read in other threads that a resistor divider is not good for relays, and the only other way I can think of is adding 5 or 6 1N4148 diodes, reducing the voltage to 9 – (5 * 0.7) = 5.5 V.

(Btw, the best solution is to use a 9 V relay module, or use 5 V input. Since I don't have the first one, I am going to use a 5V cable and cut it or check for some bracket).

Best Answer

Step back to the actual requirements. Apparently you have a relay module that takes power, ground, and a control signal. You will control the module with a pushbutton. You want two indicator LEDs. One for power applied to the module, and one to indicate the relay is activated. Apparently the relay module requires 5 V power and signal, although that is not clear. The available power is 9 V.

Here is a solution:

IC1 makes 5 V from the input voltage. This always powers the relay module.

The 5 V also always lights LED D1. If D1 is a typical green LED with 2.1 V forward drop, then the current thru it will be about 5 mA. That's plenty good enough for most modern LEDs used as indicators indoors.

R2 and D2 work the same way, but are only powered when the pushbutton SW1 is pressed. Pressing the pushbutton also drives the control input to the relay module high. R3 makes sure the control input is low when the pushbutton is off.

While this does what it appears you want, the whole thing seems rather silly. If you want to control a relay from a pushbutton, just put the pushbutton in series with the relay coil. You can connect a LED to ground both before and after the pushbutton to indicate power and relay on. There is no need for a relay "module".