Awhile back this post asked about providing 3-4 seconds of power to an NodeMCU subsequenst to a loss of its primary power supply.
I have a similar need except I only need a split second of power. I tried using a 1000uf capacitor but that did not work. Is a supercapacitor reasonable to try.
I attached a diagram of the set up. I am not an EE and apologize if the diagram is not proper form.
The context of the application is a model train getting 18V power from the railroad track. The 18V is stepped down to 5V with a regulator and used to supply the NodeMCU at Vin. The NodeMCU is used to control the train. When the train passes over a track switch it can interrupt the power for a split second, enough to shutdown the NodeMCU.
I do not want to use a battery to cover the interruption and hoping I can simply insert a capacitor.
One other question. Assuming the super capacitor works, if the regulator was supplying say 9 volts, would the immediate drop the 5.5 V of the capacitor be a problem. Te NodeMCU has a a regulator on board and I am thinking it could handle this. Again, the disruption is perhaps 1/10th - 2/10ths of second.
Thank you for your replies.
I am using a Rohm linear voltage regulator. BA50DDoT
I will give the 1000uf a try in front of the regulator.
I will also try the code suggestions.
I did some more digging on power consumption.
for those interested, this video is informative. The second half show the NodeMCU.
Your replies greatly increased my understanding of the power issues.
Thank you all.
YouTube on ESP Power Consumption