#101
HTML-код
- Опубликовано: 6 сен 2024
- In this video I show how to build devices which do not use any energy during "deep sleep" and so can be used for a long time. The only prerequisite: A mechanical activation through a button or a magnet.
Links:
ESP8285: www.itead.cc/w...
Reed Relay: www.aliexpress...
If you want to support the channel and buy from Banggood: bit.ly/2jAQEf4 (no additional charges for you)
/ andreas-spiess-7331894...
/ spiessa
I've had an ESP8266 in my postal mailbox for sometime. It uses the same concept. When the mailman opens the box, it powers up the ESP8266 and keeps the power on until done sending a message. I've enjoyed your videos and they have inspired me to do more projects.
I have the same "mailbox" problem, but mine must be worse: The distance to my mailbox is too big for my WiFi net.So, I not only do not get a notification, I also have to walk far ;-)
This is, why I will try to use LoRa for this purpose. It should be able to go so far.
I had to use a homemade external antenna since the box is metal. It pokes out the bottom and is not very visible. I also had to put it into a styrofoam box to average out the temperature. It's too hot on summer Texas days for the processor.
The temperature part is not so important here. But I think, I also have to use the external antenna concept.
It is so small. Have you thought about fixing the processor to the underside of the mailbox so you only have to deal with ambient air temperature and not the temp in your solar oven...I mean mailbox?
Inspired! Been concerned with the irregularity of the mail service and this is the perfect idea! Also, allows me to do some statistics :)
This is my comment to help your channel. Keep doing such a good stuff. Greetings from Poland!
+cbm80amiga Thanks for your support. If I remember right, you are one of my early subscribers.
Right!
Still have a old Amiga.
Im doing my Part!
Very smart. I had very similar project back in 2007 and I used an external RC circuit to wake up the MCU via IRQ pin. When the Switch is pressed and the Cap is charged the MCU wakes up via the IRQ pin. When the Switch is released the Cap is discharged via R and the MCU is powered off. So you press the Switch and the Cap charges via the Resistor, it reaches the trigger level - when you release the switch the Cap begins to discharge until the MCU is shut down. It worked perfect - I didn't care about time precision for when the MCU should shut down. You may use an SCR device with low channel resistance (and a Darlington Transistor - if having weak signal coming from somewhere) as well.
The WiFi connection sometimes can take a long time. This is why I decided the CPU has to switch the power off only when the job is done.
BTW: I made a very similar device where I deep-sleep the device instead of switching it off. Similar to your example, I think.
@@AndreasSpiess That makes sense - thank you.
We have a side gate at our house that the kids are forever leaving open, for ages I've wanted to fit some kind of sensor to warn us when it's been left open, but without power I was stuck how to solve it. With the idea in this video to use a relay to let the processor control when it switches off is just what I need, Thanks Andreas.
You are welcome!
Brilliant idea to deploy mosfet/relay instead of deepsleep. Wonderful. Thank you so much!
You are welcome!
In the case where a voltage regulator is used, a model with an enable (CE) pin is advantageous. The power latch GPIO can be connected to the CE instead of an additional mosfet.
+tmk670 Good point. Did not think about that. But I got some new LDOs with CE. Will try it once.
Would be interesting to see as well, if you manage to make a video on that subject later on! :)
You never know... I have no "production plan"
1 year after, there is a video of this?
This was an interesting concept. The ESP8266 really got me interested in programmable microcontrollers again. Having such easy wifi connectivity is awesome.
+Perspectologist You are right. It enables a whole new world of possibilities. Thats why I use it quite often
I've been saving this video for awhile and finally have used for my mailbox notification setup! I am using with a WeMos D1 Mini because I will need an external antenna. However, I found that while the mosfet (NDP6020P) would turn the WeMos off, that it continued to draw current (not sure how much). The only thing that stopped it was removing the battery or pressing the WeMos reset button. My solution was to use ESP.restart(); in lieu of digitalWrite(4, HIGH) to "turn off" the mosfet. Just thought I'd share. Thank you Andreas.
I think, you used the 5V supply. Then, the Mosfet does not turn off, because the ESP delivers only 3.3 volt when high and you still have a negative voltage on the gate (5 - 3.3 = 1.7 volt). Figure 5 in the Mosfet datasheet says, that the transistor is only off if you have less than 1 volt..
My proposal runs on 3.3 volt.
I'm glad you mentioned this as that was originally what I had done, but noticed the condition persisted with 3.3v. I'll have to take some measurements and see what's going on. Might be a peculiarity of the WeMos.
Just wanted to mention that I rewired this morning and it works just as your example does! My possibilities for getting it wrong are limitless! :) Thanks again.
+structure7 :-)
Brilliant, elegant simplicity. I have a sensor gizmo that uses an ESP8266 to take readings every 30 minutes. I use deep sleep (timing isn't critical), a LiPo battery and a solar panel. To move this out of the sunshine, I'm thinking I could use a clock with alarm function to trip the relay.
As long as you have a mechanical movement it will work... But with a solar panel, deep sleep should also be ok, I think. Unless your have sensors which cannot easily be switched off.
Perfect for an alarm for door left open on the old refrigerator in my garage. Thanks, and Happy Sechseläuten!
Cool idea! I live in Basel and we have to work during Zurich's Sechseläuten :-(
I live in the Puget Sound area of the US, and saw the holiday celebrated on a public television program. I will visit Switzerland someday if I can.
Drop me a note if you do so...
I have used a similar concept for my mailbox but instead of just a p-channel mosfet I also added an ATtiny85. It waits in deep sleep for an external interrupt (or two) and powers the ESP8266. When the ESP is done is signals the ATtiny to go into deep sleep. In deep sleep th ATtiny and mosfet together use less than 1uA. With the ATtiny you can have more than one interrupt like for on and off buttons. So the same circuit can be used to trigger two separate functions.
That is a very good idea if you need more than one input or if you want to include some logic.
The relay is a brilliant idea.
:-)
Thank you for doing unusual things with the 8266. There are thousands of videos of people doing all the same thing. Good job doing something different.
Thank you for your feedback. Adding the same does not create value, only work ;-)
I really enjoy watching your channel. I think it has something to do with the way you explain things. Please keep the videos coming, as long as you enjoy making them. Cheers!
Thanks for your nice words. They help in going on the route
This is one of my favorite youtube channels, although I'm a Spanish, I like your accent. Thanks you so much for you videos. I'm so glad to recommend your channel.
The newer videos have Spanish subtitles, if this helps.
@@AndreasSpiess no problem, I'm learning English and I understand you :) , the most at least. Anyway thank you so much for subtitles.
Can’t stop myself watching your channel this morning - it gives so much ideas! Thanks a lot for this.
You are welcome!
Now that dash buttons aren't sold anymore this is a good tool for my needs
:-)
If the I/O port of the microprocessor on which you connect the resistor has reversed protection diodes build in, you can actually power the internal VCC of the processor through that port and that internal diode. The internal VCC voltage the processor will have is going to be a bit lower (battery - Vinternaldiode - Vresistor) but will often be enough to keep the processor running.
So your fet and resistor idea will not always work; the processor is not guaranteed to turn off.
I had this problem once and it took me ages to find the fault. I solved it by using a transistor to switch the fet.
I don't know if the ESP8266 has protected I/O's but even if it has, because it's so power hungry the voltage drop across the resistor might be high enough not to turn the ESP8266 fully on. Still... wouldn't you get a constant current drain through that resistor as if almost it were tied directly to ground?
Dave Jones from the EEVBlog made a video (#831) on it: ruclips.net/video/2yFh7Vv0Paw/видео.html
I used a 10k resistor and measured the current (with Dave's uCurrent). It was between 1 and 2 uA with the big FET. So, I did not care too much about the effects you describe. Maybe, I was just lucky. And I am also lucky because I do not have to build devices for sale. This would of course need much more testing.
Thanks for the explanations. If I run into the same problem as you, I hope I will remember your post...
I did a project where a microcontroller turns itself off,
www.davidpilling.com/wiki/index.php/NiMNiMNiMNiMNiMH
Refers to another Dave Jones circuit, more complicated than 1 FET.
I will read your articla. Thanks for the link.
A comment to support this channel that helps me disposer the esp world. Thanks
Thanks for your support!
Thanks for all your videos, Andreas! They've been very helpful to help me understand what can be done with ESP8266 and Arduino in general.
You are welcome!
How did I not think of this? It's a brilliant method.
Thanks! We have a saying here: Somebody is always getting up earlier in the morning ;-)
I don't always have as much time for tinkering around as I want, so then I watch your video instead. Thanks!
+Ruben Lensvelt So, I am somehow "virtual reality" for you ;-)
This kind of projects are why I think ESP8266/8285 will be a good fit for a long time, even if the ESP32 is available.
We will see. If the ESP32 comes to the same price point, it will be hard for the ESP8266. Deep sleep should also work very well on the new chip. Till then, I will use the ESP8266...
its a great idea . man you keep making things that i keep wanting to try .. but need more hours in the day .
Wait till you are old as I am. Then you still have the 24h, but (hopefully) can shift the priorities a little...
Andreas Spiess p
hello from Sydney. keep bringing the small projects in the esp8266. Ive only just stumble soon the esp8266 after watching the new wifi jammers using this board. then after a quick RUclips search on the nodemcu I found your channel a diamond in the rough, great content. it's a pitty the smaller new channels don't get more exposure to new veiwers. awesome work :)
Thanks for your feedback. You can help the channel if you like the videos and write comments. That seems to help...
Will do, thanks for reply ;)
Very nice video, as always. Regarding you remarks about IFTTT : 1. In your ESP8266 code, you can use "http" instead of "https" in your webhook trigger url and it will work just fine. 2. The delay between a trigger and an action depends on the service it's connected to but for lots of them it's almost instantaneous (less than a second) : a sonoff switch or a iphone notification, for example. I guess it depends on how important is the time of reaction for that particular service. It would be inconvenient to have to wait 10 seconds every time you flip a switch whereas it doesn't make much difference if an automated tweet or a youtube notification is delayed for 10 or 20 seconds. One last thing : when you use a IFTTT recipe too many times in a short amount of time (like it might happen when you're testing it), the delay may increase or the service might even stop responding for a while. Again, it depends on the service you're using. For example, the quota with "Add row in Google Sheet" is particularly short.
Thank you for your info!
There's no problem LIKE-ing. So, here's my contribution. Woohoo! Your videos always rock!
Thanks for the support. It helps the channel!
really like this unique power saving strategy
:-)
Very nice video, and I'm so glad that you did not go with the relay solution... waaaaay too much power required, even if only for the short time while the microcontroller runs. I was looking for a latching "soft power on" circuit that does not draw any power when off and haven't found one yet, but they must exist... at least I hope so. Cheers,
+jims408 I used the relay because it is easier to understand. As always, it has advantages and disadvantages. For a button used only very rarely (e. g. Emergency button, this could still be a good solution because it draws absolutely no current during off.
Some LDO regulators have CE, but I do not know how much current they need in the off state.
I love the ESP8266 I bought 6 of them.
Me too
Zwei Blali Same. I got 6 esp-12 of Aliexpress. And you?
Zwei Blali I am a noob but I think that the most powerful is the 12 version. is there some case where the 01 is better?
Me too! I bought 25 of them!
I got 7 2 from the official website the Dstike 5 esp8266 all w deauther
Blessed to have ppl like you... Great Sharing (y)
:-)
Comments from Victoria BC Canada, because you asked so nicely.
Thank you for your support!
Thank you so much Andreas for all these videos, your research and advice is so helpful. Its such a good idea to use a mechanical switch to keep the current consumption down. Hope one day we are able to crack the esp8266 ssl problem
+Chris Sheppard Actually it seems easier than I thought. I will show it in a later video
Thank you, I'm looking forward to it!
I like your videos and pizza! More relevant to this video, a CMOS logic chip could operate at a very low power level until it wakes up with the press of a momentary button, then enable/supply power for a desired time, then sleep/deactivate your circuit. I used a 9V battery in such a CMOS logic circuit for 30 years and it still worked, although it was in stand by almost the entire time.
I think this is a good idea if you need some logic. And it is astonishing that it worked for so long (also because some batteries discharge themselves).
If you just need a mechanical switch you also can go with a simple MOSFET to switch the ESP on ( I used this principle in another video)
Thank you for your detailed and clear explanations. Your topics always seem to be interesting and relevant. Well done sir.
Thanks for your support!
My favourite electronics channel
Thanks!
this will help a lot of people. I really enjoy your low power techniques videos
I hope so. This is now the minimum power consumption, i think...
🎉🎉🎉 just stumbled on this. Im learning so much thank you!!❤❤❤
You are welcome!
Hi Andreas, firstly thank you for the videos, keep them coming. I am an absolute beginner to electronics but I'm slowly learning.
I really like the concept here but unfortunately I am having trouble implementing the MOSFET power circuit. The issue I am having is that the NodeMCU board I am using is not powering down completely, it partially powers down but I know there is still power to it as I can still see current flowing (also the boot up times are too quick to be from a totally off state).
After some investigation I have found that the gate is only reaching about half of the voltage required to completely shut off the MOSFET. I am using a 10k pull-up resistor on the gate but still not enough. The GPIO pin appears to be sinking the voltage as if I disconnect this the pull-up resistor does it's job and shuts the MOSFET off completely.
Hopefully you or someone who reads your comments can help a newbie. Keep up the good work.
Do you use a P-channel Mosfet?
Andreas Spiess Yes, I have a IRFU5305 P Channel MOSFET on the high side of the circuit.
The gate threshold voltage of your FET can go up to -4 volt and your ESP has only 3.3 volt to offer. So, your FET might not switch on. Maybe you experiment only with the FET without the MCU if you are able to switch it with the voltage levels provided by your pin.
I used a NDP6020P which has a Vgs threshold of only -1 volt and is better suited for our purpose. Many FETS are used for power supplies with higher voltaes. We need "logic level" FETS
Thanks for the ideas Andreas, I'll have a look about for another MOSFET with a lower threshold.
Look at sparkfun and adafruit. They have some...
Very cool idea with the relais!
The relay was only for explanation. In reality we use transistors.
Great idea Mr. Spiess
Thank you!
Andreas, your stuff is always good. Thank you.
Thank you. I appreciate that!
I built my own super low current delayed off circuit using a CMOS variant of the 555 - the 7555. Its super low consumption is due to being CMOS logic - the momentary push button triggers the one shot timer and its a generous 20 seconds on time to let the Wifi connection and MQTTT send happen. The uC has no control over the duration though which is a drawback as compared to your design.
Also a good solution. But it needs additional HW...
Keep up the great videos. You've taught me so much as I venture into IOT.
Thanks!
Have any SCRs to play with? An SCR triggered by your switch and use the PFET to break the circuit.
The power delivery circuit is battery positive to SCR Cathode, SCR Anode to PFET source, PFET drain to ESP power. the PFET gate is pulled down with a resistor to ground and attached to a output of the ESP. When the ESP is don set the GPIO high to stop power.
This circuit is 100% analog on startup and latch, digitally triggered when off. An example SCR like the P0130AA is 1uA at 100V across the cathode to anode.
I have to admit, that I do not know these devices and never used one. This is why I am not not sure, which would be its advantage in this scenario. As far as I understood (from Wikipedia) this device can be triggered by a pulse and then keeps its conductivity. This is done here by the Mikrocontroller (without any additional cost).
I was going for zero power and ability to not require booting to keep the unit powered on.
The key factor of the SCR is that it keeps conduction until the current drops below a threshold current 5mA for the model P0130AA. As for switching off, I realized that putting the MCU into deep sleep would drop below the holding current of the SCR. Now the switch off is to tell the unit to go to deep sleep, no GPIO needed.
Greetings from Las Vegas Nevada. Thanks for excellent tutorials.
You are welcome. Nice place where you live!
I like your methods Herr Spiess. Enjoyed the video.
Thank you!
Hey Andreas, great job. Thank you for putting so much effort in making these videos!
You're welcome. Comments like yours help in continue the effort!
Keep doing such a good stuff. Greetings from Argentina!
Thank you!
I always learn something new when watching your videos. Nice idea about the long battery life. I need to look into IFTTT as I have not used this before. Hope the Pizza was nice.
Best wishes
Arthur
+Arthur Yarnell IFTTT is quite primitive. But they have a critical mass. And this extremely important in the internet.
it's called latching XD. What a great implementation
:-)
Excellent and informative channel. Always look forward to and enjoy each video. Thank you!
That is exactly as intended. Glad to read that!
Very interesting video and plenty of food for thought. Thanks for the inspiration Andreas.
You are welcome!
This is my comment to help your channel. Keep doing such a good stuff. Greetings from The Netherlands
!
Thanks for your support!
Hi Andreas, I love this channel! Thanks for all you do. ☺
+BEdmonson85 You are welcome!
amzing device the esp8266, arduino killer! thanks for your generosity Andreas!
You are welcome!
What a wonderful solution, thanks for the well thought out videos and explanations.
Thank you for your nice words!
Thanks for all the great videos. I learn lots and get inspired for new projects.
+Martin Milner Thanks for your support!
A comment for help: Thanks for all your ideas and explanations.
+novoster Thanks for your support!
This is my comment to help your channel. I rarely do not watch your channel. T hope this help to keep the lights on.
Greetings from South Africa.
Thanks for your support! You live in a beautiful country!
Andreas, very clever technique, I liked it :)
Thanks!
Currently I am thinking about a piezo vibration sensor which detects the fall of a postcard. The sensitivity can be changed via a resistor, a weight on the piezo and in Arduino itself and the circuit would be even simpler because you do not need an automatic on/off switch or deep sleep.
I never worked with these devices. So, I do not know how they work...
Here is a good example: davidhoulding.blogspot.de/2014/02/high-sensitivity-vibration-sensor-using.html
Excellent practical use for these esp chips
:-)
Nice video Andreas.
Thanks! :-)
Watched many of your videos and learned alot! Big thanks and keep making these videos! :)
You are welcome!
You don't need https to do a "get" using the example in the webhooks docs. It works very well and you don't need the forwarding server. I am connecting to my local router, sending a get request to my webhooks applet, and then going to sleep. This completes in less than 3 seconds. The applet is hooked to gmail. I get the mail in less that 15 seconds.
I used both versions, the one with https on the ESP and the one with a php script on my webserver. Both are valid. If the fingerprint of the webservice does not frequently change, then I prefer the ESP "native" approach, because it is simple.
i like, i comment, i love the accent:)
+Slavko Glamočanin Thanks for your support!
@5:45 It is time to create our own IFTTT App LOL
In other videos I showed how I do it with a Raspberry Pi instead of IFTTT
@@AndreasSpiess Thank you for your feedback.
Wow 😲 loved the concept and execution
Execution was a little "breadbordy". But I did not (yet) have the time to make a nice box.
I really enjoy watching your videos. Thank you.
+robii387 You are welcome!
I also like your channel! ;-) It is more and more interesting with each new episode ;) Greets from Poland!
Thank you!
Keep up the good work! Love to watch your channel!
Thanks for your support!
As usual, an excellent video, keep up the good work.
Thank you!
Great video. Very informative. Thanks Andreas.
:-)
Great content as always. Just a question, any special reason why you used a p-channel MOSFET, instead of n-channel?
+T Trindad The N-channel would go in the ground line. Usually, I keep ground connections together, no other reason.
Great channel, I follow all your hacks, they are great and help me a lot. Claudio from Brazil.
Thanks!
Liked and commented, because this channel is absolutely awesome! Thanks for your great videos.
You are welcome! :-)
As always,very nice Andreas and cant wait to see full Fritz of this. Why not loose https and just go with mqtt?
Raad Yacu - +1 for MQTT. Running https on the ESP8266 seems a bit heavy and will probably cost more memory and processing time than plain old http.
Nice work. Always an educational experience.
Thanks! :-)
Have to look into those 8285s, never heard of them.Thx! Liked and commented!
Thanks for your support!
Great information. Thank you.
You are welcome!
Been following your channel for a while. Thanks for the info!
You're welcome!
Really cool stuff! I'm going to use this to make a mailbox notifier! 👍🏻🙂
Thanks! My mailbox unfortunately is out of range for the WiFi. So, I will try to use a "Sub GHz" system like LoRa
Seems like a legit guy. I give comment
Thank you for your support!
Another great video, Andreas....I am a subscriber very happy.
Thank you for your support!
Another good project. Keep up the great work. Thanks.
+jix177 You're welcome. Thanks for your support!
Hi, very interesting how to put esp info "sleep". Thank you for your video.
You are welcome!
Heres my comment to support you :) :
I made the same turnoff fet circuit in an arduino timelapse project (for photo cameras without this option built in) to turn the curcuit off, if it finishes the timelapse, lets say, may after few days. But my circuit is failed to switching it off. Now im going to check yours to fix my circuit.
+Miklós Belházy In video #14 I did it with an Arduino and 220 volts. Thanks for your support!
Thank you for yet another great video.
You' re welcome!
your channel is growing man keep coming with more good contents
:-)
Again a great video! Thanks from Bavaria
Just flew over your beautiful part of the world when I came back from the east.Nice mountains and the top in white.
You have great electronic material
Thanks!
Very interesting video from the man with the Swiss accent. There is one part I don't understand though: how do you use a reed relay instead of a normal relay or mosfet? If I put a reed switch on a door or window, it makes a permanent connection, not temporary. How can you use a reed switch to trigger the ESP then disconnect the power once the job is done?
The relay was just for illustration. The FET keeps the ESP powered as long as it needs it. The switch is open after less than a second
@@AndreasSpiess Sorry, I don't think I made myself clear. I meant that I want to use a reed switch as a trigger instead of a momentary push button. But a reed switch is either on or off (door is closed or open) so it does not give a momentary trigger pulse. Since I want to use the ESP to send an MQTT message each time the door is opened or closed then turn its own battery supplied power off once the job is done, it seems to me that the reed switch won't work because it will keep the power on and flatten the battery. I was hoping there was some solution?
You can use the deep sleep function of the ESP as shown in video #108.
@@AndreasSpiess I already investigated that option but still can't see how it will succeed as the reed switch's trigger signal is not momentary. The only solution I can see is a bistable (self-latching) SPDT relay together with a SPDT reed switch. I found one which uses only 1uA in standby mode. You don't need MOSFETS or any other latching circuit because the reed switch itself is intrinsically self-latching... which is both the problem and the solution!
Interrupts can be triggered on edges.
I always look forward to your video's but do not comment very often. I should change that to keep you encouraged to make more of your very nice video's, so here it is!
Very true. The "diesel" of us RUclipsrs is the reaction of the viewers. And its your "currency" to distinguish the good from the bad...
This was interesting. Than you for producing it.
:-)
I've "liked" the most videos as I possibly could, at least for tonight :-))) !!!
Anytime I will come across a video of yours that I haven't still "liked", I surely will ... !
;-)
I really appreciate this. Thank you!
Hi Andres, wonderfull concept! I can forsee several projects with this idea! thanks.
+George Lake Good to read. You're welcome!
success to this very informative channel!
+eduardfc Thanks!
Hi Andreas. I am a new subscriber. What great tutorials!
Welcome to the channel! And Thank you.
Um optoacoplador c817 seria uma boa opção para substituir o relé?
The relay was just to show how it works. In reality, I used a transistor.