Arduino Pure Sine Wave Inverter with Full Program Code

This article explains a simple pure sine wave inverter circuit using Arduino, which could be upgraded to achieve any desired power output as per the user's preference

Simulation and Working


In the last article we learned how to generate sine wave pulse width modulation or SPWM though Arduino, we are going to use the same Arduino board to make the proposed simple pure sine wave inverter circuit.The design is actually extremely straightforward, as shown in the following figure.

You just have to program the arduino board with the SPWM code as explained in the previous article, and hook it up with some of the external devices.





Pin#8 and pin#9 generate the SPWMs alternately and switch the relevant mosfets with the same SPWM pattern.

The mosfst in turn induce the transformer with high current SPWM waveform using the battery power, causing the secondary of the trafo to generate an identical waveform but at the mains AC level.

The proposed Arduino inverter circuit could be upgraded to any preferred higher wattage level, simply by upgrading the mosfets and the trafo rating accordingly, alternatively you can also convert this into a full bridge or an H-bridge sine wave inverter

Powering the Arduino Board


In the diagram the Arduino board could be seen supplied from a 7812 IC circuit, this could be built by wiring a standard 7812 IC in the following manner. The IC will ensure that the input to the Arduino never exceeds the 12V mark, although this might not be absolutely critical, unless the battery is rated over 18V.



If you have any questions regarding the above SPWM inverter circuit using a programmed Arduino, please feel free to ask them through your valuable comments.

Waveform Images for Arduino SPWM


Image of SPWM waveform as obtained from the above Arduino inverter design (Tested and Submitted By Mr. Ainsworth Lynch)




For the Program Code please visit the following link:

Arduino SPWM Generator Circuit


UPDATE:

Using BJT Buffer Stage


Since an Arduino board will produce a 5V output, it may be not be an ideal value for driving mosfets directly, therefore an intermediate BJT stage may be required for raising the gate level to 12V so that the mosfets are able to operate correctly without causing unnecessary heating up of the devices,. The updated diagram (recommended) can be witnessed below:

Recommended Circuit



Video Clip



Finalized diagram for the above explained Arduino sinewave inverter circuit can be seen below, the CMOS IC is used as an aided buffer for the BJT stage



Note:

In order to avoid an accidental switch ON prior to Arduino booting, a simple delay ON timer circuit may be included in the above design, as shown below:


Need Help? Please send your queries through Comments for quick replies! And please Bookmark my site :)




Comments

OLUWOLE AMOS said…
Sir, what of feedback, isn't that and essential part in inverter operation?
Swagatam said…
Oluwole, feedback is not an essential part for an inverter, it's just an added feature.

If you have your transformer correctly matched with the battery then feedback won't be necessary
Sham said…
Hi Swagatam,
I have tried PWM charge controller using arduino and it is successful. Iam using it in my home generating 80 watts of power from 200 watts panel. I know its very poor.
BTW, I admire your works and I keep looking at your blogs very often.
I came across this very interesting circuit and I want to try this inverter.
Just to be sure, I have few 4905 PNP mosfets lying around from previous project, Can i use the same in your circuit? Source of mosfet connecting to Battery -ve and Drain of mosfet to transformer?
2. Transformer rating: secondary 12v-0-12v/15A, primary 220V. What will be my output power? is it 12x15=180 Watts? So if i increase the transformer rating to 30A can i get 360 watts of power? ofcourse with some 10-15% losses...
Unknown said…
Hi Swagatam,
I want to make an inverter to drive some gauges that require approximately 2 amps at 115v AC @400Hz, using a 28v DC imput. The Arduino seems like the right tool. Would you be kind enough to make up a circuit diagram?
Regards,

Mark
Swagatam said…
Hi Sham, if you are using an Arduino based controller and getting 80 watts from 200watts, then it's not worth using...or may be you haven't built it correctly, a linear IC circuit would give much better results than this.

as for the above Arduino sinewave inverter, yes it's indeed an interesting and handy little inverter which will give you pure sinewave just by hooking up a couple of fets and a trafo.

Pchannel mosftes might not work correctly here since the design is meant for N channel mosfets, so you will have to replace your p channels with N channels and then test the results.
Swagatam said…
your watt calculation is quite correct, but for a 12V battery you may have to employ a 9-0-9V trafo
Swagatam said…
Hi Mark,

you can try the same design which is published in the above article....just assemble it, and start using it for your specific need.

the transformer will need to be a 24-0-24V 10amps/120V for your mentioned application
Sham said…
Hi Swagatam, Appreciate your quick response. I am using Arduino for doing multiple tasks, like auto change over to AC/Battery, solar energy monitoring etc... as u said it looks like something is wrong.. My 100w x2 panels are generating appx 7-9 amps peak. But inside ckt it's getting down to 6.8 amps max. ��. I need your help in solving this. After reading ur article, am thinking of some issue in calculating the duty cycle fed to P channel MOSFET. Let me check that and update you.
I will purchase 9-0-9v trafo, N channel MOSFET and try the ckt. Here I need to control the amount of power used and alert me when solar power generated is less than power consumed. I hope I will succeed in this.
Swagatam said…
Hi Sham, what kind of circuit are you using for the controller, is it a buck converter? also specify the V and I of the panel.

duty cycle for the above circuit is 50% for the positive negative halves, and the individual phases are SPWMs with varying duty cycle.
Swagatam said…
Sham, I checked the link you sent, but I could not go through the diagrams since it everything quite elaborate....

one thing i can say, if PWM is used without a buck or boost converter then it's meaningless...it will simply block the excess power from the panel and indirectly waste power. In that case its' better to use a LM338 based circuit, or simply use a panel having a nearby specs to that of battery.

When you are using Arduino based design the outcome should be highly advanced and efficient, otherwise it's pointless.

if you need an MPPT circuit you can check out the first two articles from this website
Swagatam said…
Thanks Hassan...
Sham said…
Wow Swagatam.. xlent link. Thank you. I will to go through them one by one.
Yes.. now I am realizing the necessity of Buck converter. In one of your article you had mentioned about both Buck and boost.. I had not understood at that time.. I will go thru again.
Btw, to my understanding, I should use Buck converter with 10 amps rating for my work right? Bcos panel amp rating is 10 amps.
Swagatam said…
You are welcome Sham,

if you wish to use a buck converter with a 10amp pnel, then it should be rated higher than 10amps, because when the panel voltage is reduced by the buck converter it is supposed to convert the unused voltage into current...therefore current would go above 10 amps.

you can find it dividing the solar panel wattage by the battery voltage.



alextech said…
you are wonderful Mr. Swagatam Majumdar, please how many can i make 500Watt inverter of arduino
Swagatam said…
thanks alex, you can achieve that by using 600 watt mosfets and a 600watt trafo....and a 24V 150AH battery
Ainsworth Lynch said…
Using a 12v battery I can use a 12v transformer for this circuit?
Ainsworth Lynch said…
I tried a 12v transformer, I was getting 57v, I used irfz44n and they burnt up 2 times, while running they weren't hot, I think they burnt up because of of constantly adjust alegator clips on battery terminals to get a better connection.

But since the voltage was that low and the frequency is so high I was wondering if you tested this circuit.
Ainsworth Lynch said…
Also how could I stop diodes from getting damaged?
Swagatam said…
mosfets can burn due to many reasons, and definitely not due to frequency issues because mosfets are designed to handle very high frequencies.

it's a Pwm circuit and the transformer cannot be 12V for a 12V supply, it has to be 6-0-6V or some other value as pert the calculations, I think this issue has been discussed countless number of times in this website...

the above design is a an obvious circuit and will work without fail.

I have tested it with LEDs with a slow delay effect and it behaved perfectly as per my brain simulation.

once this was confirmed, I simply reduced the delays so that the sequence corresponded a 50 Hz frequency across the two channels with 7 varying SPWM pillars for each cycle,

anybody can easily interpret this.

you can verify the pattern on an oscilloscope if you have doubts.
Swagatam said…
which diodes are you referring to??
Ainsworth Lynch said…
I asked that question time after time but never actually got a reply. So let me get it straight just this once.

If my battery source on an inverter is 12v that means the transformer should be 6-0-6v and if it's a 24v battery source then the transformer will have to be 12-0-12v ect.

And that's the case for all your inverters? If any exception could you send me the link to the exception and im not refering to something like your cascade design.
Ainsworth Lynch said…
Sorry I should have said Fet instead of Diodes.

But since my transformation is a 12v transformer then that explains why I was getting 57v.

Swagatam said…
Please show me where you have asked this question, and did not get the reply?

when you use PWM it cuts off a portion of the actual waveform and this results in a reduced average voltage or the RMS value of the waveform, to compensate this the transformer needs to be lower with its primary V specs, so that the reduced PWM waveform matches the reduced value of the trafo.

for example if the PWM waveform average value is 7V for a 12V peak, then the trafo should be 6V/220V which will yield approximately 230V.

instead if we applied 7V PWM waveform to a 12V trafo that would proportionately reduce the output to:

7/12 = x/220

12x = 7 x 220

x = 128V at the output
Swagatam said…
it applicable only for PWM chopped sinewave inverters, NOT for all inverters....
Ainsworth Lynch said…
In this case it's a spwm so it's applicable here. So my battery is 12v so I need to use a 6-0-6v transformer then
Swagatam said…
yes that's correct
Vineeth Hari said…
Hi sir i am planing to make an inverter of 48v to 240v pure sine wave. I try to search here and i didnt find a pure sine wave 48 v circuit.. My inv transformer is 48v - 0v 12amps & secondary is 240v.. Sir please help me.. My mail id is vineethhari@ymail.com
Swagatam said…
Hi Vineeth,

you can convert any of my 12V sine wave inverter cirucits into 48V, simply by applying 48V to the center tap of the transformer, and then step down the 48V to 12V for the DC circuit stages, because the involved DC circuits cannot work with 48V.....you can drop the 48V into 12V by using the principle as shown the following design. see the BC546 section

https://homemade-circuits.com/2014/11/48-v-inverter-circuit.html
Swagatam said…
I checked the video which you sent, I am afraid the results are not correct.

the code of the Arduino cannot be wrong because it contains simple delays in the form of ON/OFF periods...and these ON/OFF periods must produce PWM kind of waveform in the oscilloscope, your scope waveform looks weird.

secondly, if you add all the delay periods in the code, it comes to 10000 microseconds that's equal to 10ms...so 10ms on each cycle gives 20ms on the two channels...dividing 1 second with 20ms, gives 50 Hz, and that should eb the frequency...how can it be 600Hz??
Ainsworth Lynch said…
What do you think would be causing me to get high frequency?
Ainsworth Lynch said…
This is the waveform coming from public 8 and 9.

https://goo.gl/photos/8HG4xR4dtD5dZTxe7
Swagatam said…
it's the 6 pillars on each cycle which might be confusing the scope...you can add a capacitor at the trafo output and see the difference...
Swagatam said…
that looks perfect, and quite similar should appear at the trafo output, which should get transformed into a perfect sinusoidal waveform with the addition of a capacitor (0.33uF/400V) and possibly an inductor, as shown in this example circuit

4.bp.blogspot.com/-khKat0UA8Jw/UITpCnNd7yI/AAAAAAAAA_A/8x-KAD2aHLE/s1600/simplest60+Hz+Inverter+circuit+diagram.jpg
Unknown said…
Thanks, swagatam,
Can we use F3415s Mosfet in this ckt.
Swagatam said…
thanks, the mosfet rating will depend on your power requirement, and it must be N channel type...
Sohail Khan said…
Can we used dc booster to step up voltage to avoid transformer
Swagatam said…
a booster will also involve a transformer...
Sohail Khan said…
But it will be less weight. what is your opinion if we used dc booster in Pure sine wave inverter. we will be thank full if you have any Diagram.
Secondly in pure sine wave 3K Inverter which one will be very effective to give us pure sine wave Arduino or IC 4047 with 555.
Unknown said…
Hello sir niceone... Can one use an l293d motor driver IC instead of the MOSFETs, with a 12-0-12 transformer and a 12v battery?
Obenobe Jones said…
Hello sir , can one achieve a pure sine wave if it he uses pins 8 and 9 of the arduino but this time with an l293d IC instead of MOSFET, 12-0-12 transformer, 12v battery?
Swagatam said…
Hello obenobe, yes you can use the L293 with the above Arduino for controlling a motor, but I am not sure about a trafo operation....I think that may be possible too.
Swagatam said…
thanks...yes that's possible, you can use it..
Saqib Lodhi said…
Hi Swagatam,

I need to build 48vDC to 220vAC 5000KVA Pure Sine wave Inverter. Can you please share schematic and number of power transistors or mosfets and transformer specifications. I also need to know battaries specifications. thanks
Saqib Lodhi said…
adding to my previous question. do you have any kind of pure sine wave inverter schematic that can power on a 1 to 1.5 ton Air Conditioner. Actually I bought a land for fish farming and wanting to power up things in my sitting area there with inverter because of lack of electricity there.
Swagatam said…
Saqib, you can try the following design

https://homemade-circuits.com/2016/04/solar-inverter-circuit-for-15-ton-ac.html
Swagatam said…
Hi Saqib,

you can first try building the following design successfully, then I'll tell you how to proceed and make the sine wave integration

https://homemade-circuits.com/2014/11/48-v-inverter-circuit.html
Saqib Lodhi said…
Great. one more thing Can this be used with batteries? because I wanted to run this in night as well. Also solar panel isn't possible for me due to low space around sitting area and placing panels to any other area isn't affordable for me. what is the idea behind is that I will use two sets of battery banks one online and one offline on charging stat. inverter should be smart enough to detect low battery and switch input to secondary battery bank and start charging the first one while should run at least 1 ton Air Conditioner thats why I was thinking of 5kva inverter. if there any possibility then please write an article on this as soon as you can. I can buy this from market but you better know what we ask, we don't get. better to make it ourselves as per our requirements and have fun of electronics.
Swagatam said…
Solar panel is actually not compulsory, you can use any suitable DC source with the suggested circuits, just make sure the voltage and the current specifications are correctly matched with the inverter and the load.

most of the ideas are already published in this website, you just have to search it using the search box.

I have a 5KVA inverter circuit included in this website, I also have an automatic twin battery charger circuit which you can use for automatically detecting, and selecting the charged battery when one of them gets discharged.

However all these circuits are strictly for the experts who know all the basics of electronics and have the required practical experience in the field, it's not for the newcomers, so please make sure you have an expert with you while you try the proposed designs.
Saqib Lodhi said…
Sounds Good. Can you please post the link here as I am unable to use search box in my android. may be some css issue.
Swagatam said…
The search box is right at the top of the article.


anyway here are the links:

https://homemade-circuits.com/2014/07/5kva-ferrite-core-inverter-circuit.html

https://homemade-circuits.com/2014/05/twin-or-split-battery-charger-circuit.html
Saqib Lodhi said…
Great Swagatam. You're my hero. Will contact you again if needed. thank you so much for your quick response and help. May God bless you.
Swagatam said…
you are most welcome Saqib!!
Gurmel singh said…
Q1.is there any way to start single phase 3hp induction motor on home 5kva inverter ? because starting current is very high may be more than 30 amp but running at full load max current is 15 amp . Q2. is running above mentioned motor, possible on pwm based pure sine wave inverters?
Swagatam said…
It may be possible and tackled comfortably by adding an external battery bank with the existing battery. once the motor is initiated, the external battery bank can be removed, or disconnected with a help of a switch.
Gurmel singh said…
i have question. inverter is only 5kva ratings.
than how adding a battery to it increases​ its output power ?
Swagatam said…
it should be able to produce the extra power for a few seconds.

but if you are concerned about it, then the best option would be to change the inverter with a 1 kva rating
Gurmel singh said…
sir thanqew for ur valuable reply.
can you please suggest components for above systematic to bulid 6kva inverter and approx prize estimation for it?
Swagatam said…
You are welcome,

for making a 6kva inverter you can use the same Arduino board and its code.

for increasing mosfet power you can add more of them them in parallel, each mosfet should have it's own gate resistor and diode.

the transformer will also need to be rated as per the mentioned specification.

the battery voltage should be selected as high as possible, may be at 84V would be great and this will allow the transformer to be relatively smaller and the associated wiring to be manageable.
Swagatam said…
I can't say about the prize, you will need to find it out from the market.
Ravi Kumar said…
fro where i can find the arduino code
Ravi Kumar said…
where is the arduino code swagatam
Swagatam said…
Hi Ravi, please click on the link which is highlighted in the second paragraph of the article
Gurmel singh said…
for rating of mosfet ...
if i have two mosfet each one rating 50watt and one for possitive cycle and another for negetive cycle .does it means i have inverter of 100watt or only 50watt??
Swagatam said…
Gurmel, both the mosfets will need to be of the same polarity as shown in the diagram that N-channel.

the mosfets do not decide the power output, it's the battery AH rating and the trafo wattage rating which determines the output delivery, the mosfets simply needs to be rated adequately so that it is able to handle the power pushed by these elements.
the power power will depend on the trafo Voltage x current value and only if the battery has the capacity to deliver the amount of current which trafo is rated at
Amjad Ali said…
Then how would you regulate voltage at different load??
Swagatam said…
Do you have a voltage regulator with your home AC mains input?? how does it regulate different loads
Swagatam said…
you are saying your trafo is good, your fets are good, there's no chance of any short circuit, and yet your fuses are blowing, how can that be possible?

from here I can say your FETs are bad for sure or may be there's something that's causing a a short circuit which you must diagnose and rectify. without a short circuit or overload a fuse can never even a new hobbyist will know that!

if I would be in your place I would have first tried BJTs instead of mosfet for testing purpose, because BJTs are more manageable thn mosfets
mosfets gate resistor should always be low, in fact higher resistance might cause heating up of a mosfet and damage.

alternatively you can remove the Arduino and check with a 4047 IC, to see the difference, there are actually many methods through which you can check the fault.

another method is to connect car bulbs in series with the mosfet drains, and remove the gate supply, if the bulbs keep glowing even without gate supply would quickly indicate a faulty fet.
Swagatam said…
...you can also try a small good readymade trafo (1 amp) and test the response, that will give you clear idea regarding the proceedings.
Swagatam said…
Fuses cannot be a crucial thing in any circuit while testing, unless the circuit involves dangerous parameters and unpredictable results, here the inverter is supposed to work without any fuse...if you are forced to use a fuse that means your inverter has a serious fault which cannot be solved by replacing fuses rather it should be done by checking and rectifying the fault

As I mentioned before you should check the response of the FEts without connecting the gate supply, and by keeping the gates grounded..if still the FETs conduct would indicate faulty fets.

puling high current without load is a fault and as good as a short circuit.

By the way there's no point in working with faulty, doubtful, devices...if you have slightest doubt regrading the parts either you must replace them or quit the project until correct parts are bought.
Ainsworth Lynch said…
If u have some parts I would want you to test the circuit with a transformer, I think it may require a optocopler.
Swagatam said…
that clearly indicates your FETs are not good, because connecting the gate with source should keep the fets completely shut off, if still it is conducting then surely the fets have some fault

You can try using BJTs like TIP122 or TIP142 instead of the mosfet and check the response.
Swagatam said…
you have already tested the waveform which simply needs to applied to the gates of the mosfets, there's nothing complex in the design at all, since you have already started with the project it would be easier from your side to finish it,

you should change the doubtful fets and replace them with BJTs, and confirm the results.

I think it is just a matter a minutes to identify the exact location of the fault, by doing some basic tests as already suggested by me in the previous comments.
FastVoteFred said…
Ainsworth, yes a resistor should be across gate to source to drain electrons from the metal oxide semiconductor gate to the source. 100K to 1 Meg ohm. An unconnected insulated gate voltage can float to a positive voltage and turn on the N channel mosfet make a short connection from drain to source. Ie proper operation of n channel mosfet. 2nd verify electrical ground connection from arduino circuits to your smps power circuit mosfets. If not connected. Then circuits Can float with low output 0.7V from arduino can be 4.3V measure on mosfet gate to source. Effectively turning on n channel mosfet. Battery ground, arduino ground, n channel mosfet ground all tied together. Good luck on debugging circuits. Thanks for arduino sine wave code and circut. Bless you and thanks for Sharing. Fred WB7ODY
Swagatam said…
thanks fred! appreciate it!
ahsan ali said…
i require a driver circuit for
mosfet which enhance the 5V output of arduino to 12V to feed mosfet,
* suggest me a driver circuit.
* i am making circiuit for 240V , 350 watts output,
* which mosfet i should use ? irf3205???
*can i use more mosfets parallel to overcome heat issue of mosfets,
* what transformer should i use,,,,,, i am using 7ah 12V battery,
required output 230V, 350watt, guide me rating of transformer?
Muhib ur Rehman said…
Sir can i use above circuit as a fish stunner/shocker ..i have 12volt and 85Ah battery ...
Swagatam said…
you can use a 4093 IC and use its gates like NOT gates by shorting its inputs and then it would effectively raise the 5V input to 12V.

IRF3205 will do

you can try as many mosfets as you want, in parallel

12V 7ah battery will be too small, and not produce more than 60 watts, you will require a 100AH, 12V for getting anything near 300 watts
Swagatam said…
Muhib, you can try an ordinary high voltage generator circuit, the above sophisticated Arduino based design is not required
Prince said…
please i need a complete arduino inverter ciruit with working feedback pure sine wave with protections.
Swag said…
first build the inverter stage successfully, then you can proceed by adding the remaining stages one by one.
manish said…
sir,
I want to design 12VDC to 230VDC ,100W(MAX) ,pure sine wave inverter for solar system.
I don't want to use any Micro controller .
can you post any relevant circuit for my requirement .
Swag said…
Manish, you can perhaps try the second design from this article:

https://homemade-circuits.com/2013/10/pure-sine-wave-inverter-circuit-using.html
Manishu said…
Sir ,
Thanks for your reply.
Can I used step down transformer with secondary side connected to circuit and primary to output or only step up transformers are used ?
Swag said…
It has to be sorted out by you...the concept is crystal clear in front of you, and there's nothing mysterious about it....the Arduino output would be generating 5V peaks for the PWMs....5V is enough to trigger any BJT...but may be not enough for the mosfets, still it should work.

you can confirm the output with LEDs by increasing the delay time to may be 1/2 second.....the code even has a small dead time to ensure that the mosfets never turn ON together.
Swag said…
but again if the fets are ON without the gates connected then it has nothing to do with the Arduino, the problem could be somewhere else.
Swag said…
Manishu, yes you can use any standard step down trafo in the opposite mode.....
Miebaka said…
This indeed is another nice project since am familiar with Arduino I think doing this will really go in my favour, thanks a lot Swagatam Innovation. But before I try this project, I have two question.
1. Will this inverter be able to power a fan without issues?
2. Is there any kind of analog MOSFET that can create pulse instead of just turning on and off?
Cos this can help create a better PWM without harmonics.
Thank again for you contribution to science.
Swag said…
Thanks Miebaka,
According to me if a proper filter is added which can be simply a high value capacitor at the output of the inverter, then inductive loads can be expected to work without noise.

You can achieve a harmonic less pure sine output by using an emitter follower BJT/IGBT, or a source follower mosfet topology, just as we find in power amplifiers.

To be precise you can use a power amplifier and modify it into an inverter efficiently.

However avoiding PWM and harmonics would mean inviting heat and lots of heat on the mosfets:)

you can refer to this article to know more:

https://homemade-circuits.com/2012/02/making-sine-wave-inverter-from-audio.html
Manish singh said…
Sir could u please tell the rating of Transformer and amperage that u mentioned in latest diagram ..
Swag said…
Manish, With a 12V battery, the transformer voltage rating can be anywhere from 6-0-6V to 9-0-9V, the PWM from the Arduino will need to be adjusted accordingly depending on this voltage rating of the transformer.

the transformer current specification will depend on the output wattage requirement, same for the batt AH rating.
Manish singh said…
Thanks a lot sir for your valuable rply.
Sir need to ask u one more question that is , to adjust the spwm signal from Arduino can I use low pass filter just after pin 8 and pin 9 of Arduino from where we r getting output spwm signals .
And I have chose 4.7 uf capacitor value with 1k potentiometer to adjust the frequency , is this right value
Swag said…
Manish, what is the purpose of this low pass filter? and what frequency are you trying to adjust, the Arduino frequency can be adjusted by altering the delays within the code, nothing can be done through external means.
Naseef Vs said…
Sir
I nees 150v dc to 110v ac output invertor . No need to step down . So can i use the above ckt as iam mention after any change inthe ckt . If its not possible Pls reccoment any other idea
Thanks
Swag said…
Naseef, you will need a full bridge concept for achieving your requirement as shown below:

https://homemade-circuits.com/?s=full+bridge

or a half bridge network can be also tried, but the output will be 50% less than the input

https://homemade-circuits.com/2015/03/220v-dc-inverter-ups-circuit.html
Miebaka said…
Hi swagatam, please can i use an attiny45 or any other arduino and if yes must it be a pwm pin or any other pin?
Thank for your time.
Swag said…
Hi Miebaka, you can use any Arduino as long as it accepts and generates the indicated PWM and waveform...PWM pins are not required because here basically we are using the Arduino as an oscillator.
Mina said…
What the watt can I load on this circuit?
And how can I calculate the watt of my laptop charger it's input 100-240v 1.6a and output 19.5v 3.33a
Swag said…
inverter power will depend on the battery ah and the trafo ampere rating....multiply 19 with 3 to get the charger's max wattage spec
Naseef Vs said…
Sir
Ineed a ckt for half bridge ivertor to convert 300v dc to 150v ac. So ineed to handlel high voltage on input side. I cant find any stepdown invertor ckt for handle 300v dc in input side in online. So pls suggest a ckt
Swag said…
Naseef,

you can try the following IC

https://homemade-circuits.com/half-bridge-mosfet-driver-ic-irs21531d/
RKILY said…
Sir how can i make inverter using bipolar technique
RKILY said…
Please give me the circuit diagram of 100watt inverter and complete details of components used in circuit .
Secondly guide me how can i tie that inverter with grid
Swag said…
You can build the design which is explained above, this will easily give you a 100 watt output provided your trafo and the battery are rated at minimum 100 watt and 10 Ah respectively
Swag said…
by bipolar do you mean using bipolar transistors?
RKILY said…
I mean by using Bipolar PWM technique
RKILY said…
Give me circuit of grid tie inverter using aurdino with complete details and code plz for 100 watt
RKILY said…
Inverter with pwm bipolar technique
Swag said…
why do you intend to have a bipolar pwm instead of a unipolar inverter?
Swag said…
presently I do not have an Arduino GTI circuit, if i find one will try to update it...
RKILY said…
Where's uni polar circuit diagram sir
Swag said…
I wanted to know why you preferred bipolar pwm instead of unipolar pwm, please clarify so that I can know the objective of your requirement.
RKILY said…
Why we give 12v dc to transformer??
RKILY said…
Actually i did simulation with bipolar pwm technique which is east that's why i ask about it
RKILY said…
Why we give 12v dc to transformer??
RKILY said…
Kindly tell me exact value of transformer and battery to get 100watt.
I'm doing synchronization of inverter with grid please guide me how can i do it...
Give me complete details please sir
Swag said…
so that the 12V can pass and oscilate through the trafo winding and switch ON the induction process
Swag said…
If you can tell me your exact requirement, I will guide you to the perfect design from this website
Swag said…
synchronizing a GTI is not so easy, without knowing all the details it won't make sense to try such a difficult project.

you can refer to the following post for gaining some relevant knowledge and then probably try the concept:

https://homemade-circuits.com/homemade-100va-to-1000va-grid-tie/
RKILY said…
How can i synchronize two dc voltages? Plz give me details!!
Akshay said…
I have designed the circuit stated as above.But when i connect 5 watt CFL load voltage drops down to 170 volts and CFL doesnot glows.And when i connect 9 watt LED, it starts blinking.No load voltage was 250 volts.how to keep voltage constant.please help.
Swag said…
what is the rating of the transformer and battery that you have used??
Nuno Figueiredo said…
I highly recomend use opto couplers to isolate arduino from high power.
Regards.
Swag said…
thanks, yes since Arduino is a fairly expensive unit it must be safeguarded by all means
hazrat shah said…
the given circuit is not correct i have made it in proteus but it does not give the proper result.
Swag said…
forget proteus, build it practically and you will find it works flawlessly...all sinewave inverters circuits work with the same principle...

Or if you know a valid reason why it won't work, you may point it out.... otherwise your statement does not make sense...
hazrat shah said…
the university professor ask for simulation. then suggest me on what software it should be implemented?
thanks for reply
elektroman said…
Hi Swag! Did you tested this circuit with inductive loads? I want to use it on a grundfos water pump.

Thank you for sharing this project!
Swag said…
Hi elektroman, I did not test it but it was verified by others readers, moreover the concept is a standard concept which is implemented in all conventional inverters
swixxknight said…
good day sir
can the Bjt be used to drive multipe mosfets in parrallel, or is it better to drive more BJTs first before the mosfets
Swag said…
Hi swixx, yes that's possible, you can add more mosfets in parallel with a single BJT, more BJTs won't be required...
swixxknight said…
ok thanks for the speedy reply
is there possibility of one of the mosfet drawing more current due to disparity in same manufacture-model, leading to thermal runaway and gradually affecting other mosfets, if this is possible how can it be prevented.

i want to use build a 1kva inverter but with pulse width from an arduino, purposely for powering a fridge which run power is 70watts but starting watt unknown.

my fear is if there will be current loss if not running at full amperage
Swag said…
mosfets are actually less vulnerable to thermal runaway than BJTs due to their positive temperature coefficient property, still to be on the safer side you can use common heatsinks for the mosfets on each channel, this will ensure equal heat distribution among the mosfets and therefore more efficient conduction.

https://homemade-circuits.com/transistor-facts/
swixxknight said…
Good day, I trust you are doing great.
will it be a good idea, to use voltage doubler circuits to incrementally get to 48 volts then use a 48/240 volts step up transformer.(what value mosfets do you advice on)
This is to reduce current going through the primary winding of the transformer.

