0 votes
by (140 points)
Hi, i am facing issues while using esp8266 in one of my project, i have tried to explain the issue as follows, kindly see if you can advise me on it:

I am using 1-esp8266-01, 1-PIR motion sensor(powered using a dedicated power source, not shared with esp power) and 1-relay switch(powered using a dedicated power source, not shared with esp power)

The project is about - read any motion detected by the PIR motion sensor and accordingly, put an AC powered Light or a Fan on or off with the help of relay switch.

Since the issue is many folds, i have divided my issue in parts:

Part-1.Startup issue - While reset/restarting the esp chip, i have noticed a particular behaviour i.e., i need to remove connections to all the other components with esp, let esp bootup and then setup the connections with esp back again while esp is running.

Not sure if this is the way to use esp with other components, if so, in a practical project, the expectation with the system will be, it should come back online on its own, in case of any reset, rather than pulling all the connections off and then back on.

2. Execution issue - With all the connections in place, if i try to control GPIO0 and 2 together at the same time, the esp gets reset and the Startup issue as described above is faced.

Not sure if i can use both the GPIO's at the same time, or i should have a time gap in between in setting both the GPIO's.

Appreciate any response on the issues.

Thanks

AK

2 Answers

0 votes
by (10.0k points)
Hi AK

The ESP-01 is very limited in available GPIO pins and if I remember correctly they are both involved in re-programming the FLASH memory. So it doesn't really surprise me that you have to disconnect the relay and the sensor in order for the chip to boot up, or it will end up in flash mode. Having said that, have you considered to start with a dev module like the NodeMCU v.1 to get it running stable first? Once you have that you can still switch to a smaller module like the ESP-01...

Dani
by (140 points)
thanks a lot Dani for your comments, since i am pretty new to this area, my apologies and with all due respect, i was not able to get the most out of the reply. I successfully flashed micropython onto the chip and its working fine with it.
With continuous head banging(literally), I was able to get the root cause of the issue and the culprit is the relay switch, if i power the relay switch with 5V supply, the whole setup crashes on trying to do HIGH/LOW on GPIO connected to the relay, but, if i power the same relay with 3.3v, the setup works fine, except the electrical device connected to the relay, although signal goes from esp to the relay, but the power(3.3v) is not not enough to move the switch inside the relay. Also, with 3.3v of supply, the whole setup works even on multiple restarts it come back up without any issues.
Now i am trying to figure out how to resolve the power issue.
0 votes
by (2.9k points)

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...