Voltage divider circuit to solid state relay

I'm pretty new to electronics but have been trying and researching a lot recently. Mostly for creating simple circuits for escape room puzzles.

I've been looking into voltage dividers and yesterday I tried the following circuit:

From one 12V power source I created a parallel circuit where one part goes through a voltage divider circuit to drop it down to around 5V. That 5V then supplies the power to a 5V relay (KY-019) and also goes to the signal input of the relay via a button. The other 12V goes through the relay to a maglock.

The idea is that if I press the button, the relay gets 5V, opens up and releases the 12V maglock.

Now I know this specific circuit makes no practical sense, since I can leave the relay part out and trigger the maglock via the button directly. The goal was to get some experience with voltage dividers as I've ran into situations where I needed different voltages in one project quite often.

But it does not work, and I can't figure out why. The divider works, the lock gets 12V and the relay gets 5V. But the moment I press the button the voltage to the relay is cut in half. Giving 2.5V to the relay's + and 2.5V to the relay's S. Since the button and + are wired in parallel they should both remain 5V right?

Is the relay itself interfering with this or is there some math I'm missing? I read that voltage divider circuits are good for triggering but bad for supplying load. Is that what's happening here and if so, why? I'd really like to know what I'm missing.

Also, are there any changes I could make to get this to work? Or is it conceptually doomed? A lot of my projects require different voltages and I've been able to manage with step-up and step-down modules but being able to use a simple voltage divider circuit could be quite handy sometimes.

The relay coil current (70 mA (wild guess)) will come from your "5 V" voltage divider output. All that current will pass through R1, increasing the voltage drop across it, and apparently dropping the "5 V" supply to too low a voltage for the relay to operate.

Voltage dividers can be used if the current drawn from the divider is low and constant, and that current is considered when calculating the resistor values.

If the load current of a voltage divider varies, the output voltage will also vary.

To supply a load drawing a variable current you need a voltage regulator.

• This is correct, but in this case I think the easiest solution would be for you to use a relay with a 12V coil.
– vir
Commented Sep 12, 2023 at 23:54
• It is stated in the title that this is a solid-state relay - therefore, there is no coil. 70mA seems very high for a SSR. Commented Sep 13, 2023 at 1:42
• @MOSFET: since the OP said the relay has +, - and signal inputs, and NC, NO and COM outputs, I assume he really has an "Arduino/Hobby" relay module, not actually a solid state relay which would only have two input terminals and two output terminals. Commented Sep 13, 2023 at 1:48
• @PeterBennett You're right. I did some quick research and this is an electro-mechanical relay module. It incorporates the transistor, base resistor and flyback diode all in one package. The problem is clearly loading. Commented Sep 13, 2023 at 1:56
• @Mosfet and PeterBennet. You're correct, I mistakenly identified the relay as solid state. Not sure what I was thinking. It is a mechanical relay. What would be the correct course of action. Should I fix the title and add a note that I did to the original message? To prevent confusion for future readers. Commented Sep 13, 2023 at 7:54

Your relay is not solid-state. It's mechanical and in your situation, it's a heavy load on your circuit. In other words, your voltage divider has way too high impedance - this is why your measured voltage is cut in half when you activate the switch.

Your options to make this work properly:

"stiffen" your voltage divider - use lower value resistors 100ohm and 150ohm. This lowers your divider impedance by 10 times. The downside - your going to need larger resistors cause now you have more current. Not a great solution but it will get your circuit working.

You can actually do this with one resistor. Figure out the current draw of the relay (I believe I read 150mA. But check anyway). You need a resistor that's going to drop 7V at this current draw - 5V for the relay and the remaining for the resistor (12V-5V). So, ohm's law 7V/150mA = 7V/0.15A = 46.66 ohms = 47ohm standard resistor. To figure out how much power the resistor is going to burn, use fancy ohm's law: i^2*R = 0.15A * 0.15A * 47ohm = 1.06W. So a 2 watt resistor would be adequate with a comfortable margin. Still not a great solution, but gets the job done with one less resistor.

Other solutions could involve dedicated 5V regulators (simple 3-pin to-220 guys and you can probably skip the capacitors), using a 12V relay, or using an actual SSR which draws much less current allowing your voltage divider to be more "theoretical".

A resistor potential divider cannot maintain a constant output voltage as the load it's supplying varies. Here's your divider with different amounts of current being draw from its output, or injected into that output:

simulate this circuit – Schematic created using CircuitLab

The voltmeters show the divider output under various loads. On the left, under no load, the output voltage is the expected 4.8V, but as soon as you draw or inject any current, you alter the currents in the resistors, and by Ohm's law you must necessarily expect the voltages across them to change. This can be seen in the two examples on the right.

Your relay module draws way more than 5mA, and will have a devastating effect on that 4.8V output.

In other words, the resistor divider does not "regulate". What you need is a regulated voltage. There are two easy ways to obtain a regulated 5V from a 12V source:

simulate this circuit

On the left, a passive solution, we use a zener diode D1 to obtain the desired 5V or so. It regulates quite well, starting at 5.2V under no load, then dropping to about 5V under a full load of 100mA maximum. Both R1 and D1 will get quite hot, and will need to be 1W devices.

On the right is an active solution, employing a linear regulator, the classic 7805 IC. It regulates exceptionally well, maintaining very close to 5V at its output under loads exceeding 100mA, which is all you will need to power your relay module. It regulates by varying its own resistance from input to output to be always exactly the right resistance necessary to maintain 5V at the output. It's sorcery.

There are a million different regulator ICs out there, and this one, the 7805 is a 40+ year old design still in use today. You could shop around for something more modern, though, like the TLV1117.

Alternatively, get yourself a cheap DC-DC buck converter module from EBay or Amazon. They can produce 5V from 12V, and do so much more energy-efficiently than a linear regulator like the ones I mentioned above. They look like this:

I got that from Amazon, here. Even more alternatively, build one of those yourself, using the popular LM2596.