Notifications
Clear all

ALKALINE D-cell ESP8266-12E

9 Posts
3 Users
1 Likes
1,621 Views
Myron
(@myron)
Member
Joined: 3 years ago
Posts: 7
Topic starter  

I am a self taught amateur. I may have basic nomenclature or assumptions wrong.

 

IMG 20200512 213126

My project goal is to receive a temperature of the garden soil at sunrise each day.  I figured I could put an Arduino in a jar and leave it for a year.  I have the software figured out and it works fine with a LoLin Node MCU.  But to power an ESP8266-12E with a single D-cell is a different thing altogether. 

Where I am at now is that I have a blinking sketch with sleep loaded on an ESP8266-12E with  a BMP280 I will use later.  Powering this I have a bench power to a Pololu U1V11f3  then to my Arduino.

My problem is I don’t know how to size any capacitors I may need to add or even if I have the right regulator.

Andreas Speiss #47 shows a wattage spike when the Arduino connects to WiFi, so he recommended a 1000uF cap.

If I don’t add any caps my Arduino will blink normally. 

If I add a 2200uF cap on the battery side of the regulator, it don’t work.

if I put the 2200uF cap on the 3.3v side of the regulator, it don’t work

Why are sometimes an Electrolytic capacitor recommended instead of a ceramic?

Do some caps leak current? I really want to avoid this.

Should I be buying 3.3v caps?

 

I would appreciate any comments.. 

https://www.pololu.com/product/2563/resources   < Pololu U1V11f3

https://www.aliexpress.com/item/32817286611.html   < BMP280 datasheet

https://docs.ai-thinker.com/_media/esp8266/docs/esp12e_datasheet.pdf   < ESP8266-12E  datasheet

< Speiss #47


   
Quote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 
Posted by: @myron

My problem is I don’t know how to size any capacitors I may need to add or even if I have the right regulator.

Andreas Speiss #47 shows a wattage spike when the Arduino connects to WiFi, so he recommended a 1000uF cap.

If I don’t add any caps my Arduino will blink normally. 

If I add a 2200uF cap on the battery side of the regulator, it don’t work.

if I put the 2200uF cap on the 3.3v side of the regulator, it don’t work

Why are sometimes an Electrolytic capacitor recommended instead of a ceramic?

Do some caps leak current? I really want to avoid this.

Should I be buying 3.3v caps?

This lists most of the common types and describes their usage.

https://www.jameco.com/Jameco/workshop/ProductNews/identifying-caps.html

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1653
 

Hi @myron,

  I haven't played with the ESP8266, and only had a quick play with its larger cousin (ESP32), so there will be things I haven't encountered, but perhaps I can offer a few pointers for you to research a little more. 

With regard to the capacitors:

  • electrolytics are often used when higher values of capacitance are required, simply because they are cheaper and smaller when you exceed a few microFarads ... have a look through the catalogues to get a feel. At say 1 microFarad, which could be ceramic or electrolytic, then you will find ceramic are generally 'better' components, in that their leakage current is probably less, their ESR 'resistance' is lower so that they can handle higher transient currents and so on.  But if you need substantially more than say 10 microFarads, you will find ceramics become unrealistic in most cases. (Some switch mode power supplies etc will parallel a number of ceramics, because electrolytics cannot meet the current requirements.)
  • As for voltage, the general rule is the capacitor rating should be 'comfortably' above the highest voltage it is expected to encounter, since exceeding that voltage can destroy the capacitor. e.g. across 3.3V power lines I would expect to see at least 5V capacitor rating, and in reality it is likely to be a 'convenient' 16V or maybe higher rating. Note, that the cost and size of electrolytic capacitors especially increases rapidly with voltage rating, so they tend to be matched fairly closely to the circuit requirements. By comparison, many ceramics will be say 50V minimum and polyesters, etc maybe 150V minimum.

With regard to regulators:

You may have noted they tend to divide into two types:

  • Linear regulators
  • Switching or Switch mode regulators.

In some circumstances you can use either without too much concern, but they are very different, and they both have their upsides and downsides.

Linear regulators:

  • Simple in 'principle' ... the small ones are essentially a transistor which is being controlled to act like a 'magic variable' resistor between the incoming power source and the outgoing power. This 'magic resistor' is continually 'adjusted' such that the output voltage is fixed at the required value. That is if the load starts to take more current, the 'magic' reduces the value of this 'resistor', and vice versa if the current demand reduces. (Please accept the 'magic variable resistor' is much over-simplified model of the actual circuit, rather like a cartoon analogy, with obvious limitations.)
  • This means that the incoming power must always be at a higher voltage (typically at least 1V higher) than the required output voltage
  • The output voltage is normally fairly 'clean' with minimal spikes etc., except when the load demand is itself is 'spikey'. This means it is often preferred for applications like low level measurement circuits etc. that wil be sensitive to noise.
  • Because it is essentially a resistive voltage drop, albeit 'magically controlled', then the voltage drop between input and output results in heat dissipation. Say for 5V input, 3V output, corresponding to a 2V drop, at 1.5A, then the circuit must dissipate at least 1.5(A) X 2(V) = 3W. In low current circuits, this may not be important, as the low current implies low power dissipation.
  • Because the 'magic' control is essentially a 'simple' analogue circuit, then linear regulators can be made which use very low power when they are delivering a very small current.

Switch mode regulators:

  • More complex ... they are essentially fast switches which are either 'on' or 'off', and they control the output voltage by varying the proportion of time they are on and off. Obviously, a bare switch would output the full input voltage when 'on' and zero voltage when off, whch would not be suitable for a microcontroller (say) expecting a steady DC voltage. So 'after' the switch there will be inductors and capacitors, both of which can store energy, which  'magically average' the switched waveform into a constant voltage. (Once again the over simplification is to 'cartoon-level')
  • A consequence of using inductors and capacitors is that the output voltage can be higher or lower than the input voltage, depending upon the circuit design.
  • Part of the job of the capacitors and inductors is to produce 'DC', but in reality there will be at least a trace of the switching waveform visible at the output. The magnitude of this will depend upon the power supply design and the loading conditions. Most digital circuits will not be affected but low level analogue circuitry may be.
  • As the switch is either 'on' (high current but minimal voltage drop) or 'off' (no current) for most of the time, the resistive power loss, which is current x voltage drop, can be relatively small, so efficiencies of 85%-99% are often quoted. Note the efficiencies quoted are normally between about 25% and 100% of the supply current rating. 
  • However, the control circuits, and the switching action has power losses - these power losses may be small compared the full rating of the power supply. So when the power demand of the load is very low, then these losses may be much greater than the load demand. Under these low power conditions, a linear regulator may be much more efficient.

Sorry if this sounds complicated, but I hope this gives you an appreciation of the situation.

--------

You will note a complication immediately. You are looking to use a single cell with a voltage of around 1.5V to drive a 3.3V circuit, implying the need to have a step up regulator.

But a switch mode regulator tends to have a much higher minimum power draw. Because your design will spend most of its life 'asleep', this is a critical point to deal with. Reducing ESP8266 current demand to 20 microAmps might be 'dwarfed' by a current demand of 1mA or more of the power supply.

It is possible you will find a regulator whose performance is acceptable, but you need to allow for it in your design process. 

---------

Considering the use of capacitors and the high current demands during the WiFi transmissions, discussed in the video, remember the total charge taken out of the battery is not affected by the capacitors.

The effect of the larger capacitors is simply to 'smooth out' the demand .. imagine you are buying a widget for $100. Without the capacitor, you pay the $100 in one transaction. With the larger capacitor, you pay a $1 a day for a 100 days long before you buy your widget ... then the (capacitor) bank pays the $100 on the day you buy it ... so it feels like you haven't paid anything for it on the day you receive it.

Because power supplies must be rated for the maximum power demand, then it is helpful to try to reduce the peak demand, so the video was describing their use as 'bank' of charge. In practice, they are also needed to reduce local voltage drops when the current surge demands are made and the ESP32 cards are often reported to need extra capacitors as they have been 'skimped' to a minimum. (I am guessing the 8266 may be similar to reduce costs.) However, 3000 microfarads is larger than reported values I have seen. In practice, finding the best values is often part of the 'optimising' process, It is actually common to put two capacitors, say 0.1 microFarad ceramic and a 100 microFarad electrolytic in parallel. The 0.1 uF for the fast peaks and the 100 uF for the slightly longer transients.

--------

I am not sure what is happening with your capacitor + blink test. Your observations are not those normally expected. I am assuming you are using a switch mode power supply. They tend to be more 'fussy' than linear ones, and I am wondering if the capacitors are upsetting the power supply to extent it no longer works correctly. I should emphasise this is only a 'wacky' suggestion, and there maybe a simpler explanation.

----------------

I am sorry about the length of all this, but I hope you find it helpful. Good luck with your project!! Dave


   
ReplyQuote
Myron
(@myron)
Member
Joined: 3 years ago
Posts: 7
Topic starter  

Wow thanks @DaveE for all the information. Yes I believe the capacitor is messing with my buck/boost regulator and the regulator don't know where the voltage is at. 

I have a oscilloscope but really don't know how to run it. I would like to see the voltage drop and try capacitors until it is in the acceptable range.

So I think I will write a script that does everything I want it to do except all the sleep time, then maybe I can see the same spikes or drops as Andres Speiss on his scope.

If I can't get that done, I can just try all the capacitors i have until i find one that works. But that seams like a poor way to engineer stuff.

Myron


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1653
 

Hi @myron,

Thanks for your reply.

I would certainly recommend you start 'playing' with your oscilloscope and figuring out how it works and what it can tell you. If you have any questions that Google can't answer, try asking here as someone might know the answer. If you ask a question on 'scopes, I recommend you clearly state which 'scope have, because the answer might depend on whether it is an 'old skool' type with a cathode ray tube or a more modern digital one .. although they are both designed to do the same job, some of their characteristics are completely different.

As for your project, I think you might struggle with a 'boost' type power supply. Maybe consider splitting your project into two phases:

  1. Get it working with three battery cells and a 'simple' linear regulator. (With a simple 3-cell battery holder, this might not be much larger than your 1 D cell system.) I suspect getting the ESP8622 chip to do everything at minimal power will provide plenty of challenges!
  2. Try to replace the 3 cells and linear regulator with a single cell and a boost regulator.

So initially, consider replacing your 1 'D' cell with three 'AA's or three 'AAA's in series to give you 4.5V.

Look for a linear regulator that has:

  1. the correct output voltage .. presumably 3.3V
  2. an 'ample' current rating ... ie a bit more than the peak current you are expecting, assuming you do not add capacitors, etc. I would guess 500mA would be more than ample, but I haven't checked! (slightly higher ratings like 800mA or 1A would also be fine)
  3. 'LDO' - low dropout voltage, which means that the minimum input voltage at which it still maintains the correct output voltage is only a little (say 0.3V) above. e.g. it will maintain the output voltage at 3.3V, for any input voltage over a range of say 3.6V to more than 6V. (This means it will cope with 'new' batteries producing over 4.8V, until the batteries are almost flat producing only 3.6V.)
  4. very low 'quiescent current' .. often abbreviated to Iq .. ideally less than the 'deep sleep' current of the microcontroller.... maybe 10-25 microAmps? (Lower means longer battery life!!!)

A few seconds of Google came up with https://www.ti.com/lit/ds/symlink/tlv755p.pdf as an example. (Not a particular recommendation .. I only read the 'headlines', so I haven't checked it out thoroughly ... just an example to get some familiarity with the 'kind' of device I had in mind.)

Bill has a great review article on power supplies ( https://dronebotworkshop.com/powering-your-projects/), illustrating some of the 'ready soldered to a board' devices available, including a section titled 'Linear Regulator – PSM-165 12v to 3.3v Linear Step Down Regulator', which has small linear regulator. It would provide the right output voltage and be able to supply enough current, but it might have a bigger voltage drop and/or take a higher quiescent current than would be desirable for your project. .. i.e. it should power your ESP8266 but the battery life might be disappointing. (Note I am not saying the PSM-165 will not be suitable ... just that I haven't seen the necessary specs to determine either way... and I always assume the worst case if I don't know!!)

Hope this gives you some ideas .. best wishes. Dave


   
ReplyQuote
Myron
(@myron)
Member
Joined: 3 years ago
Posts: 7
Topic starter  

I agree with your suggestions.  I am using my scope, but have yet to get it to capture an occasional peak, i am working on that.

I have the program running on an lm1117 linear regulator (The one that comes on the NodeMCU board.) with 4 AA batteries.

IMG 20210814 214137

 Thanks a lot.  Myron


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1653
 

@myron Hi Myron,

  Thanks for the update.

  I am not clear what 'occasional peak' you are hoping to capture, and obviously don't know what you have tried, but you might consider if you can use the  'External trig' socket neatly framed in your photo. My observation is that many electronic engineers tend to overlook this socket, when in many (though of course not all) cases it can make life much easier.

The photo didn't show enough for me to be certain, but the controls suggested it is a 'traditional' CRT scope. Assuming my 'deduction' is correct, this means that a 'trigger event' (such as a rise or fall) must occur before the 'main event' that you are looking for, because the 'trigger event' initiates the sweep of the spot across the screen in the x-direction. Furthermore, unless it has a 'storage' facility, which I suspect it doesn't, the waveform needs to be repeated several times per second to remain visible long enough to be interpreted, as our eyes are not well adapted to one-off sweeps .. although with a lot of patience, you might be able to glimpse enough to answer a particular query.

In the past, one workaround to 'one-off' events was to use a camera, e.g. a Polaroid, with the shutter open for a long exposure time waiting for the sweep. Of course, this assumes the camera was carefully mounted on the 'scope to stop ambient light reaching the film. In principle, an electronic camera could be adapted to do the same, but I haven't seen anyone try. However, note this still requires a trigger pulse just before the 'main event' to initiate the spot moving across the screen.

------

For repetitive waveforms, such as a constant frequency sine or square wave, it is 'easy' to trigger the 'scope, because one cycle of the waveform can 'trigger' the sweep in the x-direction and the subsequent cycle(s) will be displayed. Furthermore, the sweep can be repeated as many times as required to view the image.

However, microcontroller waveforms are often 'one-off' events with variable timing before the next one appears. A truly 'on-off' event, can be really hard to capture with this type of 'scope, but if it 'happens' at least a few times per second, even if the timing between events varies a bit, then it may be possible to capture it.

Basically, ask yourself, is there any signal available that will show a rise or fall a fixed amount of time before the information you are looking for? If so, connect this signal to the external trigger socket and adjust the trigger level and rise/fall to match the signal.

If there isn't a convenient trigger signal, consider modifying your system to create one! e.g. if the sequence of events to be monitored is controlled by a microcontroller, consider adding a step into the sequence which pulses a spare I/O pin before the 'main event' happens.

---------

Apologies if this is all 'old hat' to you, but if not then hopefully it will be of interest.

Best wishes, Dave

 


   
ReplyQuote
Myron
(@myron)
Member
Joined: 3 years ago
Posts: 7
Topic starter  

@Dave Hi Dave.

I appreciate you comments. Although I know a lot of stuff, since I am self taught I lack some basic nomenclature or some things a student would learn on the first day.  i.e.  where to plug in the probe.

I presume that when my processor attempts to communicate with my WAN it needs a lot of current. Andras Speiss showed this in one of his videos. I suspect that it isn't getting enough current, then the voltage drops below minimum and fails. This is what I would like my scope to see.

This is a great idea to write an arduino program to trigger the scope. Then, after I get confident in its operation, I can make the ESP8266 try to peak every 30 seconds or so, and I should be able to see it.

I can't work on this project as much as I would like, it may be quite a while before I get this done. I will reply with my progress.

Myron


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1653
 

@myron Hi Myron,

The ESP's thirst for current when sending WiFi packets seems to be one of its Achilles' heels. I have a suspicision the modules commonly sold in the bazaars have been designed not just to a price, but below it. On the other hand, when you look at what you get for the price of a 'posh' coffee, it's hard to feel you have been shortchanged.

As for being self-taught etc., take that as an advantage ... much of what I was discussing is what I have picked up over the years ... you might think students would be taught in their first year or so at college, but in my experience, if they were, then they have clearly forgotten it by the time they graduated ... and I am pretty sure they actually were not taught most of it in the first place. So carry on learning at your own pace ...you are doing fine!

The kind of trick you would want is to set up the WiFI link, trigger output pin , etc in setup, then put a simple task in the Arduino loop that is something like:

loop {

    Write 1 to trigger output port

     Send a packet of Wifi data

     Write 0 to trigger output port

     Delay a couple of milliseconds

}

In reality, I am sure there will be a few complications to iron out, but in principle this should operate about 500 times a second giving your scope something to look out for. Start by sending the trigger signal to the Y channel, as well as the trigger port .. you should be able to get a kind of square wave, then move the y channel probe to look at the power lines.

Good luck and enjoy yourself!!


   
ReplyQuote