ESP01 1CHANNEL Relay, help appreciated

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

ESP01 1CHANNEL Relay, help appreciated

#1 Post by hemant » 22 Mar 2020, 17:44

Hi M8's

I have a ESP01 1 channel relay V1.0. This is hooked up to my Garage with 1 reed switch and the door itself to NO/COM.

All works from a control perspective and I can open/close with DOMOtiz/Homebridge and Homekit.

There is however only 1 issue, i get a small pulse during a powercycle which triggers the door to open which is not something I want.

I Tried to add 4.7k/10K/15 resistor between GPIO0 and 3.3 VCC, but it still gives a short pulse, it is not a software issue it is something in the hardware, can I fixed this and would someone be able to explain how?

My interim solution is to have a backup battery currently attached but would love o fix the issue itself.

Cheers,
Hemant

TD-er
Core team member
Posts: 2333
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP01 1CHANNEL Relay, help appreciated

#2 Post by TD-er » 22 Mar 2020, 18:47

Well if it is a really short pulse, you can try to filter it using a capacitor + resistor.
I assume the relay is often on/off for a longer period, so it would not make much of a difference for normal use.
It may delay the on/off action a bit, so if you need exact timing, you may need to tweak it then after adding the R/C filter.

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#3 Post by hemant » 22 Mar 2020, 19:43

Hi,

Thanks for your reply.

I have a resistor between chpd and 3.3v 10k
Also a resistor between 3.3 and gpio0 15k

But did not solve the issue. Pluse is about .5 sec which is not much but enough to trigger the door.

Where would the capacitor go? And what would be the spec of the capacitor 1000uf ok?

Which pins pos/ neg would i need to place the capacitor?

Thanx,
Hemant

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP01 1CHANNEL Relay, help appreciated

#4 Post by ThomasB » 22 Mar 2020, 19:44

I have a ESP01 1 channel relay V1.0. {snip-snip} i get a small pulse during a powercycle which triggers the door to open
Momentary relay activation on power-up reset is a problem reported by other users of that board.

Here is the schematic of the V1 board. There are other clone variations, so be sure to confirm this schematic matches your hardware.

ESP_relayV1.png
ESP_relayV1.png (53.03 KiB) Viewed 413 times

The R2 resistor was intended to prevent the relay activation on reset. But when it is installed the board cannot boot. So it is not suppose to be installed.

If I owned this board I would:
1. Remove R1 (and R2 if installed).
2. Install a 10K resistor that connects GPIO0 to 3.3V (GPIO0 pullup to ensure correct boot mode).
3. Install external resistors that replicate the R1 and R2 on the Q1 base.
4. Use GPIO15 to activate the relay.

As an alternate, you can use the existing R1/R2 resistor locations and cut the GPIO0 trace. Then jumper GPIO15 to the relay transistor. But plan on adding a pullup to GPIO0.

- Thomas

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#5 Post by hemant » 22 Mar 2020, 19:59

Hi,

Already have a 15k between gpio0 and 3.3

Did alteady remove r1 10k from the board.

Where is gpio15?

Would it not break the board removing r2 2k resistor?

Hemant

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#6 Post by hemant » 22 Mar 2020, 20:01

Would a capacitor help between 2 and 3?

Hemant

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP01 1CHANNEL Relay, help appreciated

#7 Post by ThomasB » 22 Mar 2020, 20:31

Would it not break the board removing r2 2k resistor?
If the relay board has R2 installed and it is 2K, then your board is a different revision or clone variant than the schematic I posted.
Where is gpio15?
It is a pin on the ESP8266 chip. Requires good soldering skill to do the soldering.
Would a capacitor help between 2 and 3?
If you mean pins 2 & 3 on the relay, then adding a big cap across the relay coil is not recommended. The cap would act as a momentary short on the transistor driver, which is unhealthy.

- Thomas

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#8 Post by hemant » 22 Mar 2020, 20:36

Sorry r1 is 2k r2 is 10k which i removed to get the esp01s working on this board.

My solder skills are not that wel, other options?
Hemant

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#9 Post by hemant » 22 Mar 2020, 20:37

By the way there is no current on the relay. It is used to simulate the pulse on the garage

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP01 1CHANNEL Relay, help appreciated

#10 Post by ThomasB » 22 Mar 2020, 22:33

Sorry r1 is 2k r2 is 10k which i removed to get the esp01s working on this board.
My solder skills are not that wel, other options?
If the stuffed part at Q1 is really a MOSFET, such as a 2N7002, (confirm this before proceeding) then try this:
1. Change R1 to 10K. Change GPIO0 pullup to 1K.
2. Add 100uF electrolytic cap from Q1 gate (Q1/R1 junction) to Gnd. Positve on Q1/R2.

This RC circuit reflects TD-ers recommendation to filter out the brief unwanted activation during reset. The 100uF cap value may need to be altered to obtain the best turn-on delay, so prepare to experiment. Keep in mind that turn-off time will increased due to the RC circuit.

- Thomas

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#11 Post by hemant » 23 Mar 2020, 13:12

Hi,

I guess I can resure 10k from R2 and put it on R1.

100uf, could I use 1000uF en what would be the impact?

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP01 1CHANNEL Relay, help appreciated

#12 Post by ThomasB » 23 Mar 2020, 16:18

100uf, could I use 1000uF en what would be the impact?
It will increase the activation time (longer time before relay turns on, longer time before it turns off). Expect several seconds.

- Thomas

TD-er
Core team member
Posts: 2333
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP01 1CHANNEL Relay, help appreciated

#13 Post by TD-er » 23 Mar 2020, 18:48

Please note that charging/discharging of a capacitor does involve energy flowing in one or the other direction.
This may sound very obvious, but it is something to take into account when the resistor is somehow shorted.
So when possible use a larger resistor to increase the RC-time instead of increasing the capacity.

After all, an empty capacitor will look like a short circuit when you charge it.
So better make it as short as possible in the worst case scenario where the resistor may be shorted or something else is connected to the output of that capacitor and not protected by a resistor to limit the current.

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP01 1CHANNEL Relay, help appreciated

#14 Post by ThomasB » 23 Mar 2020, 19:22

Agreed, good info about charge/discharge current. In this example the 10K resistor limits current to 330uA, so it is minimal.

- Thomas

hemant
Normal user
Posts: 10
Joined: 22 Mar 2020, 17:34

Re: ESP01 1CHANNEL Relay, help appreciated

#15 Post by hemant » 23 Mar 2020, 19:41

Hi all,

Added 10k to r1 en hooked up 100uf.
The relay is working now as it was supposed to.

No more pulse during diconnect.

Thanx for all the help great forum!

Now worked to fix my next challenge to getting this in homebridge weer reed switch and relay control.
Cheers,
Hemant

User avatar
ThomasB
Normal user
Posts: 614
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP01 1CHANNEL Relay, help appreciated

#16 Post by ThomasB » 23 Mar 2020, 21:10

Good to know you resolved the problem.

- Thomas

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests