One small thing I learned from exploring the voltage supervisors: a voltage supervisor is not a battery supervisor. When these devices turn off (Output goes to zero volts) the VCC/GND supply current increases substantially. The KIA7029’s I’ve been testing consume very little amperage when output is high. As a dropping supply voltage approaches the 2.9V trigger the device current use is about 16 uA. Once output goes to zero the device current rises to over 500 uA. Andreas solves this problem too with the N-channel FET idea at 12:30 in the video - it just took me a while to understand it. Hope this helps other viewers of this great channel.
Thanks for informational video, answering questions "What? Why? and How?". For simple microcontrollers, like ATMegas, brown-out detection could do the job. It holds the core in reset-state, when voltage is below the threshold. There is limited amount of threshold values (ATMega328p for example has programmable thresholds of 1.8V, 2.7V or 4.3V). But even for these simpler micros, external supervisor has benefits of wider range of thresholds, start-up delays and other specs. Just thought to add this tidbit, even though this might not be as applicable to ESP and Raspberry Pi.
I've seen in other places that, at least on AVR microcontrollers, the brown-out detection can cause an increase in idle current draw on the order of milliamps. That could still present an over-discharge problem in a battery-operated circuit. The FET-based switching solution Andreas presents here, using one of these supervisors, could still be useful in that case.
Thank you for the video. I am using the MAX809S (2.93V) for this purpose because it costs nothing ($1.51 50pcs). It has push-pull output (no need for pull-up resistor).
thanks for the advice, but i have a question: according to datasheet: "The MAX803/MAX809 have an active-low RESET output", but esp32 is activated when reset pin is high..so how it can be used for esp32 activation?
@@easynow6599 According to the datasheet of MAX809: "RESET output remains low while VCC is below the reset voltage threshold, and for a reset timeout period after VCC rises above reset threshold". We talk about ENABLE pin of MCU and not reset. Don't be confused.
RGH (reset glitch hack) on the xbox 360s was fun. The original Jtag hack used a few resistors and small diodes, not much cost at all! Thanks for the great info, I am looking into circuit protection atm!!
This was so absolutely informative! I had never thought about this. I always put large capacitors on my ESP boards because they are sensitive to power but it never occurred to me that the power-up could also cause bugs. Maybe I've been lucky so far. I will definitely use the capacitor+resistor on reset pin trick next time I'm designing a board. Also I had no idea these voltage supervisor chips exist. They are so useful! Unfortunately they don't seem to be available where I live but it's still good to know that they exist. Maybe I can find similar parts. Thanks a lot for this video.
This is exactly the problem I found some days ago with my project and this video just came from nowhere! Already ordered TPS3839 after the end of the video. Thank you!
Thank you Andreas. Exactly what I needed for my solar powered ESP32 Lora nodes, who stop when the sun light has been insufficient during winter and never come back again as result of the ‘limbo’ state.
Perfect timing! I just ran into a similar issue this weekend setting up a ESP32-cam as a doorbel. When the bel is pressed the voltage drops and resets the board, but leaves the camera in a weird state and needs a hard reset. Sometimes this also happens when flashing OTA.
Maybe in hte future. I looked at the brownout detector of the ESP32, but it was not well documented. Especially not with the Arduino IDE. It seems that the Arduino also can be fooled ( th-cam.com/video/6Pf3pY3GxBM/w-d-xo.html )
Thanks for this video, Andreas. As well as explaining how votage supervisors work and how to use them, through some of your demos and charts in this video, you have helped me cement some understanding about power issues that I had been struggling with understanding what was happening some times in my own circuits using MCUs. Now I need to go and buy some of these so I can use them in my circuits! Thank you. Stay safe.
@@AndreasSpiess Indeed. Apart from the KA75330 (which I have purchased from AliExpress), I seem to be having problems sourcing them. I need through-hole versions rather than PCB friendly versions and would like to have a selection of them. Just wonder if you could recomemmend a good place to source the KA75XXX or equivalents)? Thanks.
This is OK for simple embedded uP, but if there is any storage requirements in the system then it does not fully remove the problem. The Raspberry PI would still crash and not recover if you just hit the reset, if it's writing to the memory card at that point game over. re-install of memory card might be required. So if there is a memory storage of important information required we need to add a little bit extra. Capacitors to hold up the supply and a diode to stop the falling incoming power discharging the caps. the voltage detector instead of hitting the reset should be connected to a non-maskable interrupt, So the controller has time to do a bit of house keeping, save data to non-volatile memory, etc, and go into a safe state ready for power down. Quite a few uP have the reset driven from the clock oscillator, the clock has to run for a number of cycles before the reset is released, making sure that there is a stable clock running before your code is let lose. When you have to design of power glitch's there are other issues involved, Hot or COLD starts. do you want to load defaults in to system (cold start) or do you want to reload the settings last set while running (HOT start), so the need to save settings as power is lost, because if power is only removed for 100ms or so , you don't want the usre to have reset all the controls back to where they had set them. Still a great video if you read all the way down to here. :)
Just as a FYI. The ESP32 has a setting in menuconfig where you can select its reset detect level. Arduino people don't know this because Arduino does not allow access to the many, many options in the ESP32 menconfig system.
Excellent video, thank you for sharing! I hadn't heard of voltage supervisors before, but now that I do, it feels almost too obvious that there are parts that do this specific task!
RapsberryPi uses an internal power management chip (PMIC, MxL7704 in Pi 3&4) has some of these power management built in. BMC Chip actually works at ~1V range, and it does boot up and it has a section during bootup where it detects if the voltage is enough to continue boot process. During the operation is you draw too much power, and supply voltage dipped below 4.63V is tags is and you can examine it using vcgencmd get_throttled command.
thanks andreas for this video! very informative as always! As many other viewers have suggested, most modern MCUs, even smallest ones (e.g. ATTiny), have brownout detection capabilities. In another way, also the raspberry pi has undervoltage detection capabilities (the "yellow lightning bolt") and you can write a script that powers it off. As for new designed boards, I suggest to use single PMICs that have all those function built-in. Otherwise, selecting a LDO or a Battery IC with a V_OK pin could be another solution.
@@AndreasSpiess From Texas Instruments: - TPS3702 Supervisor IC has capability for UV and OV monitoring - TPS778 LDO has a power-good output - As for integrated solutions, the BQ25570 you showed in video #278 has all those capabilities but is not so cheap By the way, TI, Analog, ST and many more companies are making these kinds of ICs, but they are using really small and often BGA packages, so it is difficult for a maker to use them in prototyping. Those ICs are also application-specific and not general purpose, so I suggest to take a look at the catalogs.
@@BitsOfBoris You can try to look at LCSC, I have found the TPS3705-33 that is similar to the TPS3702 and it is 0.45€/piece , while the LDO can be found in the adj version (TPS77801D) for 3.82€/piece
Andreas: Nice video on a useful and perhaps lesser-known part. A minor point -- in your schematics the battery symbol is upside down. The long bar represents positive in the standard symbol.
This solution is good for the esp as it can reset everything even if you use third party code like tasmota. I have found that bod on chip can be troublesome in some applications and is different for each cpu this gives the same solution for all and you can debug it with a scope. One point on the input resistor divider for the comparator in the devices. The voltage reference will need some headroom to operate so needs to be below the threshold voltage. A good explanation of their operation, thanks Andreas.
The Raspberry has a different problem because it has an operating system and has to be shutdown, not only switched off. At the end of the video I showed how it has to be done for a Pi.
i was glad to watch your video, i was experimenting with KA75330 ordered on ali but i got a TO-92 thyristor instead of the real ka75330 i followed your link and ordered new one and those where the right parts. ik took me some time to figure out what was wrong, it did not act as a comparator and let my Peak DCA-75 decide what it is , and the answer was thyristor and a quick test with multimeter on ohm range and connecting anode to gate proved it , yesterday i received the correct parts, tested it, i use a 180 ohm pull up and on 3.17 volt the output drops to 0 volt , and on 3.22 volt it returns to normal high level, so i was glad to have received the correct parts, i emailed the supplier on ali that his parts are wrong , did not get a answer from him yet. one thing that suprises me, if you look at the datasheet of a KA75330 the - input is the voltage reference, So if V-in drops below the voltage reference the output transistor is being shut- off so the output should rise to VCC but instead is is being dropped to 0 volt ,so the output transistor is on and the collector voltage drops to 0 volts, is this a bug in the datasheet?, with this behaviour it can be connected to a ESP8266 and will be halted if the voltage drops below 3.17 volts and release at 3.22 volts so that's gooed but it contradicts the datasheet, the - input wil be higher so the op-amp output goed to zero.
Thank you Andreas for another really very userful video! ... I'm using your videos very often as a "reference" to look up things if needed in my projects.. this is definitiv one I'll remember ;-)
This is great, thanks! I use these and a few others that are latching and/or keep the voltage divider outside of the main chip so as to be able to tune the cutoff points. I have a few components that become unstable at weird points like 3.85v, and others that need to be effectively removed from the circuit until the battery has had a chance to get back up to a decent level.
@@AndreasSpiess oops! Thought I had mentioned it, but the MAX8354/835 series is my go-to for latching. Here's a little more information to make up for not mentioning that r in the first message :) The internal reference is only 1.2v giving it a very broad range. It's extremely low power consumption (I usually see 1-3uA), so perfect for battery devices. A bit more expensive and SMD, so as always depends on your application. 834 if an open drain, and 835 is push/pull. Either can use separate VCC and monitored voltage on case you're working with things outside of its native VCC range.
Hallo Herr Spiess. Danke für viele sehr interessante Videos, die mir schon oft bei der Lösung von Problemen geholfen haben. Eine kleine Anmerkung zu diesem Video: Die Batteriesymbole sind vermutlich falsch gepolt. ( Der längere Strich ist beim Batteriesymbol der Pluspol. )
Hello sir, I love to learn from your channel and I haven't missed a single video from you. You have addressed the really critical issue for professional product development. As a beginner, I want to know all the essential kinds of stuff like this (the critical one that most of the hobbyist miss). Please suggest me some books or any resources that teach me these kinds of stuff.
@@AndreasSpiess it would be a great help for me if you can please post the link for the video describing books or post the name of the book in comment.. Sir..
The first voltage supervisor I used was the TL7705, this had a problem that it released the reset when its own supply voltage is low. When my company switched from the NMOS to the CMOS 8085, the processor continued to operate below the supply voltage at which the reset circuit stopped working. The result was that the processor would restart (leave reset) during the time it was being switched off. It is worth checking that the reset signal is maintained until the processor is safely off. Ideally the reset signal should be maintained all the way down to zero supply volts, One solution to this problem is make the reset a passive resistor pull down signal and "NOT in reset" active high.
Good explanation . So i am using the KA75330 with an esp32 Epaper to wake when the battery gets to low. to display a low battery warning and then putting the esp to sleep only to be wake when the KA75330 signal goes high to clear the low voltage warning. As one of the big issues with epaper is if the battery goes flat.Iit just sits there displaying the last thing displayed, and the user has no idea that it is not functioning or updating. It would be useful for esp32 e-paper such as LILYGO® TTGO T5 V2.3.1_2.13 Inch E-Paper added a battery monitor chip to the board as standard.
Thank you for bringing this topic to our attention! I knew these things were out there, but never thought about their application in my hobby projects. Now I have yet another thing to put on my long list of stuff to think about! (Also, I think your battery schematic symbol is backwards?)
Why doesn't the Raspberry Pi have this as part of its board? Would save many a SD card from getting corrupted. Great video, I'll need to get some of these parts and start incorporating them with my boards.
Ihe Pi4 seems to have one. But because the Raspberries have an operationg system you have to shut them down, not just switch them off. This is the reason for my proposal at the end of the video.
I went into this video thinking he was referring to Voltage Regulators, but due to a language/interpretation issue was calling them Supervisors, and that I wasn't going to learn much if anything... Whoops my bad, and I learned two things to add insult to my hubris: I'm not as smart as I thought I was, and learned about a part, that even as a professional (many years ago), I didn't know about.
Please check, but I think you have your battery symbol positive and negative mixed up in some of your circuit diagrams. The positive line in the battery symbol is longer (more positive) and the negative is shorter (or minus) is how I remember.
Very informative. I knew my esp32cam resets due to low power on my arduino toy mobot but didn't know how to prevent it. Had to power it separately. Thanks for sharing this.
For the Esp32 you need to configure your brownout detection voltage: docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html#config-esp32-brownout-detox then you not need any external voltage supervisors.
The brownout detector is useful but doesn't cover all possible failure scenarios as Andreas shows in the video. This is why Espressif have the additional recommendation to include an external supervisor.
@Ralf: I tried to change the BOD threashold voltage as well as the alarm in Arduino IDE. I only was capable to switch BOD off, but not more :-( I would be glad if you have more info. And BOD only worked if the CPU still worked. So no protection against "gibbersh" and Flash error.
Exactly. For such low currents and voltages no need for some supervisor complicating the project. Even decent Zener diode will do here Besides you can power your esp with small power bank that has all the protections you need
@@browaruspierogus2182 I tend to think ESP and others are targeted to button cell power primarily as they all fight for the less consumed power as possible.
You should definitely make a part 2, digging further on Power on Reset (POR) and Brown Out Detection (BOD). The whole point of a MCU is to have all those components integrated *and* to make use of them. Using an external supervisor is only for very specific cases.
I looked into the brownout detector of the ESP32. It works if you reduce the voltage from 3.3 volts. But I did not find a way to reset the MCU down after this message. The brownout message did not shut the CPU down. And it is not very well documented...
I have a number of LiIon battery projects these would be handy for. Preventing Over charge and or Over Discharge situations. Been using the LM393 and resistor divider. This would be much easier I think. 3.3v version is just about ideal for the task on LiIon cells and with a added resistor would work for the LeFePo4 type. Just ordered 10 to mess with. Thank You. China is having some rather serious issues with the virus thing . Orders are taking quite a bit longer then the normal long times in the past. Guessing this one will take two months to show up.
Thank you! I am still watching your (epic) video.. My wife easily can watch a whole Netflix series during he same time ;-) It seems you had a great time.
IIRC you can power 3.3V MCUs like the ESPs by simply using a LiFePO4 cell (w' it's protection-&-charging circuitry) *without any voltage regulator.* You may have even already had a video about this, i forget. The cell won't get charged above 3.6V, and the protection circuit will probably kick-in and cut off the battery when it gets down to around --2.5V. So you'll never get outof the ESP's voltage range.-- _Edit: LiFePO4 protection circuits cut it off at 2.1V, so it may still be a problem on the low end._
@@AndreasSpiess Hi Andreas, vielen Dank, ich bin schon fleissig dabei deine Videos zu schauen, da werde ich definitiv eine Weile beschaftigt sein, aber der Wille ist ungebrochen! ;-) Wäre schön Leute aus der gleichen Gegend zu treffen die ebefalls an dem Thema interessiert sind. Hast du da vielleicht ne Idee?
Thanks for the heads-up! Got some nasty problems with undervoltage. I can't find a voltage detector for >4v threshold with to-92 footprint on AliExpress. I am currently working with the wemos development boards and had some problems with undervoltage. Now I want to keep the reset pulled to GND untill the 5V supply voltage is above 4V.
Interesting and useful. It is a perfect addition to my battery powered project. One question: on 12:30 minutes on your video you show a diagram of a circuit to shut down not only the ESP32 but also all peripherals when the battery is under 3.3v but show no values for the resistors. How can I calculate the resistors for the circuit? Thanks again.
You need a batt ups with pi as they corrupt fat sdcards easily. This is a cool/geil way to monitor voltages and shutdown and on safely. Thanks andreas!👍
excellent video as always..i would like to ask 2 more things: 1) if you use PROTECTED lipo battery (in built protection) do you have to use the voltage supervisors to prevent from undervoltage or the battery itself is sufficient? 2) do you need voltage supervisor for a project running with lifepo4 that as i remember in another video you said are safe from undervoltage?
1. If the battery safely shuts down before the MCUs low specification you should not need such a device. 2. The battery technology has no effect on this topic. Also LiFePo4 batteries can crash your MCU. They just seem to be less harmed by deeply discharging the battery.
@@AndreasSpiess 1) as far as i know my battery (i dont know if its a standard for all li-ion protected batteries) has cut-off at 2.65V, so i guess i want be a good voltage for esp32, so i want a voltage supervisor.. 2) hm..i know that its battery unrelated, but i assumed that because LiFePO4 is safer when they discharge (no explosions like lipo?)they will be safe for MCU..which is wrong.. maybe they will not explode but they will undervoltage the MCU..and unexpected behaviors will be sure thing
Based on illustration at 12:31 in the video; are additional parts required to connect a Telcom TC54VN2902EZB to an International Rectifier IRLZ44N? No circuit designer here; just an Arduino/ESP coder. How are R1 and R2 calculated? Thank you Mr. Spiess for the video.
Hi William, I’m a designer and would like to help you with your query. Calculation R1&R2::: The R1 & R2 value used to make adjustments in the tripping point of VDET- value. Usually this VDET- is pre-programmed during prototyping. Let’s say the tripping voltage should be 2V at 100uA bleed current (The IRLZ44N’s threshold value of the gate terminal voltage is 2V). Then, the R1+R2 value will be 2V/100uA = 20kOhms. The battery used is 5V, and the requirement for the IRLZ44N is 2V for gate voltage. 2V/5V = R2/R1+R2 0.4 = R2/20kOhms R2 = 8kOhms, R1 = 17kOhms; The below-shown reference schematic will help you with understanding more clearly, I have drawn TC54 voltage supervisors with an IRLZ44N rectifier. www.flux.ai/ramprakashvishnoi8/tc54-voltage-supervisor-with-irlz44n-rectifier Let me know if you any questions in your mind. Cheers, Ram
Andreas, could you propose a new video with new Voltage Supervisors available on the market (shortage)? There are some of Onsemi, Dallas, Microchip also in THS TO92 size
Aren't the inputs of the internal comparator of the KA75330 the wrong way round? According to the blockdiagram if the input (through the resistive divider) is higher than the reference the comparator switches on the transistor, which pulls the output low. Most devices have an active low reset pin, which means the KA75xxx would reset them as soon as the voltage reaches the desired level instead of the other way round.
Hi Andreas, thanks for the awesome video. As I'm still quite new to making my individual electronics projects so your videos help me quite a lot. I have a question regarding the supercapacitors for using with the KA75450 as a safe shutdown system for the raspberry Pi: In your video #133 you suggested 15-20 F supercaps to have enough time for the Pi to safely shut down. That video was before the Pi4 and I was wondering whether the 15-20F recommendation still applies with the Pi4's power consumption? Thanks in advance.
Indeed a very good video, but I think you got carried away, because you forgot to tell us how to protect against overvoltage. :) In my house, the AC from the wall outlet is specified to be 230V, but since this is on an island, where the power-cables are more than 10 km long, you can imagine that there are some quite large spikes when the neighbour turn on their high-power farming machinery (or if someone on the island descides to weld some stuff). I've measured voltages below 220V and above 240V. This is way out of the official spec. Now if my 230V power supply gets too high a voltage, it translates that voltage to a too high DC and passes this voltage onto my single-board computer (I've tried that with a CubieBoard2). My CubieBoard2 popped and so did the step-down converter I had between the power supply and the CubieBoard2. -So it'd be great to have a good way of preventing this kind of thing happening. To some extend, capacitors would help, but I'd like to clamp over-voltage too.
This is a matter of choosing a proper AC power supply, I think. Not very much linked to this topic.My cheap USB wall charger is rates from 110 - 240 volts. So I assume it will survive also 250 volts. Maybe you had another problem?
Thank you for your reply. :) Well, the problem is that the voltage may spike over 300V sometimes (that is in addition to the AC not being within spec) and that I have my server (harddisks, network and single-board-computer) running on this grid. If one gets a spike, it's very likely that it'll fry more than one unit. I think it's fairly within reach to turn off the power if it goes above a certain voltage. A MeanWell power supply allows 90VAC to 264VAC, which means if the voltage climbs above 260V, I could hard switch (eg. a relay) the power to the PSU on the primary side, while keeping capacitors on the secondary side and having zener diode protection on the secondary side (probably before the capacitors). The larger capacitors, the better, because I figure they'll just "divide" the voltage down to a harmless level. Then after the capacitors, one could have either zener or a final voltage regulator. All this would of course be a bit bulky and I guess that if lightning stroke, then it'd all be wasted anyway.
My concern about only turning off the primary side is that if you take a standard transformer (without regulation added), you will get a high spike on the secondary side when turning off the transformer. That's why I'd add the capacitors, zeners and regulator. There's likely a much simpler or better solution than the one I've been thinking of - but sometimes it's difficult to see obvious solutions. ;)
In the beginning of the video, you said the raspberry pi runs at 3.3v. I understand that the broadcom chip runs at 3.3v, but the board is designed to fun at 5v, with an LDO that powers the processor and gpio at 3.3v. I assume you meant to refer to the rpi as an example of where you use the 4.5v supervisor.
Very helpful video for me as it help me to get the idea to solve the problem in flight controller for a mini quad powered with 1s 3.7volt lipo where it got discharged below 3volt if I continue to fly the quad for some more time after low battery indication (a small camera connected with battery will keep on consume current even after landing the drone)... by using this small component i can protect my lipo by cutting the supply if Vbat < 3volt. Thanks for this informative video as always :)
I have a NO/NC basic 5vdc relay already in hand. Do you think I could use that to replace the KA75450 voltage supervisor? In my raspberry pi 3 setup I'm using a 5v 10A switching power supply to power the pi, touch screen display and Arduino. I'm using the GPIO3/GND pins to safely turn on/off the pi but would like to add the (2) 2.7v 10F super capacitors as shown in your awesome videos. I would wire the Coil in the relay to the 5v power supply and wire the COM/NC pins to the GND/GPIO3 pins on the pi. Now if I turn off or lose power from the 5v power supply the relay will close and the GPIO3 pin will make contact with the GND pin thus activating a safe shutdown meanwhile the caps provide power. Please note I would need to provide a diode up stream of the super caps to prevent them from energizing the coil.
You need a very sharp and reliable cutoff voltage which you will not get with a relay. The relay will once switch at a higher and sometimes at a lower voltage.
Hi Andreas, Njce video. I guess this is handling levels below what can be done with Brown out detection, which is present in many MCUs. I did some work with ATmega and configured BOD to be able to be stable on quite a low voltages.
The ESP32 also has a BOD. Biut it only worked if hte processor still worked. So no protection if you come from below the threshold. And it seems yo ucan fool the Atmega 328, too (th-cam.com/video/6Pf3pY3GxBM/w-d-xo.html )
Great video again. I have a question for specific use case. Is it possible to use RC timer circuit before this device to create an user adjustable power up/down trigger circuit instead of using regular deep sleep feature of micrcontroller ? In other words is it possible to use such circuit inplace of more expensive and not so user friendly (SMD soldering) TPL5110 ? What could be the power consumption theoretically of such circuit when micro controller is powered down ? Any feedback are appreciated. Thanks.
I think the TPL5110 is a good solution for such problems. You find the quiescent current in the datasheets of the respective device. It is probably a bit higher . And the RC might add an additional few nA Maybe you try if you do not like the TPL...
Thanks for the video! I hope if we use supervisor chip we may bypass the voltage regulator and connect the esp directly to the battery or use an ldo for additional protection. But deep discharge won't happen? And the battery OK led will be quite useful. Can we connect it to the same supervisor as that on the RESET pin?
These devices have different functions. An ESP should not be connected to more than 3.6 volts. So you need an LDO for LiIon batteries. Often these supervisors are connected to reset pins to make sure the MCU only boots with enough voltage.
Sorry i forgot to mention 3xNiMh in series will mean 0.9x3=2.7 low cut-off and 1.2x3=3.6 max voltage. So a 3-3.6V supervisor will mean LDO is not required if we charge it externally. But, if we need charging facility also, an LDO will also be required and we may connect it directly to USB for charging 1.6x3=4.8 of course if there was some arrangement to limit currents. Of course, a suitable solar panel would limit charging current but maybe an LDO will be required. Of course, with a LIPO we may need an LDO. Unfortunately, i did not find cheap LiFePo4 here and they don't ship batteries from china..
Thanks, Great video. What about the TL7702 series. I use it on sensitive applications but never tested if they actually perform. I took the word of Texas instruments for granted
Thank you for this video. I had made a solar panel powered ESP8266, and on grey clouded days it drained the last juice of the battery, making it stop forever. I had to go to my balcony and disconnect it for a day and then hope for sunnier days ahead. These supervisors I had thought of, but being a mechanical engineer could not figure out how to make some circuitry that is also very power efficient. A relay would not work. This video will bring a solution to that! BUT, maybe an obvious one for others, but how to I cap (maximize) off the battery-power from frying the ESP8266 at say 3.6 Volt. Is there in existence that springs to your mind, like an inverted supervisor for that? Thanks for all the videos. I feel like the cowboy movies, when they were made at the time it was normal, and people were not surprised with next Robert Mitchum movie. The enormous efforts to make these movies with cattle and all, makes them impossible to make today. I hope I have not seen the last of your 'movies' from your hand, thanks again!
Am I missing something or is the diagram (7:49) incorrect? It seems to me that the + and - inputs of the opamp/comparator are reversed. As it is drawn, if the input voltage is higher than the reference voltage the output becomes high and the transistor pulls the output pin to ground.
I copied the diagram in the data sheet. They do not disclose how the comparator work. Maybe tehy use the same diagram for components with active low nad high ;-)
I hope you'll see this!!! My question is this. What's the function of the brownout detector in the esp32 in place of a voltage supervisor. It doesn't work at startup?
@@AndreasSpiess thank for the prompt reply. Unlike the atmel AVR that the brownout detector resets the MCU, that of of ESP just detects and crashes. However, do you have much idea about brownout detector in the atmega328p used on the famous Arduino. I'm aware that the BOD resets the MCU from brownouts during operation by resetting the MCU. My question is this, does the BOD protect it under startup too?
Thanks Andreas. Useful for all those solar projects this summer! .... could you end videos like this with some suggested cct diagrams for Standard Speiss Designs (SSDs). For example, I have a solar cell charging a super capacitor bank that feeds an Arduino based stepper motor for a green house window opener. When the sky clouds over and the temp inside the green house falls, I want to close the window while I still have enough power in the supercaps to drive the stepper motor to close the window. If it stays cloudy and the supercapacitor voltage falls further, I want to close down the Arduino. When the solar recharges the supercaps I want to re-start the Arduino then bring things back to life. A Standard Speiss Design cct could be drawn for this purpose and used for any project requiring phase shut down and phase power up based on predictable fluctuating supply voltages Of course, others will also have battery based applications. As a super capacitor bank is the same logic and a battery, the above SSD would apply to battery projects too. So at the and of the videos just display a sketch design that we can all pause the video, steal the design, and give you credit!
As a longtime subscriber you know that I usually try to show useful parts which then can be assembled into projects by my viewers. And sometimes I asssemble them myself in a project. Concerning your project: Ass long as the Arduino is running you can use it to measure voltage and to decide if you have enough power left to close the windows. And you have only to take care that the Arduino shuts down and powers op in a clean way. Maybe an old Car battery is also a solution. Then you should be able to accumulate more energy during sunshine.
@@AndreasSpiess Thank you for responding. I want to use supercaps because of the faster charge and higher discharge profile is ideally suited to the intermittent use of my stepper motor applications. I also have a developing 2-axis solar tracker that will also use super caps and stepper motors to keep my solar panel tracking the sun. I already use the Arduino to sense the solar and supercap voltage. However, I like to try and keep power management out of software and use discrete components for charge sensing and control. Hence I like this video introducing these voltage supervisors. I will use the lead-acid 'leisure' battery bank as my final energy store. Perhaps there is slight duplication here .... but I like the fact that the power management control system is 'separate' from the final energy store. Also, we must start using those supercapacitors for something! .... Could you do more solar related stuff please?
Very interesting topic. The only issue I see here is with boards that have LiPo battery connector. If internal power gets very low/off the on-board battery kicks in. But what would happen if external power is still low/off by the time the battery power drops to low voltage? :-/
Danke für das tolle Video, weiter so! Habe mir gleich den TPS3839G33 für mein Lipo-Sensor-Projekt geholt und den Reset-Ausgang über 10K mit dem Enable-Pin des ESPs verbunden. Und jetzt leider eine Reset-Loop beim Start, hoffe ihr könnt helfen. Weitere daten: Low-Dropout-Spannungsregler HT7333-A mit 1000uF vor und 100nF + 100uF Kondensator danach. Eingangsspannung von 4.2 bis leer also ~3V. Ursache: Laut Oszilloskop verbraucht der esp8266 beim Start zuviel Strom das die Spannung kurzzeitig unter die 2,9x Volt fällt und der Reset ausgelöst wird. Der ESP geht aus, die Spannung stabilisiert sich und nach den 200ms beginnt der Spaß von vorn. Beobachte ich die Spannung mit überbrücktem Enable-Pin fällt diese kurzzeitig auf 2,90V erholt sich dann aber wieder. Der ESP funktioniert währenddessen. Ich muss also nur irgendwie den Start überbrücken. Jemand eine Idee?
Please more content like this. I order pcb designs from freelancers and they just execute, I need to tell them everything. I had one esp8266 board designed without this component because I didn't know about it. Now I'm paying the price when battery voltage goes down. And it's hard to reach to rest 😪 😞
So, to sum up, if i were to design a UPS with TP4056 charger ,DW01 protection IC ,LM6206 Boost IC,i should add these Voltage Supervisor IC to enable/disable the Boost IC? P/S : been waiting for the answer for your video #250 since then about UPS and somehow i think you're trying to relate these two? Please, correct me if i'm wrong.
in order to protect the Pi with a safeshutdown, should we use this ? or to rephrase : I always hear that Pi are very sensitive when turned off, and that we need a hardware safeshutdown, but also a software that will be triggered (script) to shutdown properly the device. i never understood why is this not by default in the Pi...But anyway , my question is : would this help to solve this matter or would you recommend something else ? if so, what ? thanks !
Hello Andreas, one question: i want to use the KA75290, to disable my ESP if VCC is lower than 2.75V. But .. what if my LiFePo4-Battery is charged, and gets more than 3.05V? Wouldn't the Supervisor set its output to HIGH, and my ESP will be switched off? 3.05V is the Max Detecting voltage of the KA75290 according to the Datasheet.
@@AndreasSpiess Thank you! Sometimes the answer is just easy :-) I continued and ran into two more problems. First, the RST-Pin is also connected to D0 of my Wemos-Mini, for waking up from DeepSleep. Since D0, and the Voltage-Supervisor are not always at the same state (high, low) it comes to the situation, that there is a level of 1,7V on RST (maybe the built-in resistors in GPIO and the voltage-supervisor act as a voltage divider). I solved this, by adding two diodes to decouple them. Second problem appears, when Vcc rises above 2,63V (Reset-Voltage of my SGM809B-RXN3LG). The supervisor starts bringing its output high, and then the whole system starts oscillating. This only stops when Vcc gets a bit higher - maybe the hysteresis of the SGM809B is too small, or my cap is too small (470µF). The ESP doesn't like this at all, and Tasmota even loses part of its config!
Could a similar mechanism be used to boot up an wemos d1 mini on a supply that shuts off at 100mA. An elco on the power line can buffer the Esp spikes during boot and wifi, but keeping the esp8266 powered off during elco charge (say 3300u) is then required. Older Dutch smart meters have 100mA power shut offs, newer ones have 250 or even 500mA shut-offs. Any advice?
@@AndreasSpiess thanks, but the operative concept was ‘similar mechanism’. Do you have ideas on how to prevent (say 100mA) current shut off supplies, from shutting off if powering esp8266’s that produce, as far as I can see, 470 mA spikes?
how can I modify the 4056 LIPO charger to cut load current at battery under voltage of 3V instead of 2.5V ? This may serve the purpose too ? (we are doing research for smoke free world - a soil moisture sensor system that can function independently in remote locations, and respond to wifi when available)
Some supervisors, like ADM1232, even have an integrated watchdog to reboot the device if it gets stuck... I didn't know such devices exist, I will use them more in my home-made lab equipment...
One small thing I learned from exploring the voltage supervisors: a voltage supervisor is not a battery supervisor. When these devices turn off (Output goes to zero volts) the VCC/GND supply current increases substantially. The KIA7029’s I’ve been testing consume very little amperage when output is high. As a dropping supply voltage approaches the 2.9V trigger the device current use is about 16 uA. Once output goes to zero the device current rises to over 500 uA. Andreas solves this problem too with the N-channel FET idea at 12:30 in the video - it just took me a while to understand it. Hope this helps other viewers of this great channel.
I have to admit: I did not focus on the powr supply of these parts. So I learned something. Thanks!
Thanks for informational video, answering questions "What? Why? and How?".
For simple microcontrollers, like ATMegas, brown-out detection could do the job. It holds the core in reset-state, when voltage is below the threshold. There is limited amount of threshold values (ATMega328p for example has programmable thresholds of 1.8V, 2.7V or 4.3V). But even for these simpler micros, external supervisor has benefits of wider range of thresholds, start-up delays and other specs.
Just thought to add this tidbit, even though this might not be as applicable to ESP and Raspberry Pi.
I know I heared about that internal undervoltage protection module before
BOD seems effective for loss of power but not so much for slow recovery.
I've seen in other places that, at least on AVR microcontrollers, the brown-out detection can cause an increase in idle current draw on the order of milliamps. That could still present an over-discharge problem in a battery-operated circuit. The FET-based switching solution Andreas presents here, using one of these supervisors, could still be useful in that case.
@@BerndFelsche
>BOD seems effective for loss of power but not so much for slow recovery.
That would be part of the Power-On-Reset block.
You can fool the Arduino, too, if you want ( th-cam.com/video/6Pf3pY3GxBM/w-d-xo.html )
Thank you for the video.
I am using the MAX809S (2.93V) for this purpose because it costs nothing ($1.51 50pcs). It has push-pull output (no need for pull-up resistor).
Good choice. Thanks!
thanks for the advice, but i have a question: according to datasheet: "The
MAX803/MAX809 have an active-low RESET output", but esp32 is activated when reset pin is high..so how it can be used for esp32 activation?
Easy Now MAX810 has the inverted output. Needless to say you need to be very careful to pick the correct voltage range including tolerances.
@@easynow6599 According to the datasheet of MAX809: "RESET output remains low while VCC is below the reset voltage threshold, and for a reset timeout
period after VCC rises above reset threshold". We talk about ENABLE pin of MCU and not reset. Don't be confused.
I mentioned it in the video that the "reset" pin on the ESP32 is called "enable" pin.
Yet another gem, I could use this for my supervisor (when my energy is to low)
:-) The question is then how he is wired: On at low level or off at low level...
Might need the gas soldering iron!?
RGH (reset glitch hack) on the xbox 360s was fun. The original Jtag hack used a few resistors and small diodes, not much cost at all! Thanks for the great info, I am looking into circuit protection atm!!
You are welcome!
This was so absolutely informative! I had never thought about this. I always put large capacitors on my ESP boards because they are sensitive to power but it never occurred to me that the power-up could also cause bugs. Maybe I've been lucky so far. I will definitely use the capacitor+resistor on reset pin trick next time I'm designing a board.
Also I had no idea these voltage supervisor chips exist. They are so useful!
Unfortunately they don't seem to be available where I live but it's still good to know that they exist. Maybe I can find similar parts.
Thanks a lot for this video.
You find many suppliers for such parts. They are widely used.
This is exactly the problem I found some days ago with my project and this video just came from nowhere! Already ordered TPS3839 after the end of the video. Thank you!
I hope it will help!
Thank you Andreas. Exactly what I needed for my solar powered ESP32 Lora nodes, who stop when the sun light has been insufficient during winter and never come back again as result of the ‘limbo’ state.
I think this is a very good application.
Andreas, @ 8:50 you give a gift. The RC circuit solves my problem and stability returns! (R=68K, C=10uF)
Good to know it helped!
Perfect timing! I just ran into a similar issue this weekend setting up a ESP32-cam as a doorbel. When the bel is pressed the voltage drops and resets the board, but leaves the camera in a weird state and needs a hard reset. Sometimes this also happens when flashing OTA.
I hope such a part will help!
Thanks for introducing the device type.
Perhaps a follow-up video comparing them to brown-out detection built into microcontrollers?
Maybe in hte future. I looked at the brownout detector of the ESP32, but it was not well documented. Especially not with the Arduino IDE. It seems that the Arduino also can be fooled ( th-cam.com/video/6Pf3pY3GxBM/w-d-xo.html )
Mr. Spiess thank you so much for all your well-made incredible videos! Cheers from Brazil!
You are welcome!
Thanks for this video, Andreas. As well as explaining how votage supervisors work and how to use them, through some of your demos and charts in this video, you have helped me cement some understanding about power issues that I had been struggling with understanding what was happening some times in my own circuits using MCUs. Now I need to go and buy some of these so I can use them in my circuits! Thank you. Stay safe.
You are welcome. Fortunately they are not too expensive ;-)
@@AndreasSpiess Indeed. Apart from the KA75330 (which I have purchased from AliExpress), I seem to be having problems sourcing them. I need through-hole versions rather than PCB friendly versions and would like to have a selection of them. Just wonder if you could recomemmend a good place to source the KA75XXX or equivalents)? Thanks.
I bought a few MAX809 and a TL7702 also from AliExpress. But I never used them so far.
@@AndreasSpiess Thanks Andreas. I'll take a look.
This is OK for simple embedded uP, but if there is any storage requirements in the system then it does not fully remove the problem. The Raspberry PI would still crash and not recover if you just hit the reset, if it's writing to the memory card at that point game over. re-install of memory card might be required.
So if there is a memory storage of important information required we need to add a little bit extra. Capacitors to hold up the supply and a diode to stop the falling incoming power discharging the caps. the voltage detector instead of hitting the reset should be connected to a non-maskable interrupt, So the controller has time to do a bit of house keeping, save data to non-volatile memory, etc, and go into a safe state ready for power down.
Quite a few uP have the reset driven from the clock oscillator, the clock has to run for a number of cycles before the reset is released, making sure that there is a stable clock running before your code is let lose.
When you have to design of power glitch's there are other issues involved, Hot or COLD starts. do you want to load defaults in to system (cold start) or do you want to reload the settings last set while running (HOT start), so the need to save settings as power is lost, because if power is only removed for 100ms or so , you don't want the usre to have reset all the controls back to where they had set them.
Still a great video if you read all the way down to here. :)
Concerning the protection of the RPI: I showed how it can be done at the end of the video (GPIO3, Super Caps)
Just as a FYI. The ESP32 has a setting in menuconfig where you can select its reset detect level. Arduino people don't know this because Arduino does not allow access to the many, many options in the ESP32 menconfig system.
I tried it in the Arduino IDE, but I was not able to chage the brounout level. And it works only, if theMCU runs, as I showed in the video :-(
Andreas .. YESSS! 15min listening to TH-cams most tech savy "swiss accent" and the day is gonna be "GUAT"!
:-) Today, I had to do a little more. I had to give a "Indoor Cycling" class with my daughter...
@@AndreasSpiess having quality velo time :D
So you must be Swiss ;-) (Velo)
Excellent video, thank you for sharing! I hadn't heard of voltage supervisors before, but now that I do, it feels almost too obvious that there are parts that do this specific task!
You are welcoome!
Very practical! This should prevent a lots of problems! Thanks again Andreas!!! Have a great week!
Thanks. You too!
RapsberryPi uses an internal power management chip (PMIC, MxL7704 in Pi 3&4) has some of these power management built in. BMC Chip actually works at ~1V range, and it does boot up and it has a section during bootup where it detects if the voltage is enough to continue boot process. During the operation is you draw too much power, and supply voltage dipped below 4.63V is tags is and you can examine it using vcgencmd get_throttled command.
I think I mentioned it. But still you need to shut it properly down
thanks andreas for this video! very informative as always!
As many other viewers have suggested, most modern MCUs, even smallest ones (e.g. ATTiny), have brownout detection capabilities. In another way, also the raspberry pi has undervoltage detection capabilities (the "yellow lightning bolt") and you can write a script that powers it off.
As for new designed boards, I suggest to use single PMICs that have all those function built-in.
Otherwise, selecting a LDO or a Battery IC with a V_OK pin could be another solution.
What PMIC would you use for a 3.3 volts project? And what LDO? This couls be interesting for other viewers, too.
@@AndreasSpiess From Texas Instruments:
- TPS3702 Supervisor IC has capability for UV and OV monitoring
- TPS778 LDO has a power-good output
- As for integrated solutions, the BQ25570 you showed in video #278 has all those capabilities but is not so cheap
By the way, TI, Analog, ST and many more companies are making these kinds of ICs, but they are using really small and often BGA packages, so it is difficult for a maker to use them in prototyping. Those ICs are also application-specific and not general purpose, so I suggest to take a look at the catalogs.
Thanks for the part numbers. The ones I saw were also for smaller voltages...
@@albygnigni Unfortunately not found on aliexpress for 2-3$ 10-20pcs like other parts :( Thanks for the tips !
@@BitsOfBoris You can try to look at LCSC, I have found the TPS3705-33 that is similar to the TPS3702 and it is 0.45€/piece , while the LDO can be found in the adj version (TPS77801D) for 3.82€/piece
Andreas: Nice video on a useful and perhaps lesser-known part. A minor point -- in your schematics the battery symbol is upside down. The long bar represents positive in the standard symbol.
You are right.
This solution is good for the esp as it can reset everything even if you use third party code like tasmota. I have found that bod on chip can be troublesome in some applications and is different for each cpu this gives the same solution for all and you can debug it with a scope.
One point on the input resistor divider for the comparator in the devices. The voltage reference will need some headroom to operate so needs to be below the threshold voltage. A good explanation of their operation, thanks Andreas.
I also did not find out how to use the BOD signal in code. And BOD only works if the MPU still works, so above 2.3 volts.
This was awesome. I think it explains what happened to my Raspberry Pi when the mains cut off during a bad storm.
The Raspberry has a different problem because it has an operating system and has to be shutdown, not only switched off. At the end of the video I showed how it has to be done for a Pi.
i was glad to watch your video, i was experimenting with KA75330 ordered on ali but i got a TO-92 thyristor instead of the real ka75330 i followed your link and ordered new one and those where the right parts. ik took me some time to figure out what was wrong, it did not act as a comparator and let my Peak DCA-75 decide what it is , and the answer was thyristor and a quick test with multimeter on ohm range and connecting anode to gate proved it , yesterday i received the correct parts, tested it, i use a 180 ohm pull up and on 3.17 volt the output drops to 0 volt , and on 3.22 volt it returns to normal high level, so i was glad to have received the correct parts, i emailed the supplier on ali that his parts are wrong , did not get a answer from him yet.
one thing that suprises me, if you look at the datasheet of a KA75330 the - input is the voltage reference, So if V-in drops below the voltage reference the output transistor is being shut- off so the output should rise to VCC but instead is is being dropped to 0 volt ,so the output transistor is on and the collector voltage drops to 0 volts, is this a bug in the datasheet?, with this behaviour it can be connected to a ESP8266 and will be halted if the voltage drops below 3.17 volts and release at 3.22 volts so that's gooed but it contradicts the datasheet, the - input wil be higher so the op-amp output goed to zero.
I think you want this behavior because it is needed. (Think I showed it in the video). Sometimes datasheets only show a simplified version.
@@AndreasSpiess Yes indeed this is the desired behaviour it can be directly connected to reset pin.
Thank you Andreas for another really very userful video! ... I'm using your videos very often as a "reference" to look up things if needed in my projects.. this is definitiv one I'll remember ;-)
Sometimes, I use them as a reference, too ;-)
I had this startup problem with an ESP8266 design. Now I finally know what the problem is! 😎
And not difficult to solve...
This is great, thanks! I use these and a few others that are latching and/or keep the voltage divider outside of the main chip so as to be able to tune the cutoff points. I have a few components that become unstable at weird points like 3.85v, and others that need to be effectively removed from the circuit until the battery has had a chance to get back up to a decent level.
Maybe a list of your parts would be interesting for other viewers?
@@AndreasSpiess oops! Thought I had mentioned it, but the MAX8354/835 series is my go-to for latching. Here's a little more information to make up for not mentioning that r in the first message :) The internal reference is only 1.2v giving it a very broad range. It's extremely low power consumption (I usually see 1-3uA), so perfect for battery devices. A bit more expensive and SMD, so as always depends on your application. 834 if an open drain, and 835 is push/pull. Either can use separate VCC and monitored voltage on case you're working with things outside of its native VCC range.
Sorry for missing the connection to another message. I get a lot and I am already quite old ;-)
Hallo Herr Spiess.
Danke für viele sehr interessante Videos, die mir schon oft bei der Lösung von Problemen geholfen haben.
Eine kleine Anmerkung zu diesem Video:
Die Batteriesymbole sind vermutlich falsch gepolt. ( Der längere Strich ist beim Batteriesymbol der Pluspol. )
Ja, unterdessen weiss ich es. Obwohl es für mich logischer ist, den Minuspol grösser zu zeichnen...
Eselsbrücke für meine Schülerinnen und Schüler: Aus dem langen Strich könnte man noch ein plus machen :-)
Hello sir, I love to learn from your channel and I haven't missed a single video from you. You have addressed the really critical issue for professional product development. As a beginner, I want to know all the essential kinds of stuff like this (the critical one that most of the hobbyist miss). Please suggest me some books or any resources that teach me these kinds of stuff.
There are not a lot of books for this modern stuff. I showed my only books I have in other videos.
@@AndreasSpiess it would be a great help for me if you can please post the link for the video describing books or post the name of the book in comment.. Sir..
Always enjoy watching your videos. Thanks for the good work.
Glad you like them!
The first voltage supervisor I used was the TL7705, this had a problem that it released the reset when its own supply voltage is low. When my company switched from the NMOS to the CMOS 8085, the processor continued to operate below the supply voltage at which the reset circuit stopped working. The result was that the processor would restart (leave reset) during the time it was being switched off. It is worth checking that the reset signal is maintained until the processor is safely off. Ideally the reset signal should be maintained all the way down to zero supply volts, One solution to this problem is make the reset a passive resistor pull down signal and "NOT in reset" active high.
You are right. I showed that the three switch on again at around 0.7 volts. Which should be ok for a 3.3 volt MCU.
This video is so amazing for me keep it up sir and keep make us knowledgeable. Thanks
Glad you liked it! Thank you.
Good explanation . So i am using the KA75330 with an esp32 Epaper to wake when the battery gets to low. to display a low battery warning and then putting the esp to sleep only to be wake when the KA75330 signal goes high to clear the low voltage warning. As one of the big issues with epaper is if the battery goes flat.Iit just sits there displaying the last thing displayed, and the user has no idea that it is not functioning or updating. It would be useful for esp32 e-paper such as LILYGO® TTGO T5 V2.3.1_2.13 Inch E-Paper added a battery monitor chip to the board as standard.
Good point! And a good implementation of a solution.
Thank you for bringing this topic to our attention! I knew these things were out there, but never thought about their application in my hobby projects. Now I have yet another thing to put on my long list of stuff to think about! (Also, I think your battery schematic symbol is backwards?)
You are right. A few viewers "complained" about the battery symbol. I was too lazy to look it up because I felt it was not so important (for me)
Why doesn't the Raspberry Pi have this as part of its board? Would save many a SD card from getting corrupted.
Great video, I'll need to get some of these parts and start incorporating them with my boards.
Ihe Pi4 seems to have one. But because the Raspberries have an operationg system you have to shut them down, not just switch them off. This is the reason for my proposal at the end of the video.
I went into this video thinking he was referring to Voltage Regulators, but due to a language/interpretation issue was calling them Supervisors, and that I wasn't going to learn much if anything... Whoops my bad, and I learned two things to add insult to my hubris: I'm not as smart as I thought I was, and learned about a part, that even as a professional (many years ago), I didn't know about.
This Swiss' videos are always perfectly researched. And satisfying to learn from.
@@abhijitborah He's Swiss .....
@@whitefields5595 Seeking a thousand pardons. My bad. Thanks, edited it out.
Please check, but I think you have your battery symbol positive and negative mixed up in some of your circuit diagrams. The positive line in the battery symbol is longer (more positive) and the negative is shorter (or minus) is how I remember.
Thank you!
These seem very useful but simple to use at the same time. Off to shopping, thanks!
:-) Not an expensive buy, fortunately...
This is what i have been waiting for a long time. Thanks👍
You are welcome!
Very informative. I knew my esp32cam resets due to low power on my arduino toy mobot but didn't know how to prevent it. Had to power it separately. Thanks for sharing this.
It is always better to use a stable power supply...
For the Esp32 you need to configure your brownout detection voltage: docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html#config-esp32-brownout-detox then you not need any external voltage supervisors.
The brownout detector is useful but doesn't cover all possible failure scenarios as Andreas shows in the video. This is why Espressif have the additional recommendation to include an external supervisor.
@Ralf: I tried to change the BOD threashold voltage as well as the alarm in Arduino IDE. I only was capable to switch BOD off, but not more :-( I would be glad if you have more info.
And BOD only worked if the CPU still worked. So no protection against "gibbersh" and Flash error.
Exactly. For such low currents and voltages no need for some supervisor complicating the project. Even decent Zener diode will do here
Besides you can power your esp with small power bank that has all the protections you need
@@browaruspierogus2182 I tend to think ESP and others are targeted to button cell power primarily as they all fight for the less consumed power as possible.
You should definitely make a part 2, digging further on Power on Reset (POR) and Brown Out Detection (BOD).
The whole point of a MCU is to have all those components integrated *and* to make use of them.
Using an external supervisor is only for very specific cases.
I looked into the brownout detector of the ESP32. It works if you reduce the voltage from 3.3 volts. But I did not find a way to reset the MCU down after this message. The brownout message did not shut the CPU down. And it is not very well documented...
Great video. That was exactly what my solar temperature sensor was missing!
Fortunately, not complicated to add ;-)
I have a number of LiIon battery projects these would be handy for. Preventing Over charge and or Over Discharge situations. Been using the LM393 and resistor divider. This would be much easier I think. 3.3v version is just about ideal for the task on LiIon cells and with a added resistor would work for the LeFePo4 type. Just ordered 10 to mess with. Thank You. China is having some rather serious issues with the virus thing . Orders are taking quite a bit longer then the normal long times in the past. Guessing this one will take two months to show up.
Overvoltage protection is often built-in into the charging chips.
Comprehensive description and demonstration.
Thank you! I am still watching your (epic) video.. My wife easily can watch a whole Netflix series during he same time ;-) It seems you had a great time.
@@AndreasSpiess HA! Yes it was a good 21st birthday for her. I hated the ice hotel but the Northern Lights made up for everything.
IIRC you can power 3.3V MCUs like the ESPs by simply using a LiFePO4 cell (w' it's protection-&-charging circuitry) *without any voltage regulator.* You may have even already had a video about this, i forget.
The cell won't get charged above 3.6V, and the protection circuit will probably kick-in and cut off the battery when it gets down to around --2.5V. So you'll never get outof the ESP's voltage range.--
_Edit: LiFePO4 protection circuits cut it off at 2.1V, so it may still be a problem on the low end._
Changing the battery technology is not a solution.But if your battery has a low voltage protection, you do not need this part.
Oh man wie konnte mir der coole Kanal so lange Zeit verborgen bleiben?!?! Saubere Arbeit! Gleich abonniert weil geiler shit!!
Willkommen and Bord! Du hast ja noch etwas aufzuholen wenn du willst ;-)
@@AndreasSpiess Hi Andreas, vielen Dank, ich bin schon fleissig dabei deine Videos zu schauen, da werde ich definitiv eine Weile beschaftigt sein, aber der Wille ist ungebrochen! ;-) Wäre schön Leute aus der gleichen Gegend zu treffen die ebefalls an dem Thema interessiert sind. Hast du da vielleicht ne Idee?
@@fullpower8382 Es gibt in verschiedenen Städten Gruppen rund um TTN.. Die sollten auf der TTN Homepage gelistet sein.
Thanks for the heads-up! Got some nasty problems with undervoltage.
I can't find a voltage detector for >4v threshold with to-92 footprint on AliExpress. I am currently working with the wemos development boards and had some problems with undervoltage. Now I want to keep the reset pulled to GND untill the 5V supply voltage is above 4V.
I use the ka75450 for 4.5 volts. It does not come in a TO-92. This is a very old case.
Interesting and useful.
It is a perfect addition to my battery powered project.
One question: on 12:30 minutes on your video you show a diagram of a circuit to shut down not only the ESP32 but also all peripherals when the battery is under 3.3v but show no values for the resistors. How can I calculate the resistors for the circuit?
Thanks again.
You do not need to do any calculations. Just pick two (If I remember I used 22k). But they do not matter too much.
You need a batt ups with pi as they corrupt fat sdcards easily. This is a cool/geil way to monitor voltages and shutdown and on safely. Thanks andreas!👍
This is particularly true if you add a few super caps or a small battery as shown at the end of the video.
Wow, I couldn't have imagined that a capacitor in Vcc was the culprit to one of my projects. 👍
:-)
excellent video as always..i would like to ask 2 more things:
1) if you use PROTECTED lipo battery (in built protection) do you have to use the voltage supervisors to prevent from undervoltage or the battery itself is sufficient?
2) do you need voltage supervisor for a project running with lifepo4 that as i remember in another video you said are safe from undervoltage?
1. If the battery safely shuts down before the MCUs low specification you should not need such a device.
2. The battery technology has no effect on this topic. Also LiFePo4 batteries can crash your MCU. They just seem to be less harmed by deeply discharging the battery.
@@AndreasSpiess 1) as far as i know my battery (i dont know if its a standard for all li-ion protected batteries) has cut-off at 2.65V, so i guess i want be a good voltage for esp32, so i want a voltage supervisor..
2) hm..i know that its battery unrelated, but i assumed that because LiFePO4 is safer when they discharge (no explosions like lipo?)they will be safe for MCU..which is wrong.. maybe they will not explode but they will undervoltage the MCU..and unexpected behaviors will be sure thing
Based on illustration at 12:31 in the video; are additional parts required to connect a Telcom TC54VN2902EZB to an International Rectifier IRLZ44N? No circuit designer here; just an Arduino/ESP coder. How are R1 and R2 calculated? Thank you Mr. Spiess for the video.
I would try it with 2 4.7k resistors. But the values are not critical.
@@AndreasSpiess Thank you Mr. Spiess.
Hi William, I’m a designer and would like to help you with your query.
Calculation R1&R2::: The R1 & R2 value used to make adjustments in the tripping point of VDET- value. Usually this VDET- is pre-programmed during prototyping. Let’s say the tripping voltage should be 2V at 100uA bleed current (The IRLZ44N’s threshold value of the gate terminal voltage is 2V). Then, the R1+R2 value will be 2V/100uA = 20kOhms.
The battery used is 5V, and the requirement for the IRLZ44N is 2V for gate voltage.
2V/5V = R2/R1+R2
0.4 = R2/20kOhms
R2 = 8kOhms, R1 = 17kOhms;
The below-shown reference schematic will help you with understanding more clearly, I have drawn TC54 voltage supervisors with an IRLZ44N rectifier.
www.flux.ai/ramprakashvishnoi8/tc54-voltage-supervisor-with-irlz44n-rectifier
Let me know if you any questions in your mind.
Cheers,
Ram
Andreas, could you propose a new video with new Voltage Supervisors available on the market (shortage)? There are some of Onsemi, Dallas, Microchip also in THS TO92 size
I have no such plans. I think it is easy to find other such parts because they are simple and you only have to select the desired value.
Aren't the inputs of the internal comparator of the KA75330 the wrong way round? According to the blockdiagram if the input (through the resistive divider) is higher than the reference the comparator switches on the transistor, which pulls the output low. Most devices have an active low reset pin, which means the KA75xxx would reset them as soon as the voltage reaches the desired level instead of the other way round.
I used the diagram from the datasheet..I do not know how the comparator is wired internally.
Hi Andreas, thanks for the awesome video.
As I'm still quite new to making my individual electronics projects so your videos help me quite a lot. I have a question regarding the supercapacitors for using with the KA75450 as a safe shutdown system for the raspberry Pi:
In your video #133 you suggested 15-20 F supercaps to have enough time for the Pi to safely shut down. That video was before the Pi4 and I was wondering whether the 15-20F recommendation still applies with the Pi4's power consumption?
Thanks in advance.
You have to try. I do not know. I assume the Pi for will also shutdown faster.
Indeed a very good video, but I think you got carried away, because you forgot to tell us how to protect against overvoltage. :)
In my house, the AC from the wall outlet is specified to be 230V, but since this is on an island, where the power-cables are more than 10 km long, you can imagine that there are some quite large spikes when the neighbour turn on their high-power farming machinery (or if someone on the island descides to weld some stuff).
I've measured voltages below 220V and above 240V. This is way out of the official spec.
Now if my 230V power supply gets too high a voltage, it translates that voltage to a too high DC and passes this voltage onto my single-board computer (I've tried that with a CubieBoard2). My CubieBoard2 popped and so did the step-down converter I had between the power supply and the CubieBoard2.
-So it'd be great to have a good way of preventing this kind of thing happening. To some extend, capacitors would help, but I'd like to clamp over-voltage too.
This is a matter of choosing a proper AC power supply, I think. Not very much linked to this topic.My cheap USB wall charger is rates from 110 - 240 volts. So I assume it will survive also 250 volts. Maybe you had another problem?
Thank you for your reply. :)
Well, the problem is that the voltage may spike over 300V sometimes (that is in addition to the AC not being within spec) and that I have my server (harddisks, network and single-board-computer) running on this grid. If one gets a spike, it's very likely that it'll fry more than one unit.
I think it's fairly within reach to turn off the power if it goes above a certain voltage.
A MeanWell power supply allows 90VAC to 264VAC, which means if the voltage climbs above 260V, I could hard switch (eg. a relay) the power to the PSU on the primary side, while keeping capacitors on the secondary side and having zener diode protection on the secondary side (probably before the capacitors).
The larger capacitors, the better, because I figure they'll just "divide" the voltage down to a harmless level.
Then after the capacitors, one could have either zener or a final voltage regulator.
All this would of course be a bit bulky and I guess that if lightning stroke, then it'd all be wasted anyway.
I would work on the primary side, not on the secondary to prevent such spikes. As you describe it does not fry only one piece.
My concern about only turning off the primary side is that if you take a standard transformer (without regulation added), you will get a high spike on the secondary side when turning off the transformer.
That's why I'd add the capacitors, zeners and regulator.
There's likely a much simpler or better solution than the one I've been thinking of - but sometimes it's difficult to see obvious solutions. ;)
Helpful video 👍
Thank you!
In the beginning of the video, you said the raspberry pi runs at 3.3v. I understand that the broadcom chip runs at 3.3v, but the board is designed to fun at 5v, with an LDO that powers the processor and gpio at 3.3v. I assume you meant to refer to the rpi as an example of where you use the 4.5v supervisor.
Yes
Excellent advice and very informative. Thanks Andreas...
You are welcome!
Very helpful video for me as it help me to get the idea to solve the problem in flight controller for a mini quad powered with 1s 3.7volt lipo where it got discharged below 3volt if I continue to fly the quad for some more time after low battery indication (a small camera connected with battery will keep on consume current even after landing the drone)... by using this small component i can protect my lipo by cutting the supply if Vbat < 3volt. Thanks for this informative video as always :)
I have a NO/NC basic 5vdc relay already in hand. Do you think I could use that to replace the KA75450 voltage supervisor? In my raspberry pi 3 setup I'm using a 5v 10A switching power supply to power the pi, touch screen display and Arduino. I'm using the GPIO3/GND pins to safely turn on/off the pi but would like to add the (2) 2.7v 10F super capacitors as shown in your awesome videos. I would wire the Coil in the relay to the 5v power supply and wire the COM/NC pins to the GND/GPIO3 pins on the pi. Now if I turn off or lose power from the 5v power supply the relay will close and the GPIO3 pin will make contact with the GND pin thus activating a safe shutdown meanwhile the caps provide power. Please note I would need to provide a diode up stream of the super caps to prevent them from energizing the coil.
You need a very sharp and reliable cutoff voltage which you will not get with a relay. The relay will once switch at a higher and sometimes at a lower voltage.
Thank you very much for this video! Will immediately add this to our solar power system. Can I use any resistor for the KA75330 circuit?
More or less. I uses 22k
Thanks, a very interesting and well presented lesson.
You are welcome!
Very very good Andreas! Good video as always 😉
Thank you!
Hi Andreas, Njce video. I guess this is handling levels below what can be done with Brown out detection, which is present in many MCUs. I did some work with ATmega and configured BOD to be able to be stable on quite a low voltages.
The ESP32 also has a BOD. Biut it only worked if hte processor still worked. So no protection if you come from below the threshold. And it seems yo ucan fool the Atmega 328, too (th-cam.com/video/6Pf3pY3GxBM/w-d-xo.html )
Great video again. I have a question for specific use case. Is it possible to use RC timer circuit before this device to create an user adjustable power up/down trigger circuit instead of using regular deep sleep feature of micrcontroller ? In other words is it possible to use such circuit inplace of more expensive and not so user friendly (SMD soldering) TPL5110 ? What could be the power consumption theoretically of such circuit when micro controller is powered down ?
Any feedback are appreciated.
Thanks.
I think the TPL5110 is a good solution for such problems. You find the quiescent current in the datasheets of the respective device. It is probably a bit higher . And the RC might add an additional few nA Maybe you try if you do not like the TPL...
@@AndreasSpiess Thank you for your reply. I will have to try it.
Thank you! That's a very interesting chip. So useful! You are a great teacher.
You are welcome!
Thanks for the video! I hope if we use supervisor chip we may bypass the voltage regulator and connect the esp directly to the battery or use an ldo for additional protection. But deep discharge won't happen? And the battery OK led will be quite useful. Can we connect it to the same supervisor as that on the RESET pin?
These devices have different functions. An ESP should not be connected to more than 3.6 volts. So you need an LDO for LiIon batteries.
Often these supervisors are connected to reset pins to make sure the MCU only boots with enough voltage.
Sorry i forgot to mention 3xNiMh in series will mean 0.9x3=2.7 low cut-off and 1.2x3=3.6 max voltage. So a 3-3.6V supervisor will mean LDO is not required if we charge it externally. But, if we need charging facility also, an LDO will also be required and we may connect it directly to USB for charging 1.6x3=4.8 of course if there was some arrangement to limit currents. Of course, a suitable solar panel would limit charging current but maybe an LDO will be required. Of course, with a LIPO we may need an LDO. Unfortunately, i did not find cheap LiFePo4 here and they don't ship batteries from china..
Thanks, Great video. What about the TL7702 series. I use it on sensitive applications but never tested if they actually perform. I took the word of Texas instruments for granted
They seem to be a little more sophisicated chips. But with a similar purpose.
Useful little devices, thanks Andreas
True! You are welcome.
Thank you for this video. I had made a solar panel powered ESP8266, and on grey clouded days it drained the last juice of the battery, making it stop forever. I had to go to my balcony and disconnect it for a day and then hope for sunnier days ahead.
These supervisors I had thought of, but being a mechanical engineer could not figure out how to make some circuitry that is also very power efficient. A relay would not work. This video will bring a solution to that! BUT, maybe an obvious one for others, but how to I cap (maximize) off the battery-power from frying the ESP8266 at say 3.6 Volt. Is there in existence that springs to your mind, like an inverted supervisor for that?
Thanks for all the videos. I feel like the cowboy movies, when they were made at the time it was normal, and people were not surprised with next Robert Mitchum movie. The enormous efforts to make these movies with cattle and all, makes them impossible to make today. I hope I have not seen the last of your 'movies' from your hand, thanks again!
The „inverted supervisor“ is called „LDO“ low dropout voltage regulator.
this video has reveal the mystery I faced when working with power hungry gsm module
Then maybe a large capacitor is a better idea to prevent such situations ;-)
Am I missing something or is the diagram (7:49) incorrect? It seems to me that the + and - inputs of the opamp/comparator are reversed. As it is drawn, if the input voltage is higher than the reference voltage the output becomes high and the transistor pulls the output pin to ground.
Indeed. In the KA75xxx datasheet it is connected to a uC which has RESET active high. Seems like a contradiction to the Scope shots...
I copied the diagram in the data sheet. They do not disclose how the comparator work. Maybe tehy use the same diagram for components with active low nad high ;-)
Your videos are the best, I learn lots thx!
Glad you like them!
A great informational video. Thanks a lot. I was searching for the same.
You are welcome!
Beautifully explained
Thank you!
I hope you'll see this!!!
My question is this. What's the function of the brownout detector in the esp32 in place of a voltage supervisor. It doesn't work at startup?
I do not know because the ESP always boots and crashes in this state (and drains your battery very fast (as you see in my newest video)
@@AndreasSpiess thank for the prompt reply. Unlike the atmel AVR that the brownout detector resets the MCU, that of of ESP just detects and crashes.
However, do you have much idea about brownout detector in the atmega328p used on the famous Arduino. I'm aware that the BOD resets the MCU from brownouts during operation by resetting the MCU. My question is this, does the BOD protect it under startup too?
I do not know the BOD of the Atmega chips :-(
@@AndreasSpiess thank you 😀
Thanks Andreas. Useful for all those solar projects this summer! .... could you end videos like this with some suggested cct diagrams for Standard Speiss Designs (SSDs). For example, I have a solar cell charging a super capacitor bank that feeds an Arduino based stepper motor for a green house window opener. When the sky clouds over and the temp inside the green house falls, I want to close the window while I still have enough power in the supercaps to drive the stepper motor to close the window. If it stays cloudy and the supercapacitor voltage falls further, I want to close down the Arduino. When the solar recharges the supercaps I want to re-start the Arduino then bring things back to life. A Standard Speiss Design cct could be drawn for this purpose and used for any project requiring phase shut down and phase power up based on predictable fluctuating supply voltages
Of course, others will also have battery based applications. As a super capacitor bank is the same logic and a battery, the above SSD would apply to battery projects too.
So at the and of the videos just display a sketch design that we can all pause the video, steal the design, and give you credit!
As a longtime subscriber you know that I usually try to show useful parts which then can be assembled into projects by my viewers. And sometimes I asssemble them myself in a project.
Concerning your project: Ass long as the Arduino is running you can use it to measure voltage and to decide if you have enough power left to close the windows. And you have only to take care that the Arduino shuts down and powers op in a clean way.
Maybe an old Car battery is also a solution. Then you should be able to accumulate more energy during sunshine.
@@AndreasSpiess Thank you for responding. I want to use supercaps because of the faster charge and higher discharge profile is ideally suited to the intermittent use of my stepper motor applications. I also have a developing 2-axis solar tracker that will also use super caps and stepper motors to keep my solar panel tracking the sun. I already use the Arduino to sense the solar and supercap voltage. However, I like to try and keep power management out of software and use discrete components for charge sensing and control. Hence I like this video introducing these voltage supervisors. I will use the lead-acid 'leisure' battery bank as my final energy store. Perhaps there is slight duplication here .... but I like the fact that the power management control system is 'separate' from the final energy store. Also, we must start using those supercapacitors for something! .... Could you do more solar related stuff please?
Very interesting topic. The only issue I see here is with boards that have LiPo battery connector. If internal power gets very low/off the on-board battery kicks in. But what would happen if external power is still low/off by the time the battery power drops to low voltage? :-/
You have to place the supervisor at the power pin of the MCU
@@AndreasSpiess Oh, I havent thought of that. Thanks!
Hello Andreas. Does 18650 battery module shield already have this mechanism ? or we have to make this on our own. Thanks
Some have it. You have to read the specifications
Danke für das tolle Video, weiter so! Habe mir gleich den TPS3839G33 für mein Lipo-Sensor-Projekt geholt und den Reset-Ausgang über 10K mit dem Enable-Pin des ESPs verbunden. Und jetzt leider eine Reset-Loop beim Start, hoffe ihr könnt helfen.
Weitere daten: Low-Dropout-Spannungsregler HT7333-A mit 1000uF vor und 100nF + 100uF Kondensator danach. Eingangsspannung von 4.2 bis leer also ~3V.
Ursache: Laut Oszilloskop verbraucht der esp8266 beim Start zuviel Strom das die Spannung kurzzeitig unter die 2,9x Volt fällt und der Reset ausgelöst wird. Der ESP geht aus, die Spannung stabilisiert sich und nach den 200ms beginnt der Spaß von vorn. Beobachte ich die Spannung mit überbrücktem Enable-Pin fällt diese kurzzeitig auf 2,90V erholt sich dann aber wieder. Der ESP funktioniert währenddessen. Ich muss also nur irgendwie den Start überbrücken.
Jemand eine Idee?
Mach den 1000uF Kondensator direkt von 3,3 v zu GND des ESP. Du musst diesen Spannunsabfall vermeiden.
Please more content like this. I order pcb designs from freelancers and they just execute, I need to tell them everything. I had one esp8266 board designed without this component because I didn't know about it. Now I'm paying the price when battery voltage goes down. And it's hard to reach to rest 😪 😞
Bad luck. Next time you know ;-)
@@AndreasSpiess my comment was removed. did I break any rules?
@@solidfuel0 TH-cam does no more allow links :-(
This was super useful information. Many thanks
You are welcome!
So, to sum up, if i were to design a UPS with TP4056 charger ,DW01 protection IC ,LM6206 Boost IC,i should add these Voltage Supervisor IC to enable/disable the Boost IC?
P/S : been waiting for the answer for your video #250 since then about UPS and somehow i think you're trying to relate these two? Please, correct me if i'm wrong.
This video has nothing to do with UPS. It protects the MPU and does not care where the voltage comes from.
@@AndreasSpiess Thank you for your replies! Really appreciate your time for going through comments from your fans here! Keep up your good work!
You could use the Tl431A for the same purpose it will be handy.
You are right. With a few more parts...
@@AndreasSpiess Yep. it has a programmable threshold.
Congratulations from Brazil.
Very nice video, useful and informative!
Thank you!
Thanks. Is there a similar video for over voltage, surge, spikes? thanks
I do not know.
Thank you for the nice-to-know-stuff!
:-)
in order to protect the Pi with a safeshutdown, should we use this ? or to rephrase : I always hear that Pi are very sensitive when turned off, and that we need a hardware safeshutdown, but also a software that will be triggered (script) to shutdown properly the device. i never understood why is this not by default in the Pi...But anyway , my question is : would this help to solve this matter or would you recommend something else ? if so, what ? thanks !
I made a video and showed how it can be done at the end of this video. It is now part of the standard. But you have to use it.
Hello Andreas, one question: i want to use the KA75290, to disable my ESP if VCC is lower than 2.75V. But .. what if my LiFePo4-Battery is charged, and gets more than 3.05V? Wouldn't the Supervisor set its output to HIGH, and my ESP will be switched off? 3.05V is the Max Detecting voltage of the KA75290 according to the Datasheet.
If you connect it to RST your ESP should start at around 3.05 volts. Below 2.9v it should be reset.
@@AndreasSpiess Thank you! Sometimes the answer is just easy :-)
I continued and ran into two more problems. First, the RST-Pin is also connected to D0 of my Wemos-Mini, for waking up from DeepSleep. Since D0, and the Voltage-Supervisor are not always at the same state (high, low) it comes to the situation, that there is a level of 1,7V on RST (maybe the built-in resistors in GPIO and the voltage-supervisor act as a voltage divider). I solved this, by adding two diodes to decouple them.
Second problem appears, when Vcc rises above 2,63V (Reset-Voltage of my SGM809B-RXN3LG). The supervisor starts bringing its output high, and then the whole system starts oscillating. This only stops when Vcc gets a bit higher - maybe the hysteresis of the SGM809B is too small, or my cap is too small (470µF). The ESP doesn't like this at all, and Tasmota even loses part of its config!
Thanks Andreas, this is really helpful
You are welcome!
very useful, as always! Thank you Andreas.
You are welcome!
What value pull up resistor did you use with the KA75330 and the ESP32?
I do not remember. I would start with 4.7k
@@AndreasSpiess thanks for the reply Andreas
Excelente information Andreas!! Thank you very much!!!!
You are welcome!
Could a similar mechanism be used to boot up an wemos d1 mini on a supply that shuts off at 100mA. An elco on the power line can buffer the Esp spikes during boot and wifi, but keeping the esp8266 powered off during elco charge (say 3300u) is then required. Older Dutch smart meters have 100mA power shut offs, newer ones have 250 or even 500mA shut-offs. Any advice?
These parts do what I described. They only act on voltage.
@@AndreasSpiess thanks, but the operative concept was ‘similar mechanism’. Do you have ideas on how to prevent (say 100mA) current shut off supplies, from shutting off if powering esp8266’s that produce, as far as I can see, 470 mA spikes?
This sounds like exactly what I need. Thank you very much!
You are welcome!
how can I modify the 4056 LIPO charger to cut load current at battery under voltage of 3V instead of 2.5V ? This may serve the purpose too ?
(we are doing research for smoke free world - a soil moisture sensor system that can function independently in remote locations, and respond to wifi when available)
The 4046 has no undervoltage protection. You have to add this functionality or buy a board with this feature.
Some supervisors, like ADM1232, even have an integrated watchdog to reboot the device if it gets stuck... I didn't know such devices exist, I will use them more in my home-made lab equipment...
Good idea!