Chat freely about anything...

User avatar
By donnib
#40469
Sprite_tm wrote:
spants wrote:
Sprite_tm wrote:Now to clean up the code a bit and do a small-ish writeup on how it works.


Please dont forget about this! I'm trying to build a button and need the poweroff circuit (oh - and an idea on the software!!!).

Love your website btw - lots of amazing stuff!
Tony



I'm not - I just have another article in the queue that I need to finish first. I'm documenting as quickly as I can ;)

The button schematic basically is this: http://j0h.nl/-1QB
The IRLM is the main switch and when the button is pressed, the gate of it will be pulled down through the diode (which is some kind of schottky - I forgot which, but it probably doesn't matter) and gives power to the ESP. The 'power on' line is a GPIO which does have a pull-up that's already enabled in the boot ROM of the ESP - I think it's GPIO2. This will turn on the BSH111, which will keep the power flowing. Because of the diode, when the button is released the BTN input of the ESP will get high as soon as the button is released, which is how I can detect if the button is pressed only once or is kept pressed. I can also detect a new button press to cancel whatever's going on and go back to sleep.


@sprite_tm Could you share the code for this project ? Or if it is shared can you share the link to it ? Would this design also work with a PIR such as https://goo.gl/LIi1bi ?

Also what is the purpose of IRLM6402 and BSH111, i mean why are those components needed ? In this other post viewtopic.php?f=11&t=4458 it seems that a diode can do it but i am sure there is a reason, added functionality or making it more stable ?? also would it be possible with a schematic that shows the esp8266 (i guess the esp8266 is the box ?)