Storage cap. before or after regulator - Page 1
Forum section: electronics / projects

author: JJalling
author_rank: Unknown
timestamp: July 02, 2020, 03:36:37 pm
content: Hello all,I'm making a small circuit for an electricity meter. I want to connect a ESP8266 to the meter, however the meter specs states 4V+- 250mV @75mA.So, I need to lower the voltage to 3.3V for the ESP8266, but also need enough power to actually transmit something (the datasheet states 170mA when transmitting).Where would you put a bunch of "big" capacitors? At the input (~4V) before the regulator, or after the regulator, at the 3.3V rail?And what about the current limit? Just a series resistor or something more "clever"?Thanks for all your input,BR Jonas

author: pardo-bsso
author_rank: Frequent Contributor
timestamp: July 02, 2020, 05:12:24 pm
content: Which voltage regulator are you using to power the ESP8266?The datasheet should specify a range of values (and esr) that would give a correct operation without risk of it running into oscillation.Most of the ams1117-3.3 clones that I have here seem to be happy with a cheap 10uF electrolytic and the esp works fine.A cap before, sure.A cap after, read the docs.

author: JJalling
author_rank: Unknown
timestamp: July 02, 2020, 05:47:42 pm
content: My first plan was to use a zener diode and a resistor, so I don't really see any problem with oscillation.You mention a 10uF capacitor for powering the ESP8266 - I don't really see how that will give me enough power to transmit a full ethernet frame. Remember that my max current draw at the "high" side of the psu is 75mA.So maybe you can elaborate a bit on your suggested solution.BR Jonas

author: Siwastaja
author_rank: Super Contributor
timestamp: July 02, 2020, 05:54:04 pm
content: For wifi, the burst of current are so long it's impractical to store the energy required in capacitors.This means, the regulator and the input power supply must be able to deal with this peak current.In your case, it seems your power source is unable to supply the peak current you need. If the average current is OK, you can try to add LARGE capacitors. Try with some 10000uF first; the solution will be bulky. Capacitors go before the regulator so that you can maximize the voltage swing on the capacitors; the stored energy depends on the delta V. Note that the power supply may be stressed in this use.For the same reason, use the lowest drop out regulator you can find not to waste any precious voltage. 1117 is total and utter shit from the history books, oscillates easily with wrong type of output capacitor, and the specified HUGE 1V dropout makes it a non-starter: you require max 0.7V dropout, and that has zero tolerance against input variations. Look for regulators with drop-out less than 0.2-0.3V or so. Yeah, 1V drop-out was "low drop-out" in 1980's.

author: mariush
author_rank: Super Contributor
timestamp: July 02, 2020, 05:54:29 pm
content: You don't need to limit the current, the linear regulator will produce as much current as the chip needs.You will need a capacitor before and (often) after the regulator.When your ESP chip suddenly starts transmitting and consumes all of the sudden 150+ mA of current, the linear regulator has to take a lot of energy from the input and output that desired stable voltage. If the wires on the input are long, they can behave as inductors, resisting the change of current, so the input voltage can slightly go down for a bit. The wires also have some resistance, so again the voltage drop on the wires will increase as the current increases. So a capacitor on the input can act like a buffer of energy to minimize that fluctuation of input voltage when power consumption of the chip changes suddenly.The actual value on the input is not very important, typically as little as 10uF is recommended if the incoming voltage is already somewhat regulated. If you have an AC transformer and you rectify the AC voltage using a diode or some bridge rectifier, a bigger capacitor may be required.If the voltage is somewhat regulated, like i said, something like 10uF is probably enough, but there's no reason why you can't use bigger values like 47uF or 100uF or 220uF ... it's just often pointless to use big capacitance, not giving you any benefit.For output capacitance, it depends on the regulator you use. You'll have to pay attention to datasheet, because a lot of regulators will actually require that capacitor to have some technical properties.For example, the 1117 regulators are made by lots of companies, it's a generic chip ... but lots of datasheets will mention the chip needs a capacitor on the output and says that the ESR of a capacitor on the output should be between 0.1 ohm and 1 ohm, while the actual capacity is not important.So that's where it's important to realize that ceramic capacitors have very low esr, under 0.1 ohm, so you shouldn't use a 1uF ceramic capacitor on the output.A lot of datasheets will use 10uF or 22uF on example circuits and don't mention that "esr must be between 0.1 ohm and 1 ohm" but say "a tantalum capacitor is recommended" - basically you're supposed to know that tantalum capacitors typically have esr higher than 0.1 ohmElectrolytic capacitors in the 1uF .. 100 uF will typically have esr above 0.1 ohm, some super low esr high end series may have less than 0.1 ohm esr above 33-47uF.

