[terenceang] got his feet wet with the ESP8266 WiFi module by hacking up an IKEA Molgan PIR light. The stock PIR light simply lights when motion is detected. [terenceang] added some extra functionality to it by making it send notifications to his phone as well.
The default configuration of the stock PIR light was to only work at night. This is done with a photo diode. It was removed to make it work in daylight, along with several other components. He removed a handful of current limiting resistors to disable the hi output LEDs. One was preserved as a visual indicator. The onboard voltage regulator didn’t supply enough current for the ESP8266. [terenceang] used some electronic wizardry and was able to solve the problem with an opto-coupler.
The one thing he would change is moving from battery to mains power, as expected battery life is less than two weeks.Schematics, source code and tons of great pictures are available on his blog. If you want to give it a try but need a crash course check out the recent news that the Arduino IDE works with ESP8266, or give direct programming a try.
The way this post is written makes it seem like the opto-coupler is somehow used to increase the max current of the original regulator. That would definitely be some electronic wizardry. Unfortunately the opto is just used between the 4.5 V led output and the 3.3 V ESP8266, which is powered from a separate regulator.
Hmm… Perhaps some sort of feedback circuit with smoothing with lots of losses? [joking]
But the REG1117 has a power consumption of 4mA typical which will drain the battery quite fast. Why not use a simple NMOS switch driven by the output of the sensor directly and switch both the regulator and the ESP?
Why is there a big capacitor on ESP8266? Is it common usage?