-
-
Notifications
You must be signed in to change notification settings - Fork 325
Deep sleep unreliable with resistor #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thats indeed a great idea! Let me know how it goes! |
So far so good! All functions work perfectly, even the reset! No need for a resistor I reckon, just use a diode instead. Needs more testing on the normal Wemos D1 mini as well though |
It seems to me that the selection of the diode to be a schottky is a critical one here! |
Are you able to share a link to that data sheet? I have looked everywhere but haven't been able to find a good detailed one yet. I have replaced the resistor with a normal 100v 1a diode and this seems to work just fine (no BAT43). Im trying to figure out why there is a resistor required but all I can find in the original documents is a direct connection RST to D0.. to me it seems D0 just need to have power for the unit to come back from deep sleep. Would it not be that the lower the voltage the less reliable the unit becomes? Not sure why a diode would work better than a direct connection though.. |
The link: http://download.arduino.org/products/UNOWIFI/0A-ESP8266-Datasheet-EN-v4.3.pdf If it works on your current setup it does not imply that it will be reliable under different conditions like a nearly empty battery or at lower temperatures. According to the DS it violates the limits with a normal diode. |
Cheers, thanks for the link! I will do some more testing over the next few days and let you know how I go. |
Hi, Therefore, can you propose a remedy for this issue please, as I view this project as too fantastic for me to give up on it? Also, thanks for all your hard work. |
Use a Schottky diode or a lower resistor of 350 Ohms. |
I finally had some time to look at this in more detail. I found there is a lot of conflicting information online around the use of resistors and diodes and in particular, which one is the correct one (and how do you know for sure). This is what I have found so far: There are three ways to revive from (deep) sleep;
The inbuild Deep sleep function uses GPIO16 as an Output which is ether HIGH (3.3 V) during sleep or LOW (0.0V) once the timer has finished. Connecting D0 (GPIO16) directly to RST as per original manual will result in a constant 3.3 V on RST while in sleep and prevents a manual or software reset to pull LOW. Uploading firmware is apparently not working either (not tested this myself). To fix these issues you can either use a resistor lower than 350 Ohm or better, a diode between RST and D0 (pointing to D0 ). A diode or resistor will prevent 3.3 V on RST while D0 is HIGH during deep sleep thus allowing a manual RST through USB-TTL or the RST circuit. It is also preventing damaging the chip if the RST is pulled down through UART chip when booting up. Apparently the problem is that during during Linux Kernel boot phases 1-3 all pins are floating (GPU to CPU handover) and on Phase 4, the PINs are set to the correct state. Connecting D0 and RST directly can result in a fired WEMOS. Using a higher resistor might work when your battery is full but might not work once your battery is running lower. I am using a normal diode (not a Schottky) and this works great so far. However, I have not done any testing over a longer period. I will do soon and update once I know more. |
Hi Pronkster. Hope you don’t mind me asking, can you kindly give me the actual diode part number / type you are using please, so that I can try and use the same and test it on my pcb please? Thanks. |
Hi, getting the same issue here using weemos mini pro. I get a couple of pings once programmed and reset then goes to sleep forever. Will try the diode trick tomorrow, cheers |
@Kloorob - I am using a 100v 1A diode. I believe the product number is 1N4934 but will confirm when I am home this weekend. |
Hi, tried with IN4001 thanks @pronkster works great :) |
Just checked and I am using the 1N4934 |
don't use a standard diode because it is out of spec. Use a schottky instead! |
Hi @universam1, are you able to elaborate on that? Please correct me if I am wrong but my findings are that for the purpose of this project, any diode will do. The Deep Sleep function uses GPIO16 as an output, not as an input so it doesn't really matter if LOW is higher than 0V. The whole purpose of this diode is to protected RST when GPIO16 (or D0) is high during reset or when using the USB firmware upload. |
@pronkster Check my above elaboration on the datasheet why it is critical to use the right kind of diode here |
@universam1 so using a BAT41 or BAT43 would be the best diode to utilize instead of the 370ohm resistor in this case? I'd like to use something that's consistent, since it looks like if my battery gets below 3.6-3.5 the device doesn't wake up, I'm still testing that theory though. |
Hi @universam1. Just to let you know that I built a new board today and added a BAT43 Schottky Diode in place of the 470 ohm resistor, and my iSpindel is now working, which is brilliant! |
Dear @universam1, |
Epic project by the way... |
A simple yet elegant sollution. Cant think of a better way. Should work for virtually any condition. Schottkys are also typically much faster that Si-diodes, ideal for protection purposes, so should work very well for protecting the IO pin in thet scenario nentioned. Must admit, I was puzzled by the resistor in the circuit. A few quick searches led to this thread. I have been working (and playing) with microcontrollers for many years, although Esp8266 still very new to me. Missed the wake from deep sleep GPIO16 thing... |
Hi @universam1, Just to give you some further background as I have built 5 boards and the first 4 board, I thought that I messed up in the soldering, and hence, I couldn't get it to work. However, on my fifth board, I used a BAT43 Schottky Diode and it worked. All I need to do now is to put it into a fermenter to give it long test. |
I used a BAT46 instead of a BAT43 and was able to get readings until 3.67v then it stopped communicating. Looks like a 197.36hrs between diode and using a BAT46 currently recharging the battery and rerunning the test again. |
Poiting to D0 |
The tasting looking towards D0? |
Yes, the simbol for the cathode https://images.app.goo.gl/KeJWW6c37EyUiDHw6 |
50 pieces for € 3,16 --> https://nl.aliexpress.com/item/32854110199.html |
Hi, I've been using with many iSpindel same diode you take out from Wemos D1 mini, it's a B5819WS Schottky diode, same characteristics as 1N5819 but in SMD package. |
I changed resistance by Bat 43 and keeps going into sleeper mode and no way to wake up gives me the following error Thank you Samples:30 min:63.61 max:63.62 time:510 17:46:43.861 -> Final-sleep: 3600s; RT: 304578 |
Your interval is set to 3600 s, that is 60 minutes. You have to wait 1 hour to wakeup or change your interval setting to less seconds, I usually use 30 s for calibration and tests |
And it would activate itself? |
Now looks ok |
Not sure if I can reopen this thread and a lot has been said on it already, so just a quick question. Thanks Dave |
Hi Erik, yes - but thanks for checking. I should have included that in my post. I have the black band at the D0 end. It strikes me that it is starting to wake up though as there is activity around 60 seconds after the previous cycle started. Just seems to crash during the wakening though. Is this a known problem do you know? |
Not a known problem as far as I know, sounds like one of the hardware components is dodgy. Or the soldering somewhere. |
Well in desperation I unsoldered the diode from the project board and resoldered it directly to the socket pins (with the wemos & gyro boards removed obviously). Definitely a clean connection and no chance of shorting against the 220k resistor. Still the same behaviour. Hmmm. Faulty diode? Or wemos? Ah well, maybe I need to buy another kit of bits and try again as everyone else seems to have got their working. Chalk it up to learning...? |
Blurt of garbled characters often means wrong board rate on the serial monitor. Have you checked this? |
Hi Cameron, thanks for trying to help. It seems correct and I get a full page of intelligible text talking through the other steps right up until it goes to sleep. I have also seen it in other people’s screenshots so it could just be some noise on the serial output when it is powered up? |
Hi Dave, On an unrelated project with a different esp device, I wnated to see the startup serial message to troubleshoot. As the esp has a default baud at startup (74880 for nodemcu LoLin device) set your serial port in your sketch to the default and your serial terminal too and you'll get boot info rather than the garbled you are getting. |
That's a great tip. Thanks. Will give it a go this evening. |
Yep - I got to see the real output during boot before the baud rate is changed. Not very informative though: |
Hi @daveparrywellmeadow , did you get to the bottom of this? I'm having the exact same issue despite the BAT43 between RST and D0. The iSpindel works correctly and sends data to Ubidots once, enters deep sleep and when it wakes I just get garbled characters on the serial monitor and nothing further happens. On the slower baud I get the same as you. My next step is to try another d1 board but this feels like a nuclear option! |
I feel bad now for not posting an update on here sooner. It’s all working now. I made another base board with the components on and inserted the same Wemos d1 on it, and it worked first time. I think I had a faulty pin connector that wasn’t quite connecting with the Wemos digital i/o pins. I have also recreated the program myself using Arduino, without a lot of the ‘extra’ code which I didn’t need. This allowed me to add my own debugging comments in the serial monitor, eventually. I’ve now also mastered sending data to Google sheets which took ages. The pin numbers you need to initialise the Wemos with are different from the ones it is labelled with! |
Thanks Dave - I'll try rebuilding it! Fingers crossed that will solve the problem for me too! |
Does anyone has used DB3 5T diode? It is bidirectional diode. Is that a problem? |
It is not suitable for that purpose |
Hi there,
Firstly wanted to say that you are doing an awesome job here. 👍
My iSpindle is setup with the Wemos D1 Mini PRO which works fine except, the iSpindle wouldn't wake up from deep sleep with the config as described in your Wiki. A quick google told me that this is a known issue with the Wemos in general (all models) and that replacing the 470 ohms resistor with a diode solves this issue.
Credits go to schufti in this forum post: http://www.esp8266.com/viewtopic.php?f=13&t=7918&start=24#sthash.9AUQQ49G.dpuf
It worked for me so thought id share and hopefully it works for others as well.
Cheers
The text was updated successfully, but these errors were encountered: