Go Down

Topic: Relay Controlled with ESP-8266  (Read 869 times) previous topic - next topic

SoulG23

Jan 10, 2019, 12:16 am Last Edit: Jan 10, 2019, 12:20 am by SoulG23
I have a schematic that I got from a YouTube video and adjusted the relay to switch the Live of the AC.

I wanted someone to confirm to me whether it will work or not. If not, how to make it work. Thank You in advance.

Schematic: https://easyeda.com/alqasssab23/electifi-oti-v3
YouTube Video: https://www.youtube.com/watch?v=_ud8SXucAEY

WattsThat

Any idiot can make make a video. Unfortunately that is exactly what you found, an idiot that built a dangerous piece of crap that looks like it works.

Provide a proper 3.3 volt supply, move the emitter of the bc547 from mains to dc minus and perhaps you will not kill you yourself touching the low voltage side. The esp-01 will probably  fail due to the lack of a current limiting resistor for the led/Opto, it depends on the led.

Work? I seriously doubt it. It's a crap design from a YouTube genius.
Vacuum tube guy in a solid state world

SoulG23

Any idiot can make make a video. Unfortunately that is exactly what you found, an idiot that built a dangerous piece of crap that looks like it works.

Provide a proper 3.3 volt supply, move the emitter of the bc547 from mains to dc minus and perhaps you will not kill you yourself touching the low voltage side. The esp-01 will probably  fail due to the lack of a current limiting resistor for the led/Opto, it depends on the led.

Work? I seriously doubt it. It's a crap design from a YouTube genius.
Do you by any chance have a way to make it work or any other schematic that would serve the same purpose?

6v6gt

#3
Jan 11, 2019, 09:46 pm Last Edit: Jan 11, 2019, 10:10 pm by 6v6gt
That design look extremely dangerous (as already stated) because there appears to be a direct connection between the AC mains and the "low" voltage side of the circuit.

If the objective is to control mains voltage using an ESP8266, then purchase a purpose made relay module which includes an optocoupler, driver transistor, bare relay, fly back diode, led etc. all on a small board. So you can eliminate all those individual components.

You would be left with the ESP, the AC mains to 5v converter, the 3.3 volt regulator (with 2 capacitors - not shown) , a push button and of course a relay module.

If you can find a relay module which can be powered at 3.3 volts, you can get an AC mains to 3.3 volt converter and then also eliminate the 3.3 volt voltage regulator.

SoulG23

That design look extremely dangerous (as already stated) because there appears to be a direct connection between the AC mains and the "low" voltage side of the circuit.

If the objective is to control mains voltage using an ESP8266, then purchase a purpose made relay module which includes an optocoupler, driver transistor, bare relay, fly back diode, led etc. all on a small board. So you can eliminate all those individual components.

You would be left with the ESP, the AC mains to 5v converter, the 3.3 volt regulator (with 2 capacitors - not shown) , a push button and of course a relay module.

If you can find a relay module which can be powered at 3.3 volts, you can get an AC mains to 3.3 volt converter and then also eliminate the 3.3 volt voltage regulator.
The thing is all of the Relay Modules I saw have small terminals, that is why I want to make one of my own so i can make custom PCB's.

Paul__B

The thing is all of the Relay Modules I saw have small terminals, that is why I want to make one of my own so i can make custom PCB's.
Care to explain what you mean there?

SoulG23

#6
Jan 12, 2019, 03:19 am Last Edit: Jan 12, 2019, 03:24 am by SoulG23
Care to explain what you mean there?

These wire terminals are small.

These are the ones I want to use.

6v6gt

#7
Jan 12, 2019, 04:13 am Last Edit: Jan 12, 2019, 04:46 am by 6v6gt
OK. If you want to build your own relay module, which can be triggered by 3.3 volts and powered by 5 volts, this circuit is likely to be more reliable. Two mixed leds in series (including the one in the optocoupler) especially at 3.3 volts is not a good idea. The relay here is activated when the ESP pin is high.

https://arduino.stackexchange.com/questions/47235/can-i-use-a-3-3v-gpio-to-control-an-opto-isolated-5v-relay-board

If you redraw your schematic, try to group and cleanly separate the mains voltage, 5 volts an 3.3 volts parts of the circuit.

SoulG23

OK. If you want to build your own relay module, which can be triggered by 3.3 volts and powered by 5 volts, this circuit is likely to be more reliable. The relay here is activated when the ESP pin is high.

https://arduino.stackexchange.com/questions/47235/can-i-use-a-3-3v-gpio-to-control-an-opto-isolated-5v-relay-board

If you redraw your schematic, try to group and cleanly separate the mains voltage, 5 volts an 3.3 volts parts of the circuit.
In this schematic is the relay isolated from the ESP?

and Thank you for your help.

6v6gt

In this schematic is the relay isolated from the ESP?

and Thank you for your help.
The ESP  is isolated from the high voltage side of the relay. The 3.3 volt pin of the ESP is sufficiently isolated from the 5 volt circuit through a 1K resistor and a transistor.

SoulG23

The ESP  is isolated from the high voltage side of the relay. The 3.3 volt pin of the ESP is sufficiently isolated from the 5 volt circuit through a 1K resistor and a transistor.
Alright I will try it. Thank you very much.

SoulG23

#11
Jan 12, 2019, 05:21 am Last Edit: Jan 12, 2019, 05:21 am by SoulG23
OK. If you want to build your own relay module, which can be triggered by 3.3 volts and powered by 5 volts, this circuit is likely to be more reliable. Two mixed leds in series (including the one in the optocoupler) especially at 3.3 volts is not a good idea. The relay here is activated when the ESP pin is high.

https://arduino.stackexchange.com/questions/47235/can-i-use-a-3-3v-gpio-to-control-an-opto-isolated-5v-relay-board

If you redraw your schematic, try to group and cleanly separate the mains voltage, 5 volts an 3.3 volts parts of the circuit.


Correct me if I did something wrong.

WattsThat

You do not need U3, it is superfluous. R3 is too high, it should be 220 ohms for the relay used. The 2N3904 is not appropriate, too close to its max ratings. To select a far better switching transistor, do you have preference for surface mount or thru-hole devices?
Vacuum tube guy in a solid state world

6v6gt

#13
Jan 12, 2019, 11:35 am Last Edit: Jan 12, 2019, 11:49 am by 6v6gt
OK. If you are now using a "30Amp" relay instead of the original "10Amp" variant shown in the video, there will be some consequences. The coil current of this model is 185mA.

Are you using a buck converter for the 5v to 3.3v device or a voltage requlator ? Anyway, check the data sheet to see if it requires capacitors which are not provided elsewhere in the modules you are using.

If you insist on using an optocoupler, a current limiting resistor is also required for the internal led.

When it comes to PCB design there has to be a clear separation between the mains side and the low voltage side so there will be a stronger grouping of the relay, the input and output terminal block and the power converter input. I would begin to reflect this already on the schematic.

SoulG23

#14
Jan 12, 2019, 03:15 pm Last Edit: Jan 12, 2019, 03:18 pm by SoulG23
You do not need U3, it is superfluous. R3 is too high, it should be 220 ohms for the relay used. The 2N3904 is not appropriate, too close to its max ratings. To select a far better switching transistor, do you have preference for surface mount or thru-hole devices?
I rather use thru-hole devices.

OK. If you are now using a "30Amp" relay instead of the original "10Amp" variant shown in the video, there will be some consequences. The coil current of this model is 185mA.

Are you using a buck converter for the 5v to 3.3v device or a voltage requlator ? Anyway, check the data sheet to see if it requires capacitors which are not provided elsewhere in the modules you are using.

If you insist on using an optocoupler, a current limiting resistor is also required for the internal led.

When it comes to PCB design there has to be a clear separation between the mains side and the low voltage side so there will be a stronger grouping of the relay, the input and output terminal block and the power converter input. I would begin to reflect this already on the schematic.
https://www.ebay.com/itm/5pcs-DC-5V-to-3-3V-Step-Down-Power-Supply-Module-AMS1117-3-3-800MA-LDO-NEW/181847233524?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

This is the one I am using. It is capable of providing 800mA.

If the Optocoupler is not required I will remove it from the schematic.

Go Up