my challenge being, getting a voltage doubler that can handler a 1000 watts. ,as well as getting a centre tap 48 volts transformer.
finally do you think using this method we can increase to 120 volts , before using a 2:1 ratio transformer to step up as this transformers are generally more reliable
swixxknight said…
how do you implement the optocoupler into the circuit.
thanks
Swag said…
using a boost converter will cause unnecessary wastage of power and increase inefficiency of the system, so I won't recommend that, instead it would be a good idea to use batteries in series to get the required a 48V input.
In case you totally want to avoid the center tap trafo, that may be possible using a ferrite trafo based inverter, first boost the battery voltage to the required mains level, turn it to DC and then again switch it back to a low frequency mains AC
swixxknight said…
Dear Swagatam
can the breadboard version ( https://homemade-circuits.com/make-arduino-breadboard/ )be used to generate the pulse to drive the BJT and MOSFET after the code has been correctly uploaded
Swag said…
Yes surely it can be done, it can be used just as like any other normal Arduino board
Swixxknight said…
Thanks, I appreciate you.
I will keep you updated when I start, my challenge is getting an oscilloscope to monitor waveforms.
Swag said…
Thanks Swixx, for the scope you can try the following concept

https://homemade-circuits.com/single-channel-oscilloscope-using/
swixxknight said…
thanks once again
you are really great
Swag said…
you are most welcome!
Yinktech said…
HI I wanna build an inverter of 1.5kva using arduino programming of atmeg328, so what I really need from you now is full function programming code of this ic which include all necessary activity of inverter function, that's all I need from you sir. Here is my email olayinka06@live.com
Swag said…
I'll try to update the info when I have time...
Yinktech said…
Thanks sir, your work is amazing here, I will be expecting sir.
Swag said…
you are welcome!
vhafuwi said…
Hi
Thanks again for such a wonderful circuit , what is the best way to test if gates are switching properly without oscilloscope

Regards
Swag said…
glad you liked it....connect LEDs across the two channels with respect to ground and with 1K resistors with individual LEDs, increase the delay at seconds in Arduino code
vhafuwi said…
Thanks for the prompt response, just a bit of clarity, I must connect LED accros the two channel , eg The Cathode of the LED go to the ground , 1k resistor to channel and the to Anode ,

From Channell I Connect 1k Resistor then connect it to LED Anode then connect LED Cathode to the Ground , Am I right
Swag said…
you are right!, the 1K can be on the cathode or anode side, it won't matter.
vhafuwi said…
Hello Swagatam , I have replicated the design and it is working very nice, Just a small question , what changes do i have to make to use PC817 Optocoupler to isolate the circuit
Swag said…
vhafuwi, you can use the first example from this article

https://www.homemade-circuits.com/how-to-drive-relay-through-opto-coupler/

but instead of BC557 use another BC547 here, emitter will go to ground and collector to positive via a K resistor....the mosfet gate then can be connected with the collector of this BC547.
kameswar bsvv said…
Where to connect the GND of arduino in the circuit ? And do we have to connect any load to test the citcuit? (Like LED etc)
I rigged up the circuit and changed HIGH to LOW in SPWM code , but I'm not getting output.
Once I got a sine wave but RMS voltage is in millivolts.
I used 12 0 12 to 230V transformer.
I gave 9v to arduino from different source (not from 12V battery)
Thanks
Swag said…
Ground is already connected via the 7812 IC to the battery negative, if you are using an external source for Arduino make sure to connect the negative with the inverter battery negative otherwise you will get no output.

by the way a 9V battery will not work, you must use at least a 12V 7 Ah battery and a 6-0-6V or 9-0-9V 2 amp transformer.
kameswar bsvv said…
Thanks a lot for the answer sir.
I am using Regulated DC power supply instead of a 12 V lead acid battery.
Why we have to use 6-0-6 or 9-0-9 , 2A transformer instead of 12-0-12 transformer ?
I don't need very less current at the output , but I need a pure 230V sine wave control signal.
And is it the positive terminal which should be connected to the center tap of the transformer?
Please suggest me if have to add anything to the circuit .
Thank you so much
Swag said…
You are welcome.

You don't have to connect anything else in the circuit, just make sure the negative of the external supply to the arduino is connected with the battery negative.

The center tap of the trafo will go to the battery positive

the output will be SPWM which will need some filtration to look like a pure sine.
bsvv said…
What is the filter circuit to be used at the output of the transformer for pure AC sine wave?
My application is for low current and 230V
Swag said…
you may have to use capacitor an LC type filter to produce a pure sinewave, as shown in the following example article

https://www.homemade-circuits.com/modified-sine-wave-inverter-circuit-2/
kameswar bsvv said…
Thanks a lot for the circuit.
I am getting SPWM signals at the two MOSFETS.
But when I connect 12-0-12 / 230 V transformer to it, I am not getting 230V ac sine wave , instead I am getting very distorted sine wave in mV.
I want a low power(i.e very low current) and a pure 230 V AC sine wave output.
Do I have to connect resistor between MOSFET and transformer?
Is there anything which I made wrong on the circuit?

Thanks
Swag said…
The functioning is very straightforward and it should start working immediately, actually for low current application, mosfets are not required.

You can make the first circuit, and replace the mosfets with TIP122 transistors, and connect then directly wit the transformer, it should immediately start working with an output of around 250V
kameswar bsvv said…
What is the specification of the transformer?
I am using 6-0-6/230V , 50Hz transformer.
But we are generating higher frequency SPWM which cant be fed to 50 Hz transformer.
So what should be the rating of the transformer?
And where to connect filter (at the primary / secondary side)?
Thanks
Swag said…
transformer rating is OK, just make sure the transistors are oscillating and delivering the current to the transformer winding. You can initially replace the transformer winding with 6V bulbs, and check whether they are illuminating dimly or not? If not then the transistors may not be conducting due to some issue
vhafuwi said…
Hi Mr Swagatam
I have finally constructed the circuit and test it on various transformers , and under different load , eg , 675 Watt Drill together with some Let Light, The Circuit is working 100 % , and I thank you a lot for that , I have designed a an Eagle PCB Layout for it , and also made few changes as integrating a Solar Charger to it , Will mail the Layout for others to try out ,Thanks a million, keep up with this good work
Swag said…
That's wonderful vhafuwi, I am glad it is serving your purpose.

However there are a few modifications that needs to be done in the circuit, you will be able find the updated designs soon which might help you and other viewers to further improve the outcome of the inverter
Uthaya said…
hi sir,
i followed exact circuit below your video but still cant get 240V. im get 170v and not producing sinewave after transformer. i havent build the hardware, im doing in protues 8.1
simulation software.
Swag said…
Hi Uthaya,

I would recommend you to build the set up practically using a small 1 amp transformer, and a 12V 7 Ah battery, and then measure the waveform using an oscilloscope to confirm the actual results
Uthaya said…
now i can produce 220V but not sine wave.. any idea about sine wave?
Swag said…
attach a 0.22uF/400V or higher value capacitor at the transformer output
AngelCast said…
Could you please tell me what code should i use? because i used both arduino codes on SPWM and didnt work as expected.
Swag said…
use the code which is shown in this page: https://www.homemade-circuits.com/arduino-spwm-generator-circuit/
I checked by compiling it just now and it gave me no errors.
Uthaya kumar said…
Hi sir.. can I know, how many watt of bulb you using?. Thank you
Swag said…
Hi Uthaya, it is a 10 watt bulb because the transformer is 1 amp rated. A 1 amp transformer with a 12V battery will produce 12 watts only, and with a PWM this may be reduced to 6 watts
Pcbindex said…
How to improve the rate of defect of automotive PCB
Aditya said…
hello sir, can 7404 be replaced with 7414?
Swag said…
Hello Aditya, yes that's possible, 7414 is Schmidt NOT gate IC which will work better than 7404 in most cases
mutaz alnahhas said…
Thank you for your topic

I would like to ask a question is it possible control the phase angle and the voltage amplitude from the code.
Swag said…
Phase angle can be precisely adjusted by suitably altering the pulse widths and the number of pulses in each block. However this will need to be also complimented by suitably adjusting the capacitor value at the output of the transformer.
Ryan Baga said…
can it be used for 60Hz 230V transformer? can it be used for high power applications?
Swag said…
yes it can be customized for any transformer, and any desired power output
paaker said…
i Think this is most easiest inverter to build. its possible to connect solar charger Battery terminal to this circuit to charge the battery?
Swag said…
Thanks Paaker, yes definitely you can integrate a solar charger with the battery...
Mehedi Sakhawat said…
Is there low battery cut and overload function? plz make me understand
Thanks dear
Swag said…
Mehedi, there's no battery charging or cut off included in this design, you will have to add it separately.
Sandhya Rani said…
Sir, I have simulated the Circuit in Proteus 8.1 got PWM output exactly as u shown in ur website,also tested the mosfets switching state by connecting the leds across two channels working fine. When i connected 12v bulb at the output it is not glowing constantly fraction of secs it is glowing high & again dim just like blinking,to fix that i also used 0.22uf capacitance at the transformer output. I m trying to build pure sine wave inverter 12v dc (from batteries )to 120vAc . Can u help me out to get pure sinewave ? Also can u tell me software for simulation other than proteus?
Swag said…
Hello Sandhya, which design did you build?

I recommend the second design, please build the second design exactly as shown and check the output.

And please make sure to use the first code presented in the following article.
https://www.homemade-circuits.com/arduino-spwm-generator-circuit/

Sorry, I do not use simulators so I cannot recommend any, I always make sure to build circuits practically and check the response in an oscilloscope.
MEKATRONIK said…
Felicitaciones que gran trabajo....Una pregunta estoy usando batería de 24V y el transformador es de 220VAC, debo hacer algún cambio al código de Arduino o no es necesario? y que capacitor debo usar a la salida del transformador para obtener la onda seno pura?..Gracias por tus aportes.
Swag said…
Me complace que le haya gustado el artículo, no tendrá que cambiar nada para la batería de 24V, solo asegúrese de usar un 7812 IC para el Arduino. El condensador de salida debe probarse aleatoriamente. Inicialmente puede probar con 0.22uF / 400V y luego verificar gradualmente la respuesta aumentando este valor.
Mekatronik said…
Mil gracias por su pronta respuesta, olvide comentar que en mi país trabajamos con 60hz, todo sigue igual o debo hacer modificaciones en Arduino o en alguna etapa del circuito?,otra consulta,deseo implementar el temporizador de retardo para evitar problemas en el encendido pero a 24V y en tu diagrama está a 12V,debo hacer cambios? GRACIAS POR TU VALIOSO APORTE A NUESTRA HERMOSA PROFESIÓN...
swag said…
You are most welcome Mekatronik, yes for getting 60Hz the code will need to be changed a bit.

As you can see the total delayMicroseconds on each channel of the code adds up to 10000 that's 10 mS...you will have to adjust and reduce the values proportionately so that the total adds up to 8333 microseconds or 8.33 mS
MEKATRONIK said…
hola el cambio que me sugieres de 8.33mS para 60hz lo debo hacer a estos valores?

const int sPWMArray[] = {500,500,750,500,1250,500,2000,500,1250,500,750,500,500};

O en esta sección del código?
estoy un poco confundido,gracias por tus aportes.

// Loop for pin 1
for(int i(0); i != sPWMArrayValues; i++)
{
if(sPWMpin1Status)
{
digitalWrite(sPWMpin1, HIGH);
delayMicroseconds(sPWMArray[i]);
sPWMpin1Status = false;
}
else
{
digitalWrite(sPWMpin1, LOW);
delayMicroseconds(sPWMArray[i]);
sPWMpin1Status = true;
}
}
Swag said…
Hi, you will have to adjust the delays proportionately such that the total for each channel is 833.33
Apex said…
Good day my precious Boss, kudos to you on the good work on electronics. I want to ask some questions related to the circuit you recommended sir.
1. I want to use 6 mosfets will i use six 1K or that two will take care of it.
2. i want to add LCD to it using thesame arduino, hope it wont affect the PWM signal. or i should use different arduino for that.
Swag said…
Apex, for increasing capacity you can increase the number of mosfets, no need of adding extra resistors, you can connect all the gates together and join them with the collector of the transistor.

You can use an LCD if you have the code, I am not sure how it would impact the inverter PWM, most probably it shouldn't
Adez said…
Hello Swagatam,

I want to experiment with your design but I cand find 7404 in Farnell database.
Is it the same with SN7404N ?

Thanks!
Swag said…
Hi Adez, the CMOS stage is actually not needed, you can effectively use the second design with 4 BJTs and 2 mosfets.

But please take care of the booting issue in Arduino by including the delay timer stage in the mentioned design
ajadi Samuel said…
hello guys noticed an issue I built the design but the MOSFETs are heating up even on no load I don't know if any one has a solution to that
Swag said…
Hello, please allow the Arduino to boot first and then connect the transformer center tap with the battery. Please see the second last diagram for the warning message and please do accordingly.
Chetan Shintre said…
Sir,How many watt can we get? And what to do to increase watt?
1 – 200 of 201 Newer Newest

Contact me for Customized Circuits

Name

Email *

Message *


 Follow on G+  Follow on Facebook   Follow on Tweeter  Follow on G+  Follow on G+

Follow Homemade Circuits