# Inverter That Produces a Sine Wave

Discussion in 'General Electronics Discussion' started by coolmike41, Mar 9, 2014.

1. ### coolmike41

4
0
Mar 9, 2014
Hi I am building an inverter that is supposed to produce a sine wave(60Hz). It doesn't have to be an absolutely perfect sine wave (can have some small distortion).

I am using an Arduino Uno to provide PWM to drive two signals that control MOSFETs in an H-Bridge.

I keep seeing that people use a modified sine wave. The Arduino doesn't output negative voltages so what I did was take a sine wave and split it into its two halves- the positive and negative part. I am using two pins to output a PWM.
--Pin #3 will output a PWM for the positive half of the sine wave and then stay OFF for the negative half.
--Pin #11 will turn ON for the negative half of the sine wave and produce a PWM and turn OFF while the sine wave is in the positive half.

So basically I have the two pins alternating ON/OFF depending on whether the sine wave is in the positive half or negative half.

Is this methodology right? I am still getting a sine wave after filtering. I just haven't seen this kind of implementation anywhere (or maybe im not searching properly).

Also what do you think the best type of filter would be for this H-brdige circuit? Im currently using a basic RC filter @ 60Hz

2. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,496
2,837
Jan 21, 2010
This will work, but you could also use PWM to produce something like a sine wave varying between 0 and 5V, then pass it through a capacitor to eliminate the DC bias.

The advantage of the H bridge is that you can concentrate on low pass filters only, and you will get twice the amplitude (and possibly twice the resolution)

3. ### coolmike41

4
0
Mar 9, 2014
Hmm I see. My voltage source is 12v but my voltage output is only like 1V after the H-Bridge. I think that I am messing something up in my schematic regarding the MOSFETs

5,165
1,087
Dec 18, 2013
This sound interesting. When you say using PWM what does changing the pulse width do in your circuit? Do you have a circuit we can look at?
Thanks

5. ### CDRIVEHauling 10' pipe on a Trek Shift3

4,960
652
May 8, 2012
Just to make sure you grasp what Steve posted I'm going to state it in other terms..

If you couple a sine wave that does not cross zero (go negative) into a cap the output side of the cap will swing positive & negative. Stated another way... When capacitively coupling Pulsating DC .. true AC (+-) will be produced on the output side of the cap.

Chris

6. ### davennModerator

13,836
1,950
Sep 5, 2009
Im trying to picture that Chris

I understand the Sine not crossing zero ... ie it has a DC offset
not sure how the cap is connected into this arrangement ?

can you diagram that for me please ?

Dave

7. ### CDRIVEHauling 10' pipe on a Trek Shift3

4,960
652
May 8, 2012
Sure Dave. Like this.

Chris

File size:
53.2 KB
Views:
193
8. ### davennModerator

13,836
1,950
Sep 5, 2009
well there ya go!!

thanks Chris
that's easier than I realised ... shows a few gaps in my theory knowledge huh LOL

mite have to play with some square waves out of the sig gene and see how clean a sine wave I can got on the scope

Dave

9. ### CDRIVEHauling 10' pipe on a Trek Shift3

4,960
652
May 8, 2012
Dave, you just had a "Senior Moment"!

Regarding square waves....My guess will be a droopy square wave but it will swing above and below zero.

Chris

5,165
1,087
Dec 18, 2013
Hi Chris.

Doesn't that depend on the time constant versus frequency? A larger resistor would lift the signal up towards 0V and a smaller resistor should bring it down. If you go even further down in resistor value then noticeable differentiation is going to happen isn't it? I am thinking about 10 times RC greater than pulse width to give you equal +/- with limited slew on the top of the pulse. What do you think?

Thanks

11. ### davennModerator

13,836
1,950
Sep 5, 2009
haha yeah, they are becoming more regular these days

KRAFTS disease .... wonder if you have heard of that one ?

Hint: its NOT a real diease

Dave

Last edited: Mar 13, 2014

5,165
1,087
Dec 18, 2013
LOL Dave, don't you mean CRAFT disease, Can't Remember a Freaking Thing. Look up KRAFTS disease on Urban dictionary. PSML.

13. ### CDRIVEHauling 10' pipe on a Trek Shift3

4,960
652
May 8, 2012
I'm not sure what you're implying about "towards 0" but sufficed to say that F, C & R all play a part in the faithful reproduction of the signal,.. along with + & - symmetry.

There are other factors too, especially if the signal is a square wave or rectangular .... (not a 50/50) duty cycle. The Source/Sink impedance of the source must be equal or many orders lower than the load, as to be insignificant to the RC time constant. A single transistor (common emitter) switch mode amplifier with collector resistor will have a much higher source impedance than its sink impedance when biased to saturation. Positive/ Negative symmetry will only be achieved when RL is much higher than the collector resistor.

All that said, I suspect I'm not telling you anything you don't already know.

Chris

5,165
1,087
Dec 18, 2013
Thanks Chris

15. ### coolmike41

4
0
Mar 9, 2014
Basically im using the PWM to trigger an H-Bridge on/off. I have a separate DC power supply that will feed into the H-Bridge and I basically am turning it into a sine wave.

I have a prototype but I need some MOSFET drivers as the microcontroller doesn't have enough amps to turn on my MOSFET so im getting major power loss.
For the filtering system i'm using a basic low pass RC filter tuned to 60Hz. I'm not sure if I should look into better options though
See attached image even though its kinda crude

#### Attached Files:

• ###### proj.jpg
File size:
31.5 KB
Views:
131
Last edited: Mar 14, 2014

5,165
1,087
Dec 18, 2013
Your power loss is probably due to the fact that the two bottom BJTs need a base resistor to limit the current. What you have done is the same as connecting a forward biased diode across the outputs of the PIC.

Also if you have two more PWM ports then it is more efficient to use PNP versions for the top two transistors.

17. ### coolmike41

4
0
Mar 9, 2014
I am using mosfets not bjts.My image just shows bjt's since i copied a basic schematic off google images

18. ### CDRIVEHauling 10' pipe on a Trek Shift3

4,960
652
May 8, 2012
That's not an acceptable alternative to posting a schematic. It's akin to saying "That's not a capacitor in the circuit. I didn't have any resistor models so I used a cap instead". MOSFETs and BJT's have little in common.

Chris

5,165
1,087
Dec 18, 2013
Yes I agree Chris, that's what confused me.

20. ### CDRIVEHauling 10' pipe on a Trek Shift3

4,960
652
May 8, 2012
Well I may be all wet here or I'm missing something,.. but since a Sine Wave inverter is required or desired why not use the DAC output?

Chris