ESP8266 and Optocouplers HELP!!! ???SOLVED??? - Page 1
Forum section: electronics / beginners

author: espfan
author_rank: Newbie
timestamp: January 07, 2018, 06:34:01 pm
content: Im just starting my first electronics project using an esp2866-01 to turn my PC on and off initially over wifi but eventually using an amazon echo.So far i have coded the esp (copied someone else's code) and i am turning an LED on and off through a 4N35 optocoupler simulating the power button the PC which works a treat. Schematic attached - my first use of KICADThe problem I have is when the esp is powered on both the output pins gpio0 and gpio2 (im using pin2 to controller the 4n35) are sent high for a split second while the chip starts up which would switch the computer either on or off before the chip connects to wifi and i issue a command.My question is, is there some circuitry i can put in after pin 4 of the optocoupler and before the LED to remove this pulse. From what i have read this isnt possible using code as it happens before any of the code is ran.If anyone could point me in the right direction to do some research into fixing my problem that would be great.

author: espfan
author_rank: Newbie
timestamp: January 07, 2018, 10:50:00 pm
content: I might have solved my problem with the simplest solution imaginable.In between poking my fingers in sockets and watching cats on youtube I decided to put a 50uf capacitor in parallel with the led on pin 4 of the opto. This (visually) stop the LED blinking on power up but obviously slow the on and off time.In the future I will be replacing the LED with the power on button of the PC in parallel so that it is still functional when I don't want to use Alexa. I guess I will just have to hope that this works.Any ideas if this will work, am I on the right track?

author: danadak
author_rank: Super Contributor
timestamp: January 07, 2018, 11:17:25 pm
content: The problem with this approach is that the ultimate signal into the PClogic may have such a slow rise time to cause instability on its inputpin,k which can have unpredictable results.Here is a thread where people found solutions to deal with this issue -https://community.blynk.cc/t/on-boot-up-pins-go-high/10845/19https://github.com/nodemcu/nodemcu-firmware/issues/421http://www.esp8266.com/viewtopic.php?f=32&t=16141Regards, Dana.

author: espfan
author_rank: Newbie
timestamp: January 07, 2018, 11:57:55 pm
content: Thanks Dana,I did see one or two of those posts and concluded it wasn't something I could code around. The boards mentioned in those posts have a few different outputs some of which stay low on boot up, mine only has 2 which both go high. Because of this I decided it would be best to sort it out electrically.I thought it would be more appropriate to post this under the Projects, Designs, and Technical Stuff so I also posted there - Sorry first time forum userAnyway moffy had a great suggestion, which I think is also mentioned in one of links you attached, which was to use an RC filter and a transistor which I am going to look into tomorrow. I did have a quick play with this and got the on time 'instant' with no pulse at start up but more research is needed.My electronics knowledge as I sure you can tell is, lets say, limited but so far its good fun and I haven't burned the house down!Thanks for taking the time to help me.Robin