Not really, the idea is the LED light can be powered by any power bank. And the flashlight or small LED is also connected to Internet to turn on/off remotely. The flashlight is not best candiate for this approach, but this may be suitable for USB adapter laying around. You can you plug a small LED to USB port and light up temperary.
But first, yes, I used that buzzword, aka IOTs, but this one could make a good combination of using the circuit in Step 2 with an ESP8266 and then control the light intensity by MQTT method.
Three components for IOT system are:
We need to add some parts as well:
The limiting current circuit is identical to the previous one for a flashlight. We added a ESP8266 to send a Pulse-Width Modulation (PWM) signal to the Gate of the MOSFET when the switch is in default mode. If the switch is pushed, the Gate is pulled up, and the light is turned on. Small LED attached GPIO 0 as the indicator of the PWM signal.
I highlighted the line to show the topic that the subscriber subscribed to. Any message posted to this topic will be passed along to other clients (subscribers) to this topic. The EPS8266 in this circuit will listen to the JSON message posted to the topic and sparse out if a change was made in channel Three.
* once upon a time: When connecting the Gate to GPIO 0, I were worry that without the ESP8266 in place, the voltage of GATE is dangling that makes to light turn on/off quickly and produces fuzzy light. So I thought I could put a pull-down resistor (100k) to ground the Gate of the MOSFET just in case the ESP8266 was not presented. This works in the absence of an ESP8266, but with ESP8266, the resistor also pulls down the GPIO 0 to GND, making them into a Flash mode or not boot up (when GPIO 2 is LOW)). You will see a solid green if this happens. So far,I have pulled the plug if the ESP8266 is not present.