Doorbell circuit design using relay

Hi I was trying to connect a doorbell to an wemos mini. I was actually trying to find a solution, the one I actually have considered are:

I was checking a tutorial using the last option and I found a tutorial that use a relay, but judging the schematics and my limited electronics knowledge I'm not sure whether it's safe to connect the output of the wemos to the output of the doorbell (red line). Shouldn't be the case that those in the ground will be connected together (black one from the doorbel) instead. I understand the logic behind those connections as the relay is inverted, so that's why is the ground connected to the input, but I'm trying to understand if it's safe to do the connection as showed.

In the schematics (even if not showed) the wemos is power sourced using the microusb connection

In the real world, many door bell push buttons are lighted and always draw power from the transformer, but not enough to ring the chimes.

What I have done is put 4 diodes wired as two in series back to back with the other two .Across that I put a small resistor in series with an led .
When the bell ring the led lights . The whole is wired in series with the bell Circuit .
The diodes allow conduction in both directions but drop enough voltage to power the led .
I put the whole in a tube with an LDR connected to my Arduino. - so I had an isolated digital input from the bell .

What you made is something called an opto-isolator. Here's a common one:

You'd still need to limit the input current with a suitable resistor.
C

Can you please explain what is connected to this terminal block?
image

What are the 2 pins (D7, D8) used for? - can you post your code?

It's not mine, actually as I stated in my post, that was something I found online. The yellow line correspond to the mechanism to open the door. The red line is the bell, and the black line is the ground of the doorbell.
I don't have any code as my doubt was if the schematics were correct in that case scenario. I don't worry that much about code as I'm more proficient in that. But the electronics of that case it what I'm not sure about.

Yes that's one of the ideas i was considering. There is already an example in github using a PC817 GitHub - tIsGoud/Doorbell-via-Wemos-and-optocoupler: Digital version of my "analog" doorbell project to determine if the doorbell was pressed.

In that link there is no conversion to DC, but is using a resistor to lower the voltage and diode to to flatten the signal.

In the relay circuit above the red line from the bell appears to be powering everything? Unlikely that the bell is 5v, and possible that the bell is running on AC... so not sure how this would ever work?

If I understand what is being attempted...

RELAY 1 - triggered by LOW signal on the doorbell line. Won't work as there is no common ground between the relay module and the door bell.
RELAY 2- triggered by the Arduino (LOW on D8), and provides either +V or GND to the yellow line connected to the terminal block. But, if the V+ is coming from the door bell it will only be HIGH while the button is pressed.

Also implies that the Arduino and door bell have the same 5v DC signal voltage. I would not use that circuit.

The one with the optocoupler looks more suitable, or as per the original video use an AC current sensor.

The board is powered through micro usb. My problem is exactly with that red line and the +V. In theory (not my case) the bell is powered by DC not AC. But even if I convert to DC using a full bridge rectifier I'm not sure about that solution. The main reasoning mentioned in the source (video) for using that +v connection instead of ground is that is an inverted relay.

  • The first relay is activated through D8 and is used to open the door. So that part of the circuit is actually correct.

  • The second relay is the one used for detecting the pressed doorbell (violet and yellow connection)

Here is the final result presented in the video. It's an spanish video that's why I didn't link it (but here it's in case someone can share some light 🔴 Cómo domotizar un viejo portero automático 📲 - Parte 2 - YouTube).

I'll probably will go with de optocoupler solution. Regarding that, is there any problem using PC817 with AC using a resistor and diode ( GitHub - tIsGoud/Doorbell-via-Wemos-and-optocoupler: Digital version of my "analog" doorbell project to determine if the doorbell was pressed.)

Anyway, thanks for the answer and sorry if I didn't explain myself well enough. I was really curious about that solution because something didn't seem right to me.

You would be correct in that assumption... it's a weird setup to use a 2x relay board like that.

You are using each really quite differently.

  • RELE1 is used to switch the door (based on Arduino signal)
  • RELE2 is used to send a signal to the Arduino, based on the bell signal.

It will only work properly if

  • the doorbell is DC
  • the doorbell is 5v (as is the Arduino)... assuming they are 5 volt relays.

Not sure about the PC817 option.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.