ESP Easy Mega & Relays state on startup/reboot

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
essential
New user
Posts: 1
Joined: 22 May 2017, 00:54

ESP Easy Mega & Relays state on startup/reboot

#1 Post by essential » 22 May 2017, 01:13

Hi,

i use ESP Easy Mega with two relays (SRD-05VDC-SL-C).
On startup/restart both relays are "closed/active" (D4, D5), but i need both of them "open".

Set D4 and D5 in the hardware section to "Output low" does the trick, but both relays are still open for a second on reboot :?:

How can i prevent this?

Thanks a lot
Stef

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP Easy Mega & Relays state on startup/reboot

#2 Post by Shardan » 22 May 2017, 14:35

Hello,

i'm in doubt if you can prevent this at all.
While the chip boots up it does several internal checks and Settings.
I'm not sure what the ESP8266 does while for example initializing Registers.

D5 (GPIO14) is double assigned internally, it is shared with HSCLK. Should be OK while normally running, but what this does on startup is questionable.

D4 (GPIO2) has multiple assignments. It's shared with a secondary Serial (TXD1) and it is used as one of the boot selectors.
GPIO2 must be high at startup for booting from the internal flash.

For a try you might use D1/D2 (GPIO4/GPIO5) for this as These don't have too much internal assignments.
Chances are that starting up doesn't do much on these pins. You may have to move I2C to other pins if you need it.
But i doubt if that would change anything. It might be a better way to delay the relays on startup.
Should be possible with an NE555 (cheap analog timer) just giving the relay coils (or the opto couplers, if your relay board uses them) delayed power.

If you need a schematic let me know which relay boards you use, i'll see what i can do.

Regards
Shardan
Regards
Shardan

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: ESP Easy Mega & Relays state on startup/reboot

#3 Post by toffel969 » 24 May 2017, 15:27

essential wrote: 22 May 2017, 01:13 Hi,

i use ESP Easy Mega with two relays (SRD-05VDC-SL-C).
On startup/restart both relays are "closed/active" (D4, D5), but i need both of them "open".

Set D4 and D5 in the hardware section to "Output low" does the trick, but both relays are still open for a second on reboot :?:

How can i prevent this?

Thanks a lot
Stef
Use i2c port expander. They even hold their state when esp reboots.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests