Low Cost PCB's Low Cost Components

Author Topic: EEVblog #483 - Microcontroller Voltage Inverter Tutorial  (Read 13573 times)

0 Members and 1 Guest are viewing this topic.

Online EEVblog

  • Administrator
  • *****
  • Posts: 24320
  • Country: au
    • EEVblog
EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« on: June 15, 2013, 10:43:02 AM »
How a diode voltage inverter circuit works.
Turns any PWM or clock signal into a low power negative voltage rail.
This can be clocked from a microcontroller, existing DC-DC converter, 555 timer etc.

 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7805
  • Country: us
  • adieu
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #1 on: June 15, 2013, 10:57:15 AM »
Deja vu?  :) Oh, inverting!
No longer active here - try the IRC channel if you just can't be without me :)
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 24320
  • Country: au
    • EEVblog
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #2 on: June 15, 2013, 11:02:10 AM »
Deja vu?  :) Oh, inverting!

The same, but different  ;D
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #3 on: June 15, 2013, 11:43:29 AM »
I think it worth noting that these charge pumps put large current spikes into the supply and ground rails of what is driving them particularly on start up. You can add some series resistance to the drive to reduce the amplitude and loose a bit of performance.

Not likely to cause damage but it will generate noise.

 

Offline dentaku

  • Frequent Contributor
  • **
  • Posts: 821
  • Country: ca
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #4 on: June 15, 2013, 11:46:49 AM »
Nice.
When you where getting that ripple I was wondering if you can use something similar to this method to change a square wave signal into a saw wave? Preferably one that's not shifted up or down.
It would be useful for the basic junky breadboard synth experimentation I'm interested in.
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 24320
  • Country: au
    • EEVblog
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #5 on: June 15, 2013, 02:14:05 PM »
When you where getting that ripple I was wondering if you can use something similar to this method to change a square wave signal into a saw wave?

Many better ways of doing that I'm sure.
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 842
  • Country: 00
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #6 on: June 15, 2013, 07:22:43 PM »
Nice.
When you where getting that ripple I was wondering if you can use something similar to this method to change a square wave signal into a saw wave? Preferably one that's not shifted up or down.
It would be useful for the basic junky breadboard synth experimentation I'm interested in.
The problem is with producing a saw from a square is that the square wave amplitude signal is inherently missing information about the slope of the corresponding sawtooth wave. Most naive attempts to build a square->saw converter will make the amplitude vary with the frequency, because the angle of the slope is kept the same and the phase is just reset on one of the square's edges.

One way of solving it is with a PLL (phase locked loop) as shown here: http://electro-music.com/forum/topic-31920.html
The circuit consists of two chips. A 4046 PLL chip which generates a higher frequency square wave which tracks the input, and a 4024 binary counter, which is then fed into a cheapo r2r DAC consisting only of a resistor ladder. In a practical circuit you may want to  put an op amp buffer at the end as well.

I suspect you're building your own oscillator, and you have simply only built a square wave oscillator so far (maybe a 555 or a simple op amp oscillator.) If so, you might want to ditch the idea of getting a sawtooth from a squarewave and look up options for sawtooth VCOs. You'll have to add a couple more components, but it will be worth it. I can personally recommend the XR-VCO as a versatile and fun voltage controlled oscillator, though that's a bigger project yet.

http://www.birthofasynth.com/Thomas_Henry/Pages/XR-VCO.html

Good luck!
« Last Edit: June 15, 2013, 07:26:23 PM by nitro2k01 »
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1503
  • Country: pl
  • Troll Cave Electronics!
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #7 on: June 15, 2013, 10:30:47 PM »
I'm using this method to get opamp negative voltage, especially when I have 2 spare HC14 channels somewhere. It only adds 3 ceramic caps, one resistor and a BAT54S or equivalent diode.

I love the smell of FR4 in the morning!
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 1830
  • Country: 00
    • My random blog.
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #8 on: June 16, 2013, 06:10:12 AM »
The more you show this scope the worse it looks.
Pixel doubled horizontally with no aliasing, looks like something running on C-64.
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 3321
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #9 on: June 16, 2013, 07:35:41 AM »
I think it worth noting that these charge pumps put large current spikes into the supply and ground rails of what is driving them particularly on start up. You can add some series resistance to the drive to reduce the amplitude and loose a bit of performance.

Not likely to cause damage but it will generate noise.
Or for a "lossless" solution, use an inductor. (The ones I have built were too small to need that. I just use a resistor since the losses are negligible at the currents I use them at.) You'll definitely want to have series resistance or inductance if you're driving it with a DC/DC converter since the spikes can false trip the overcurrent protection.
« Last Edit: June 16, 2013, 07:38:21 AM by NiHaoMike »
Cryptocurrency has taught me to love math and at the same time be baffled by it.
 

Offline dentaku

  • Frequent Contributor
  • **
  • Posts: 821
  • Country: ca
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #10 on: June 16, 2013, 10:27:24 AM »

I suspect you're building your own oscillator, and you have simply only built a square wave oscillator so far (maybe a 555 or a simple op amp oscillator.) If so, you might want to ditch the idea of getting a sawtooth from a squarewave and look up options for sawtooth VCOs. You'll have to add a couple more components, but it will be worth it. I can personally recommend the XR-VCO as a versatile and fun voltage controlled oscillator, though that's a bigger project yet.

http://www.birthofasynth.com/Thomas_Henry/Pages/XR-VCO.html

Good luck!

That looks good. I'll have to read that tomorrow.
 

Offline einstein

  • Contributor
  • Posts: 18
  • Country: be
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #11 on: June 17, 2013, 02:50:55 AM »
How much current can you draw from such a circuit, can you calculate/estimate that with a formula if you have the capacitor value's? What if you use 4700µF caps? Same question for the voltage doublers?
Almost as smart as Albert Einstein!
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #12 on: June 17, 2013, 03:00:57 AM »
How much current can you draw from such a circuit, can you calculate/estimate that with a formula if you have the capacitor value's? What if you use 4700µF caps? Same question for the voltage doublers?

I bet Einstein could work it out.

Go read the voltage doubler vblog thread again.
 

Offline einstein

  • Contributor
  • Posts: 18
  • Country: be
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #13 on: June 17, 2013, 03:37:30 AM »
So with the 4700µF and a switching frequency of 100 hz, and a supply voltage of 5 volt and ideal diodes, i have 4700*10^-6*5*100= 2.35 Amps? Is that right ?
Almost as smart as Albert Einstein!
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 842
  • Country: 00
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #14 on: June 17, 2013, 04:37:17 AM »
einstein: You can't just choose random component values without knowing what the hell you're doing. With a 4700 µF cap, you'd nearly short out the rails on each cycle. The current spikes will cause you a lot of problems. But if you have a +5V power supply, and transistors, which can handle 10-20A peak current, (subject to be limited by wire resistance and capacitor ESR) and you don't mind the microcontroller rebooting a few times due to a brownout condition during startup, and maybe later too, then go for it.
(Or put if you can't see through the layer of sarcasm, no, you're doing it wrong.)
« Last Edit: June 17, 2013, 04:40:15 AM by nitro2k01 »
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #15 on: June 17, 2013, 04:38:34 AM »
So with the 4700µF and a switching frequency of 100 hz, and a supply voltage of 5 volt and ideal diodes, i have 4700*10^-6*5*100= 2.35 Amps? Is that right ?

With an ideal driver and into a short circuit load - yes.
 

Offline einstein

  • Contributor
  • Posts: 18
  • Country: be
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #16 on: June 17, 2013, 06:38:04 AM »
So it would give you 2.35amps, but it's very hard to realise it cause of the high capacitor charge currents...
Almost as smart as Albert Einstein!
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #17 on: June 17, 2013, 07:05:22 AM »
So it would give you 2.35amps, but it's very hard to realise it cause of the high capacitor charge currents...

Only into a short circuit. With ideal components it is equivalent to a -5v supply with 2.1 ohms in series.

So for example at 0.5A it would output about -4v.

 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 14269
  • Country: za
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #18 on: June 17, 2013, 03:30:26 PM »
Driving it using a 4700uF cap will work, but you will be using a pretty big switch, like an audio amplifier chip. I did once use 2200uF and a TDA2009 to make a voltage doubler and it did work, but needed a pretty big heatsink on it as well. Ran at around 5kHz, and whistled a little in the input capacitors and inductor filter.

Using a MCU pin you will be hard pressed to have more than about 2mA of output current before you have appreciable voltage droop. Not much but often good enough to use in low power circuits. If you need more it will be better to use an inductor or a transformer based supply and a regulator chip.
 

Telequipment

  • Guest
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #19 on: June 19, 2013, 04:58:48 AM »
Thank You Dave  ,I really enjoy these videos , and the down to earth way you explain them, unlike the evening class teacher ,who can send me to sleep in seconds, you have my full attention
 

Offline joaoc

  • Contributor
  • Posts: 7
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #20 on: June 19, 2013, 06:14:20 AM »
Hey Dave. I follow your VBlog for a long time but i've never registered myself.

Great videos and topics by the way!

This video made me thinking... You talked about using this in a opamp, and i've seen it being used like that, but i'm with a doubt here, this negative supply is only good for a few uA, while the positive could be capable of Amps.
How will the opamp deal with this very different (capable) supply currents? will it "suck" all from the positive supply?

Thanks

 

Offline einstein

  • Contributor
  • Posts: 18
  • Country: be
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #21 on: June 19, 2013, 10:01:23 PM »
I think that for a correct operation, the opamp current is limited to the current out of your inverter. Correct me if i'm wrong.
Almost as smart as Albert Einstein!
 

Online EEVblog

  • Administrator
  • *****
  • Posts: 24320
  • Country: au
    • EEVblog
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #22 on: June 19, 2013, 10:11:50 PM »
This video made me thinking... You talked about using this in a opamp, and i've seen it being used like that, but i'm with a doubt here, this negative supply is only good for a few uA, while the positive could be capable of Amps.
How will the opamp deal with this very different (capable) supply currents? will it "suck" all from the positive supply?

No, that's not how it works. A component like an opamp will only take the current it needs. The opamp does not know nor care what current the supply is capable of delivering, only that it can deliver what it needs.
That is a common beginner misconception about voltage and current.
Think of your mains power point. It is capable of delivering 10A maximum current, but if you plug in something that only needs 0.1A, then it only takes 0.1A from the mains socket. The main power socket or supply does not force 10A into the item that is plugged into it.
Same with your car battery, or any other voltage source like this inverter.
 

Online BravoV

  • Super Contributor
  • ***
  • Posts: 4209
  • Country: id
  • An EEE (Eternal Electronics Enthusiast)
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #23 on: June 19, 2013, 10:13:05 PM »
Hey Dave. I follow your VBlog for a long time but i've never registered myself.

Great videos and topics by the way!

This video made me thinking... You talked about using this in a opamp, and i've seen it being used like that, but i'm with a doubt here, this negative supply is only good for a few uA, while the positive could be capable of Amps.
How will the opamp deal with this very different (capable) supply currents? will it "suck" all from the positive supply?

Thanks
As Dave said, there are many methods to generate this negative and/or higher positive rails as previous episode.

Here is the example other method using cheap discrete components in generating positive & negative 15 volt from a single 5 volt source, capable of sourcing few teens of mA of current that should be enough for simple & common op-amp usage, thanks to Jay_Diddy_B for the design.  :-+



More details in this thread -> Design: Charge pump for LCD backlight
« Last Edit: June 19, 2013, 10:17:27 PM by BravoV »
 

Offline joaoc

  • Contributor
  • Posts: 7
Re: EEVblog #483 - Microcontroller Voltage Inverter Tutorial
« Reply #24 on: June 20, 2013, 01:51:35 AM »
This video made me thinking... You talked about using this in a opamp, and i've seen it being used like that, but i'm with a doubt here, this negative supply is only good for a few uA, while the positive could be capable of Amps.
How will the opamp deal with this very different (capable) supply currents? will it "suck" all from the positive supply?

No, that's not how it works. A component like an opamp will only take the current it needs. The opamp does not know nor care what current the supply is capable of delivering, only that it can deliver what it needs.
That is a common beginner misconception about voltage and current.
Think of your mains power point. It is capable of delivering 10A maximum current, but if you plug in something that only needs 0.1A, then it only takes 0.1A from the mains socket. The main power socket or supply does not force 10A into the item that is plugged into it.
Same with your car battery, or any other voltage source like this inverter.

Yes i know that. Maybe i didn't explain myself right...

Imagine that you have an opamp with split supply. The positive side is can delivery 500mA but the negative can only give 50uA, and in a given moment the opamp is requesting lets say 400mA. Will that come from the positive + negative rails, or just from one? if from both how is distributed?

I guess the question goes to: in a opamp circuit makes any difference the current capability of the negative supply (considering that the possitive has  enough juice)?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf