Charge pump NE555 vs LM386!

Started by Rob Strand, June 18, 2020, 03:11:34 AM

Previous topic - Next topic

Rob Strand

I stumbled on this article some time back while searching for something totally unrelated.  I meant to post it but forgot.
It compares a NE555 based charge-pump with an LM386 based charge pump.   Yeah, LM386, pretty funny eh?

https://www.electronicdesign.com/technologies/analog/article/21800620/comparing-the-ne555-timer-and-lm386-amplifier-as-inductorless-dcdc-converters

It's a fairly apples to apples comparison.   If you tried to optimized each I'm not sure where things would end-up in timing, frequency, and volts vs current.    Another possibility is using CMOS 555's over the NE555, which is not discussed in the article
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

amz-fx

I have built a charge pump using the LM386 and it does work as described in the article.  The oscillation frequency that the article claims does not match the formula in the 386 datasheet, but I did not measure it to see which was correct.

I also tried the 555 long ago from a circuit in a databook, and it works too, but you have to be careful with the 555 sending voltage spikes to the power rail.

regards, Jack

Rob Strand

#2
QuoteI have built a charge pump using the LM386 and it does work as described in the article.  The oscillation frequency that the article claims does not match the formula in the 386 datasheet, but I did not measure it to see which was correct.

I haven't tried to calculate this by hand but speculating,

One difference is the article is  25kHz where as the datasheet is 1kHz.   Another difference between the article and the datasheet is the datasheet (National Semiconductors 2000, not TI) connects pins 1 and 8 whereas the article leaves pins 1 and 8 open.   As to the overall effect I would have thought the 25kHz would be slowed down more than 1kHz but the datasheet and the article shows the opposite,

For the datasheet,    T = 0.33 * tau,  f = 3.0 / tau
For the article,           T = 0.22 * tau,  f = 4.5 / tau

where f = frequency, T = period,
            tau = R * C   the time constant of the timing network
           (Technically R = actual resistor value in parallel with 50k as the LM386 has internal 50k's to ground
            but I haven't allowed for this in the above.)

Highly likely the actual frequency depends on the supply voltage.
----------------
EDIT:   The formula appears in an earlier National Semiconductors datasheet:  f = 1/(0.36 tau) = 2.78 / tau; which is about 8% lower than the part values in their circuit example.  The formula seems to be removed in the 2000 datasheet.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

amz-fx

I dug out the charge pump that I made with the LM386 from a box of old projects. It has the exact values as shown in the article, and I verified them just to be sure.

The frequency of oscillation was 102.5 kHz. I was powering it with a 9v battery and driving an led load of 3 or 4 milliamps.

The pin 5 output of the LM386 was a decent looking square wave of 8.00v pk-pk.

I put a picture of the board in my Instagram: https://www.instagram.com/p/CBuCY_nH7qp/

Best regards, Jack

Rob Strand

QuoteThe frequency of oscillation was 102.5 kHz. I was powering it with a 9v battery and driving an led load of 3 or 4 milliamps.
Wow, much higher frequency than the article or the datasheet.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

niektb

I'm curious! How is the ripple performance?

amz-fx

Quote from: Rob Strand on June 21, 2020, 11:38:37 PM
Wow, much higher frequency than the article or the datasheet.

Actually the EDN article has two different values for C1 (18nF and 2n2). I am using 2n2 from the first schematic in the article.

A National applications book shows the formula as 1/(0.36*R*C), which is 1/(0.36*10k*2.2n) or 126262 Hz. My measured frequency was lower than that.

I powered up the circuit again to have another look. Maybe the amount of load is impacting Freq.  I got 102.5kHz with no load, and the same with 7 ma load from an LED.

My battery was used, and measured 9v under load so I decided to connect to a variable power supply. When it was set for 9v, I got 102.5kHz. As I turned up the voltage, the frequency increased. I only went to 12v where it was slightly over 113kHz.

I'm not sure where the author of the article got 25k for the 18n version of the 386. By the National formula, that circuit's oscillation is 1/(0.36*10k*18n) or 15432 Hz, not 25000 Hz.

regards, Jack

Rob Strand

#7
QuoteActually the EDN article has two different values for C1 (18nF and 2n2). I am using 2n2 from the first schematic in the article.
I think what has happen there is the 2n2 on the LM386 schematic is a typo and 18n is correct.   The 2n2 copied from the NE555 circuit.  Both supposed to be 25kHz so 18n makes a lot more sense.


QuoteA National applications book shows the formula as 1/(0.36*R*C), which is 1/(0.36*10k*2.2n) or 126262 Hz. My measured frequency was lower than that.

I powered up the circuit again to have another look. Maybe the amount of load is impacting Freq.  I got 102.5kHz with no load, and the same with 7 ma load from an LED.

My battery was used, and measured 9v under load so I decided to connect to a variable power supply. When it was set for 9v, I got 102.5kHz. As I turned up the voltage, the frequency increased. I only went to 12v where it was slightly over 113kHz.
Given all the variables the formula isn't too bad.

In fact I calculated the frequency from scratch, including the 50k input impedance, then I back engineered the "0.36" constant.   As it turns out by just using the external part values and ignoring the 50k input impedance I got the same "0.36" constant as the Nat Semi formula.   I suspect at high frequencies the actual frequency is lower due to the speed of the opamp.  Even the NE555 suffers the same formula disagreement problem when you get over about 100kHz.

See attached PDF for all the calculations.


I don't get the 25kHz vs 16kHz difference.  I wonder what frequency it actually was.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

rankot

Quote from: amz-fx on June 18, 2020, 08:06:38 AM
I also tried the 555 long ago from a circuit in a databook, and it works too, but you have to be careful with the 555 sending voltage spikes to the power rail.

How to tame those spikes, Jack? Any advice?
  • SUPPORTER
60 pedals and counting!

jonny.reckless

#9
Quote from: rankot on June 23, 2020, 04:47:29 AM
How to tame those spikes, Jack? Any advice?

I have used NE555s for voltage doublers and inverters without issues, even on millivolt signal circuits like mic preamps. I generally try to run the oscillator at 30kHz to keep it out of the audio band, but with good layout you can run it at 10kHz and not leak into the signal path. Good quality decoupling, correct routing topology and a low impedance ground return are essential. I generally use the top layer of the board for a solid ground pour around switching power supplies including switched capacitor doublers. If you can't do that, you need to use thick wires and star point grounding back to the rest of the circuit to get the current spikes well away from signal ground reference. There should be no shared copper in the ground where the diode / capacitor currents flow and the audio part of the circuit. Those current pulses cause the ground to bounce due to trace impedance if you don't have a copper plane. You don't want that bounce appearing superimposed on your signal anywhere. It's possible to do with veroboard but you really need to observe star point wiring best practice.

I have a 10uF ceramic multilayer cap right next to the power pin of the 555, and a 100uF or 470uF electrolytic just behind that. Try and keep the current loop with the local reservoir cap and the 555 isolated and small. On the output side I use 1N5817 Schottky diodes and 10uF multilayer ceramics. I also typically add a filter between the supply and the downstream circuit, maybe 22 ohms and 100uF. Works like a charm. I've never needed a choke. If you need more than a few mA you should use a switching converter with an inductor.

Rob Strand

All charge pumps have large current pulses at the input supply.   When you draw current from the output both of the output caps are discharge.   On the next charge cycle those discharged caps get slapped across the input supply to recharge them.   The size of the current depends one the impedance of the switches in the convertor and the ESR of the caps (the output stage impedance in the case of the 555.) The solution is as described by jonny.reckless.


The NE555 (not the 7555) has an addition current spike on the input supply which occurs each time the output changes state - not just for converters.   The NXP ICM7555 datasheet has a nice picture of the current waveform of the *NE555*, it peaks at 400mA.  The ICM7555's is a MOS device and does not have such large current spikes.   Philips NE555 application note AN170 recommends 10nF to 10uF across the supply located close to the chip.   If you follow jonny's converter recipe it will cover this case automatically.   
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

amz-fx

Quote from: Rob Strand on June 23, 2020, 04:11:40 AM
I think what has happen there is the 2n2 on the LM386 schematic is a typo and 18n is correct.   The 2n2 copied from the NE555 circuit.

I suspect you are correct and it is a typo. At the time, I just printed the first schematic and used it. If I have an 18nf capacitor, I may change C1 on my pcb and see what Freq it gives.

Here is the NatSemi data:



If you work out the NS formula for the values in the schematic, it does not equal 1khz! I would guess that the formula for F is closer to the actual oscillation frequency than the values in the schematic, which is just a reminder to us to be cautious with datasheet examples and verify them before using.

regards, Jack

Rob Strand

#12
Quote
If you work out the NS formula for the values in the schematic, it does not equal 1khz! I would guess that the formula for F is closer to the actual oscillation frequency than the values in the schematic, which is just a reminder to us to be cautious with datasheet examples and verify them before using.
Not exactly but it is pretty close, using the formula I get 926Hz, so less than 10% off 1kHz.   Funny thing is following detailed circuit calculations in my spreadsheet I get 927Hz.    So the 926Hz and the 0.36 formula looks fairly believable to me.  The 1kHz is only nominal but the weird thing is 27k would probably be closer to 1kHz!

(FWIW: The old datasheet didn't specify a load it only gave the formula and the 1kHz example.    The funny thing about that extract you gave is it has an 8 ohm load.  Notice that the high-pass cut-off is f3= 1/(2*pi*50uF * 8 ) = 400Hz.     At first you might expect that to affect the frequency but since both the resistive divider and the timing capacitor path both connect to the output I have a feeling that reduces the effect of the high-pass filter.)


This guy sim'ed the circuit and go 815Hz with a 33k, so the agreement  with the simple formula (842Hz) looks pretty good.
https://www.allaboutcircuits.com/projects/build-alarm-system-with-lm386-npn-transistor/
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

R.G.

In a pinch, you can use any source of a square wave signal with a few MOSFETs to make a charge pump. I've even used a spare pin on a microcontroller to do the deed. I've used a 555, before the 7660 and its enhanced follow ons were available. Worked, had spiking issues like all 555's, as noted. LM386? Sure.CMOS Schmitt trigger inverter? Yep, works for low output currents.

All of them will require careful layout and decoupling, as noted. Keep the current loop for charging/discharging the caps as small and local as possible. I used RC filtering on the incoming and outgoing power lines to knock down the spikes a bit more, trading off the small DC loss for better noise filtering.

The question that comes to my mind is why? Expedience is the first reason to do something that's not a 7660 or one of its successors; the second might be price, I guess. I haven't recently looked at the relative cost of a dedicated charge pump chip versus a sideways use of another chip or signal source. Maybe you could get a McGuyver solution to be cheaper. Eats more board space and is more complex to debug, probably.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

swamphorn

It could be a good use for '386s which don't otherwise behave. How much can go wrong with what is essentially a high-power comparator?

R.G.

Maybe.

The child in me likes using things in ways that no one else ever expected them to work. But using a chip that is proven not to act like its well-behaved brothers?? Could work fine. Could work that way a long time. But if it fails, do you need to find a similarly ill-behaved replacement? Will a well-behaved one work? On the other hand, I have no experience with LM386s that work kind of. I've only seen them work well, or be dead.

But then, building your own stuff has always been about improvising. As long as you know the facts, and make the deal with yourself for using whatever you use, and accept the consequences knowingly, then there's no harm, no foul.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PRR

> ill-behaved replacement?

When radios got more integrated, and the LM386 market shifted to modem squealers, there were an awful lot of under-biased LM386 with nasty crossover distortion. From comments here and there, I get the sense these are still on the market. If all you want is a max-swing square wave, crossover is moot.

But yeah, occasionally we hear of a bad-mask '386 which won't stop making radio-waves, and that could detract OR enhance a voltage converter.

Many of us will die with a tube of ninety-three '386 so it is good to have ways to use them up before our estate sale.
  • SUPPORTER

Rob Strand

QuoteThe child in me likes using things in ways that no one else ever expected them to work. But using a chip that is proven not to act like its well-behaved brothers?? Could work fine. Could work that way a long time. But if it fails, do you need to find a similarly ill-behaved replacement? Will a well-behaved one work? On the other hand, I have no experience with LM386s that work kind of. I've only seen them work well, or be dead.
OK for home projects but not a good idea for real products.   Same goes for using funky tricks with IC's.   If it's not in the datasheet it's use at your own risk, other brands or batches might be different.

I suppose using an opamp as an oscillator is a common thing but sticking nasty loads like capacitors on the output often welcomes the evil spirits.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

amz-fx

The one advantage I can see for using the 386 oscillator is that, because of its output drive capability, it seems to consistently give about 0.5 to  0.7v higher output on the doubled voltage when driving a load. The doubled voltage from most charge pump chips begins to sag rather quickly once you start placing a load on them. It's a small thing, but it might be useful in certain applications where you need to get closer to the full 18v. Also, as I demonstrated, it can operate at 102khz, which should be easy to filter out for a cleaner supply.

regards, Jack

Rob Strand

QuoteThe one advantage I can see for using the 386 oscillator is that, because of its output drive capability, it seems to consistently give about 0.5 to  0.7v higher output on the doubled voltage when driving a load
I got the impression that was the motivation for the article.

Using bigger caps pretty much always gives you better performance.  The type of caps can also come into play at higher oscillator frequencies.   Luckily the article didn't skimp on the caps so it shows the performance due to the devices.  Nonetheless if you have skimped on the caps on a NE555 design and you might be better off up'ing the caps instead of going to an LM386 to scrape a bit more performance.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.