Relay + Manual Switch

I’m adding a 5V LED light control using a ESP32, BC547C relay driver, and 5V relay. However, I want to be able to control the light with a simple switch and I don’t want to consume another GPIO. I was thinking about simply switching the 3V with a manual switch into the BC547C. This would work but it would also back feed 3V in to the ESP. Would a simple diode work to protect this? Better way?

Shouldn’t be a problem for 3.3V MCU.
Post your wiring scheme.
You need flyback diode across the relay coil.

Here is the wiring scheme. Do I need the diode here?

Yes, and here:

Why not bypass the BC547C with your switch?

1 Like

Yeah, I guess this would be the easiest solution. Do you see any issues with this setup?

BC547 has max current 100mA, pretty close to normal 5V relay coil current.
You could use BC337 instead. Base resistor could be lower, 470R would be better.

I’m using these relays and it looks like draw 33mA.

Not quite “normal” relay… :sweat_smile:
You are good to go, it has even flyback diode incorporated.