I think I understand. It looks like you only need the diode and the toggle of gpio0 if you want the esp to remain active after your trigger goes low again. Otherwise if you can rely on the trigger to stay high for the entire time you are communicating, you can just pull-up gpio to high and not use it, and simply trigger ch_pd. Note that the esp-01s has ch_pd pulled high with onboard resistor. You'd need to un-solder that for the s model.
If you have problems with the circuit not turning off, try adding a 10k pulldown resistor to GPIO12 --> ground. Had an issue with letting GPIO12 floating after the signal has endded. Hope it helps someone with the same problem. Did it for me.
@@debsahu7801 No I mean from GPIO12. As letting it float might make the chip stay online. Because the chip keeps thinking it is HIGH. However if pulling it to ground, this stops from happening. Did if for me on a ESP12F with a limit switch attached instead of a PIR. Edited comment above.
Can't we use D0 as input,i used and found that,initially it was high as i made it input pull up, when i made it low by momentary switch, it remained low? It took lot of time to find this bug. Please explain about this.
Thank you. I like your solution. Could you kindly explain the wiring crosses: 1) Green&Red line cross - connects or not? 2) Blue&Red line cross - no connection, right? 3) Blue&Green line (where diod) - connected, right?
Ok. I'm trying to repeat the project on nodecemu v2, made all connections, but task works once. How many Volts we should have on gpio0? Less than 3.3V due to diod voltage drop, right? I have 2,06V.
Hello. Do you measure the current and compare deepsleep with your CH_EN trick ? If CH_EN was pulled down with an resistor to GND and i disconnect 3,3V from CH_EN the ESP-07 not fully switched off ! A simple test sketch with LED on will show that the LED lights a little bit ! No connection to a gpio or other components where used. If the CH_EN is not connected to GND with resistor and i pull of the 3,3v from CH_EN the ESP will switch off. Currecnt in deepsleep is 0,015mA with this CH_EN trick with resistor 0,020mA and without resistor 0,002mA (i think) But you can not leave the resistor, GPIO also connected to GND if they set to LOW ? If i tested it with an GPIO only it was the sam. The LED is not fully of.
Hi, is it possible to use this sketch with the implementation of a wifi manager with captive portal? In which way is it possible to config same parameters, fore example the wifi ssid, wifi password, ip address and the mqtt credentials? I think that will be a very useful device for the IOT.
Topic - to turn esp on upon external interrupt. What is the main difference ? 1)turn on from deepsleep 2) turn on from power off mode(some kind of relay on vcc). Why not use second variant?
I am kind of looking for something like this, but is there a way to make it into a door sensor that can wake up for just enough time to transmit data when a loop is opened and shutdown then do the same after its closed?
hi there, im wondering if its possible to use 3 buttons with each one having independent task... example... 1 button sends an http request... another sends a diferent http request... by what i understand its resetting everytime it turns on and one task can be done.. am i wrong? or can you use this schematic with more than one button doing more than one task.
This is great and really useful. I have the system working nicely with a button to give the 3.3v. But when I connect a PIR sensor that outputs 3.3v it won't trigger the esp8266 to switch on. On the scope the on peak is really noisy so I added a diode and it cleans it up but still won't trigger the esp to turn on and drop the voltage below 3.0v. Tested with AM312 mini PIR, HC-SR505 PIR and HC-SR501 PIR. Give the same result. What am I diong wrong?
@@debsahu7801 Thank you for the super fast response. The 10k resistor reduces the width of the choppyness of the PIR high signal but still won't go above 3v and trigger esp on. If I add a diode in series it cleans up nicely but the voltage then drops to 2.7. the voltage coming from the PIR is a good 3.3 when tested on it's own as do the others I have and tested. I'm not sure what to do. I will try and amplify the signal with 2n2222... ?
Debashish Sahu.. Can you please explain how to set ip,gateway and subnet? I'm a beginner of those things. If you can explain with a example , it will really helpful. And can you tell whats the difference of ethClient and WiFiClient? I'm asking all about coding part.
Hi, I did some testing because I struggle to find clear detailed information about internal GPIO electrical specifications. It seems that the "CH_PD" enable pin has a pullup resistor of 12 KOhm. Maybe it's just the board (I used the ESP01 one by Ai-thinkers), but with this configuration, if I connect CH_PD to GND, I see a constant current flow from the pin to GND of 290 μA. Much higher than deep sleep current. Does this mean that keeping the ESP off by using the CH_PD pin is not a power saving effective solution? Thank you very much.
@@debsahu7801 hi Debashish, would it be possible if you could help me out with a similar layout but using the d1mini with 3 buttons sending an http request? thx mate.
Hey, thanks for this video, you knowledge is incredible. Could you please link to all parts used in this I'm struggling to find some of the parts. Also do you have a picture of the final soldered product? Thank you.
Could you kindly advice how do you program the board? Seeking for solution to connect it via Nodemcu (or Uno/or Witty) which already has 3,3V and usb for PC.
Hey Debashish, thank you so much for this circuit. I made it and it works fine. The only thing I noticed is that the bare bone ESP12E takes around 1.9 mA when CH_PD is pulled LOW while you mention that the current is around 3-4uA. Can you suggest what may be the reason behind it?
I am at present not using any voltage regulator, I do plan to use 7333A though in the final version. I am at present driving the ESP via the power supply of the UNO and measuring the current going into the ESP.
Thanks for clarifying, you're right. For some reason my ESP was drawing current, I reassembled the entire circuit and it behaves well now. The current draw is 2uA with CH_PD LOW. Thanks!!
I know this video is more than 2 years old. I have couple questions here but let me start with question #1) Where in your code are you putting the module into deep sleep? I just don't see it . Simply shutting down Wifi module does not offer you max power save.
@@debsahu7801 first off, thumbs up for an awesome video tutorial, I know it takes a lot of effort to make one. Sendondly, appreciate the fact that you respond to questions so promptly. Kudos my friend. Regarding the above statement by me some time back, what I meant is, I don't see ESP.deepSleep(0) code anywhere. All I see is, @ line #80, you are setting GPIO 0 to LOW when the signal at pirPin = 0 (GPIO 12) . When the 3.3v (@ signal end) is off GPIO 0 is pulled LOW and this will pull EN/CHPD LOW with it. Why are you setting GPIO 0 = LOW explicitly. Can you share a working demo? Please educate me here if I am misunderstanding. Thanks in advance :-)
Interesting but the usefulness is limited as you are depending on an external signal. That's fine if you use a pir, but not really possible if say you want to read a DHTxx sensor
Debashish Sahu Yes. Don't get me wrong it is a great solution for the right project. Apart from what you mentioned say a 'you got mail' indicator on yr letterbox comes to mind or any other application where a switch is monitored
Please take into consideration that ESP8266 takes about 80 mA of current only when the WiFi circuits on the chip are turned on and they are in the idle state. In the active state consumed current may increase considerably. ESP8266 takes typical 215 mA when transmitting data and this still not the possible maximum value which may be even 300 mA. Take a look at www.esp8266.com/wiki/doku.php?id=esp8266_power_usage
Thanks, for clarifying. By the way, you may use ESP8266 also without the voltage regulator. Most modules will work stable with the voltage as low as 2.2 V. When used with two lithium AA batteries with the initial voltage of about 3.4 V you might achieve one year of work until the voltage drops below 2.2 V.
I have a project what I've had already purchased the esp-01s for. I'm also using batteries and will need to save energy as much as possible. I found a way to cut down the energy consumption by making turn off instead of just deep sleep. The shut-off process is quite similar to the deep-sleep process, except that, while deep-sleep still consumes 7mA during the processes, the shut-off consumes nothing. The example of this method is shown in this video: ruclips.net/video/pPd362tRx5o/видео.html. For deep-sleep to work I need GPIO16 to connect to Rst, but for shut-off, I need 2 GOIP pins and I think 14 and 16 should work fine for it. Those two pins are the easiest to get to on the ESP8266EX chip so I'm planning on doing those. I have to do this for 23 ESP-01S and don't have enough time left to purchase the esp-12 to replace them. So, now I'm just looking for the easiest way to get this done. I noticed that you spoke of two ways to add the extra GPIOs, but you only showed one way. I think you said the way you showed was the harder way. Am I mistaken on this?
@@debsahu7801 i want to do the wake up on external interrupt to a esp01 because i want to have it really small.. i already managed to connect to a sensor with i2c.. so, how can i use PCF8574 to have access to other pins that i need for the interrupt? from the description i can understand that you connect PCF8574 with i2c to esp01 and in this way you can access the GPIO12 to put the interrupt?
@@debsahu7801 On ESP-01S, you also have Tx and Rx, which are GPIO-1 and GPIO-3 respectively. You could easily read 1 or 2 sensors, 3 if you disable the Blue LED. Am I misunderstanding?
@@debsahu7801 ESP8266-12E CH VCC ->FTDI VCC, RX -> FTDI TX, TX ->FTDI RX, GIPO 15 GND -> FTDI GND When I hold GPIO0 to GND the LED turns on continues blue and cannot flash
Great info... keep up the good work. I got my ESP8266 to only draw 1.3 micro amps at "rest" WOW!
Thanks
Sólo me he logueado para darte las gracias, este video ha sido la respuesta a meses de preguntas frustradas. Me ayudó mucho, gracias. Un saludo.
I think I understand. It looks like you only need the diode and the toggle of gpio0 if you want the esp to remain active after your trigger goes low again. Otherwise if you can rely on the trigger to stay high for the entire time you are communicating, you can just pull-up gpio to high and not use it, and simply trigger ch_pd.
Note that the esp-01s has ch_pd pulled high with onboard resistor. You'd need to un-solder that for the s model.
Any reason why to use a 1000uF and not something lower?
Thanks, very nice explanation, from the Dominican Republic
If you have problems with the circuit not turning off, try adding a 10k pulldown resistor to GPIO12 --> ground. Had an issue with letting GPIO12 floating after the signal has endded. Hope it helps someone with the same problem. Did it for me.
@@debsahu7801 No I mean from GPIO12. As letting it float might make the chip stay online. Because the chip keeps thinking it is HIGH. However if pulling it to ground, this stops from happening. Did if for me on a ESP12F with a limit switch attached instead of a PIR. Edited comment above.
@@debsahu7801 imgur.com/a/NzzCTZv uploaded a img of what i did. Hope it makes sense.
@@debsahu7801 Thanks alot. You have been a great help.
@@christofferschmidt2995 Thanks for the help!
Thx for the comment. I don't know why so a common problem is not in this video.
Can't we use D0 as input,i used and found that,initially it was high as i made it input pull up, when i made it low by momentary switch, it remained low? It took lot of time to find this bug.
Please explain about this.
@@debsahu7801 Yes NodeMCU
@@debsahu7801 Yes but in setup i already configured pins for intention i wanted to, issue with GPIO016 is once we give it low,it continues to low
Thank you. I like your solution. Could you kindly explain the wiring crosses:
1) Green&Red line cross - connects or not?
2) Blue&Red line cross - no connection, right?
3) Blue&Green line (where diod) - connected, right?
3.3V signal should be strong enough (>100mA) to start up the module? Or it's just control signal (
Ok. I'm trying to repeat the project on nodecemu v2, made all connections, but task works once. How many Volts we should have on gpio0? Less than 3.3V due to diod voltage drop, right? I have 2,06V.
Hello. Do you measure the current and compare deepsleep with your CH_EN trick ? If CH_EN was pulled down with an resistor to GND and i disconnect 3,3V from CH_EN the ESP-07 not fully switched off ! A simple test sketch with LED on will show that the LED lights a little bit ! No connection to a gpio or other components where used. If the CH_EN is not connected to GND with resistor and i pull of the 3,3v from CH_EN the ESP will switch off. Currecnt in deepsleep is 0,015mA with this CH_EN trick with resistor 0,020mA and without resistor 0,002mA (i think)
But you can not leave the resistor, GPIO also connected to GND if they set to LOW ? If i tested it with an GPIO only it was the sam. The LED is not fully of.
How much energy (micro amps) does the periodic pulse generator consume? Is the pulse generator a simple "555" type timer?
That's a very clean and simple circuit to achieve this, not bad at all.
Interesting way to accomplish a triggered on/off action.
Hi, is it possible to use this sketch with the implementation of a wifi manager with captive portal? In which way is it possible to config same parameters, fore example the wifi ssid, wifi password, ip address and the mqtt credentials?
I think that will be a very useful device for the IOT.
Topic - to turn esp on upon external interrupt. What is the main difference ? 1)turn on from deepsleep 2) turn on from power off mode(some kind of relay on vcc). Why not use second variant?
Hi, very good.
I am trying to use a wemos d1 v.3.0.
I can modify the circuit?
@@debsahu7801 thanks for the answer.
What about the esp 01s?
Hi can I use sw 420 closed vibration sensor with this ?
I am kind of looking for something like this, but is there a way to make it into a door sensor that can wake up for just enough time to transmit data when a loop is opened and shutdown then do the same after its closed?
I'm confused, why is there still a current of 3ma after EN is pulled down?
Usual draws are resistors and LEDs. Solder the LED out of ESP8266.
@@debsahu7801 Thank you for your reply, I will try.
hi there, im wondering if its possible to use 3 buttons with each one having independent task... example... 1 button sends an http request... another sends a diferent http request... by what i understand its resetting everytime it turns on and one task can be done.. am i wrong?
or can you use this schematic with more than one button doing more than one task.
Can I use 220uf 25v instead of 1000uf in your diagram?
Sure, see if you experience brownouts.
Excellent tutorial. With this how long can it run on battery? (Assuming 5 to 10 wakeup in a day)
This is great and really useful. I have the system working nicely with a button to give the 3.3v. But when I connect a PIR sensor that outputs 3.3v it won't trigger the esp8266 to switch on. On the scope the on peak is really noisy so I added a diode and it cleans it up but still won't trigger the esp to turn on and drop the voltage below 3.0v. Tested with AM312 mini PIR, HC-SR505 PIR and HC-SR501 PIR. Give the same result. What am I diong wrong?
@@debsahu7801 Thank you for the super fast response. The 10k resistor reduces the width of the choppyness of the PIR high signal but still won't go above 3v and trigger esp on. If I add a diode in series it cleans up nicely but the voltage then drops to 2.7. the voltage coming from the PIR is a good 3.3 when tested on it's own as do the others I have and tested. I'm not sure what to do. I will try and amplify the signal with 2n2222... ?
Debashish Sahu.. Can you please explain how to set ip,gateway and subnet? I'm a beginner of those things. If you can explain with a example , it will really helpful. And can you tell whats the difference of ethClient and WiFiClient? I'm asking all about coding part.
Hi, I did some testing because I struggle to find clear detailed information about internal GPIO electrical specifications. It seems that the "CH_PD" enable pin has a pullup resistor of 12 KOhm. Maybe it's just the board (I used the ESP01 one by Ai-thinkers), but with this configuration, if I connect CH_PD to GND, I see a constant current flow from the pin to GND of 290 μA. Much higher than deep sleep current. Does this mean that keeping the ESP off by using the CH_PD pin is not a power saving effective solution? Thank you very much.
Ok, no problem. Thank you for the superfast response! If I discover something new about this I'll let you know in the comments.
I dug further into it and now I'm pretty confident that the pullup resistor is placed right on the ESP01S board.
Guido I have the same problem with my ESP 01S board. Do you find a solution? Maybe removing the CH_PDs pull up resistor?
is it possible to connect multiple buttons for multiple signals... each sending a diferent message to mqtt
thx
@@debsahu7801 hi Debashish, would it be possible if you could help me out with a similar layout but using the d1mini with 3 buttons sending an http request? thx mate.
is there any link on the exact board from the video? or similar cheap and prepared?
Nice info, thanks for sharing it :)
Hey, thanks for this video, you knowledge is incredible. Could you please link to all parts used in this I'm struggling to find some of the parts. Also do you have a picture of the final soldered product? Thank you.
Hey, thanks for this video, you knowledge is incredible
Is there a way to send a message back to home assistant after the signal has dropped saying it is cleared again
drive.google.com/open?id=1SE20i0ZCu1bYyM_Y532ppEoquFF51DBO
and thanks for the help i would email you but no email listed and tried hangout too
Could you kindly advice how do you program the board? Seeking for solution to connect it via Nodemcu (or Uno/or Witty) which already has 3,3V and usb for PC.
www.aliexpress.com/item/ESP-12F-burning-fixture-development-board-ESP8266-without-ESP-12F-module/32812849093.html
@@debsahu7801 Agree. I have both. But if you want just "plug-and-play" this is the solution. IMHO.
Hey Debashish, thank you so much for this circuit. I made it and it works fine. The only thing I noticed is that the bare bone ESP12E takes around 1.9 mA when CH_PD is pulled LOW while you mention that the current is around 3-4uA. Can you suggest what may be the reason behind it?
I am at present not using any voltage regulator, I do plan to use 7333A though in the final version. I am at present driving the ESP via the power supply of the UNO and measuring the current going into the ESP.
Thanks for clarifying, you're right. For some reason my ESP was drawing current, I reassembled the entire circuit and it behaves well now. The current draw is 2uA with CH_PD LOW. Thanks!!
Good walkthru!! Thx.
I know this video is more than 2 years old. I have couple questions here but let me start with question #1) Where in your code are you putting the module into deep sleep? I just don't see it . Simply shutting down Wifi module does not offer you max power save.
@@debsahu7801 first off, thumbs up for an awesome video tutorial, I know it takes a lot of effort to make one. Sendondly, appreciate the fact that you respond to questions so promptly. Kudos my friend. Regarding the above statement by me some time back, what I meant is, I don't see ESP.deepSleep(0) code anywhere. All I see is, @ line #80, you are setting GPIO 0 to LOW when the signal at pirPin = 0 (GPIO 12) . When the 3.3v (@ signal end) is off GPIO 0 is pulled LOW and this will pull EN/CHPD LOW with it. Why are you setting GPIO 0 = LOW explicitly. Can you share a working demo? Please educate me here if I am misunderstanding. Thanks in advance :-)
Interesting but the usefulness is limited as you are depending on an external signal. That's fine if you use a pir, but not really possible if say you want to read a DHTxx sensor
Debashish Sahu Yes. Don't get me wrong it is a great solution for the right project. Apart from what you mentioned say a 'you got mail' indicator on yr letterbox comes to mind or any other application where a switch is monitored
Debashish Sahu can this be used with a motion sensor or a temp sensor or power meter
Can't you just do a periodic wake up using an external RTC?
Please take into consideration that ESP8266 takes about 80 mA of current only when the WiFi circuits on the chip are turned on and they are in the idle state. In the active state consumed current may increase considerably. ESP8266 takes typical 215 mA when transmitting data and this still not the possible maximum value which may be even 300 mA. Take a look at www.esp8266.com/wiki/doku.php?id=esp8266_power_usage
Sure, but the used regulator HT7333-A might not provide enough current for transmitting data in the worst case scenario.
Thanks, for clarifying. By the way, you may use ESP8266 also without the voltage regulator. Most modules will work stable with the voltage as low as 2.2 V. When used with two lithium AA batteries with the initial voltage of about 3.4 V you might achieve one year of work until the voltage drops below 2.2 V.
Please, how can I use the ESP8266 ESP-12E with Arduino Mega? thank you so much
Is there any way or anybody you can tell me how I can add this to homeassistant to show up in the dashboard the configurator file
Hi.. Great video.. Thank you so much for making it.. Can this work with a ESP-01S? If so, what would be different?
I have a project what I've had already purchased the esp-01s for. I'm also using batteries and will need to save energy as much as possible. I found a way to cut down the energy consumption by making turn off instead of just deep sleep. The shut-off process is quite similar to the deep-sleep process, except that, while deep-sleep still consumes 7mA during the processes, the shut-off consumes nothing. The example of this method is shown in this video: ruclips.net/video/pPd362tRx5o/видео.html.
For deep-sleep to work I need GPIO16 to connect to Rst, but for shut-off, I need 2 GOIP pins and I think 14 and 16 should work fine for it. Those two pins are the easiest to get to on the ESP8266EX chip so I'm planning on doing those.
I have to do this for 23 ESP-01S and don't have enough time left to purchase the esp-12 to replace them. So, now I'm just looking for the easiest way to get this done.
I noticed that you spoke of two ways to add the extra GPIOs, but you only showed one way. I think you said the way you showed was the harder way. Am I mistaken on this?
What diode did you use?
@@debsahu7801 i want to do the wake up on external interrupt to a esp01 because i want to have it really small.. i already managed to connect to a sensor with i2c..
so, how can i use PCF8574 to have access to other pins that i need for the interrupt?
from the description i can understand that you connect PCF8574 with i2c to esp01 and in this way you can access the GPIO12 to put the interrupt?
@@debsahu7801 thank you!
@@debsahu7801 On ESP-01S, you also have Tx and Rx, which are GPIO-1 and GPIO-3 respectively.
You could easily read 1 or 2 sensors, 3 if you disable the Blue LED.
Am I misunderstanding?
Debashish well explained,can you make a video on flashing esp 12E
@@debsahu7801 ESP8266-12E CH VCC ->FTDI VCC, RX -> FTDI TX, TX ->FTDI RX, GIPO 15 GND -> FTDI GND When I hold GPIO0 to GND the LED turns on continues blue and cannot flash
@@debsahu7801 thanks
Good project.
Sir, can you please confirm, do I need to set up local mqtt broker for this .
Please reply, how to get this done.
Thanks
👍🏻
Excelente aula mas você não terminou..mas parabéns por iss9 te dou 10.000 likes
Great
ok
Copy and paste of Andrew species