author: JJalling
author_rank: Unknown
timestamp: July 03, 2020, 04:40:44 am
content: Thank you all for your suggestions. I probably wasn't clear enough in my first post, but I want to limit the input current, and not exceed the 75mA requirement, since I don't know what will happen.Some users report that they have gotten a warning from the electricity company, others that their communications port on the meter has been disabled after they misused the port.BR Jonas

author: Siwastaja
author_rank: Super Contributor
timestamp: July 03, 2020, 06:44:32 am
content: For example, if the input voltage is 3.75V (as per specified minimum), required minimum output before the ESP brown-outs is, say, 3.0V (an assumption; I don't know the actual requirements), and the drop-out voltage of the LDO is 0.3V, you have a headroom of 0.45V.Now, if the capacitor needs to supply 95mA of current (170mA required; 75mA from the supply) during a burst 10 milliseconds long (just an example, verify the actual timing), the required capacitance would beC = Q/dV = I*t/dV = 95mA*10ms/0.45V = 2111 uF.So should be doable with a 4700uF cap! But beware on that 10ms assumption. The burst length alone is also of little interest if the worst case burst-to-burst interval isn't known. Because if that 75mA is close to the average current, charging the capacitor is slow between the bursts.And indeed, if you aren't allowed to exceed that 75mA, then the "simple" just-add-a-big-cap option is out of question, and you need current limiting.If you really want to limit the input current to exactly no more than 75mA - and I think the average consumption of ESP module might be quite close to that - I see no other choice than purpose-built converter, very low-drop switch-mode or linear, that uses feedback from the input current to actively limit the capacitor charging, to the point it may lose the output regulation if the capacitor isn't big enough.Semiconductors are small and cheap now; energy storage is expensive. If I had to design that beast, I might consider quite complex ideas such as first boosting the 4V up to intermediate voltage for the capacitor link, then buck it back to 3V3, to maximize energy storage, to increase that dV in the equation above. You could easily get away with a, say, 1000uF 10V capacitor with a lot of headroom to spare. But this solution isn't easy to implement unless you are an experienced designer.Passive current limiting solutions, such as NTC, I would otherwise recommend looking at, but your voltage headroom is just so minuscule. (It's ridiculous that people are even talking about 1117 when the maximum dropout you can deal with is 0.45V.) NTC needs to run hot, wasting energy, seen as voltage drop, to maintain its lower on-resistance; it's of course less lossy than a fixed-value resistor, but only by maybe an order of magnitude max.Any classical linear current regulation circuit would mean additional voltage drop of at least 0.3-0.4V, leaving no dropout for the voltage regulator.I'm afraid a simple solution to limiting current does not exist, you need to do some serious design work for it.

author: gcewing
author_rank: Regular Contributor
timestamp: July 03, 2020, 01:57:56 pm
content: Quote from: JJalling on July 03, 2020, 04:40:44 amIt sounds to me like you should be using an external power supply for your transmitter, and not trying to power it from the meter.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 03, 2020, 02:11:37 pm
content: Quote from: gcewing on July 03, 2020, 01:57:56 pmAgree, but I understand how tempting it is to "harvest" the energy that is easily available, especially if the available average power is sufficient and it's "only" about limiting peak consumption and storing a little bit of energy for peaks.

author: JJalling
author_rank: Unknown
timestamp: July 03, 2020, 02:48:39 pm
content: Quote from: gcewing on July 03, 2020, 01:57:56 pmWell. The interface is meant to be used to power loggers and devices like the one I will try to make. I thought that an open source version could be useful.A couple of companies make these modules, normally priced around 150EUR - this is a picture of one of them:and here are the PCB's with a couple of 1F caps.The images are not mine, so I cannot investigate the circuit.BR Jonas

author: Ice-Tea
author_rank: Super Contributor
timestamp: July 03, 2020, 03:05:10 pm
content: I would look for something like this:https://www.onsemi.com/pub/Collateral/FPF2125-D.pdfbut rather with a 75mA limit (not the 150 of this device). Followed by the large cap and LDO.