• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Hire Me | Contact | Calculators-online
You are here: Home / Arduino Projects / Arduino Pure Sine Wave Inverter Circuit with Full Program Code

Arduino Pure Sine Wave Inverter Circuit with Full Program Code

Last Updated on May 14, 2026 by Swagatam 660 Comments

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.

Table of Contents
  • Circuit Operation
    • Powering the Arduino Board
    • Waveform Images for Arduino SPWM
    • Using BJT Buffer Stage as Level Shifter
  • Program Code for the above Arduino Sine Wave Inverter Circuit
    • Delay Effect
    • A More Reliable Delay ON Timer
    • Adding an Automatic Voltage Regulator
    • How to Setup
    • The Complete Circuit Diagram

Circuit Operation

In the last article I have explained 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.

You may also want to read: H-Bridge Sine Wave Inverter Circuit

Arduino Pure Sine Wave Inverter Circuit

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

Arduino Pure Sine Wave Inverter Circuit SPWM waveform

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

UPDATE:

Using BJT Buffer Stage as Level Shifter

Since an Arduino board will produce a 5V output, it may not be an ideal value for driving mosfets directly.

Therefore an intermediate BJT level shifter 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:

simple Arduino sinewave inverter circuit using SPWM
The above design is the recommended one! (Just make sure to add the delay timer, as I have explained below!!).

UPDATE: Get this Improved Arduino SPWM Code

Program Code for the above Arduino Sine Wave Inverter Circuit

// By Swagatam
void setup(){
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
void loop(){
digitalWrite(8, HIGH);
delayMicroseconds(500);
digitalWrite(8, LOW);
delayMicroseconds(500);
digitalWrite(8, HIGH);
delayMicroseconds(750);
digitalWrite(8, LOW);
delayMicroseconds(500);
digitalWrite(8, HIGH);
delayMicroseconds(1250);
digitalWrite(8, LOW);
delayMicroseconds(500);
digitalWrite(8, HIGH);
delayMicroseconds(2000);
digitalWrite(8, LOW);
delayMicroseconds(500);
digitalWrite(8, HIGH);
delayMicroseconds(1250);
digitalWrite(8, LOW);
delayMicroseconds(500);
digitalWrite(8, HIGH);
delayMicroseconds(750);
digitalWrite(8, LOW);
delayMicroseconds(500);
digitalWrite(8, HIGH);
delayMicroseconds(500);
digitalWrite(8, LOW);
//......
digitalWrite(9, HIGH);
delayMicroseconds(500);
digitalWrite(9, LOW);
delayMicroseconds(500);
digitalWrite(9, HIGH);
delayMicroseconds(750);
digitalWrite(9, LOW);
delayMicroseconds(500);
digitalWrite(9, HIGH);
delayMicroseconds(1250);
digitalWrite(9, LOW);
delayMicroseconds(500);
digitalWrite(9, HIGH);
delayMicroseconds(2000);
digitalWrite(9, LOW);
delayMicroseconds(500);
digitalWrite(9, HIGH);
delayMicroseconds(1250);
digitalWrite(9, LOW);
delayMicroseconds(500);
digitalWrite(9, HIGH);
delayMicroseconds(750);
digitalWrite(9, LOW);
delayMicroseconds(500);
digitalWrite(9, HIGH);
delayMicroseconds(500);
digitalWrite(9, LOW);
}
//-------------------------------------//

Video Clip

Parts List

All resistors are 1/4 watt, 5% CFR

  • 10K = 4
  • 1K = 2
  • BC547 = 4nos
  • Mosfets IRF540 = 2nos
  • Arduino UNO = 1
  • Transformer = 9-0-9V/220V/120V current as per requirement.
  • Battery = 12V, Ah value as per requirement

Delay Effect

To ensure that the mosfet stages initiate with a delay during the Arduino booting or start up, you may modify left side BC547 transistors into delay ON stages, as shown below. This will safeguard the mosfets and prevent them from burning during power switch ON Arduino booting.

PLEASE TEST AND CONFIRM THE DELAY OUTPUT WITH AN LED AT THE COLLECTOR, BEFORE FINALIZING THE INVERTER.
FOR INCREASING THE DELAY YOU CAN INCREASE THE 10K VALUE TO 100K

A More Reliable Delay ON Timer

If you are not comfortable with the response of the above passive delay ON timer circuit, you can employ the following configuration using BJTs and a relay. This design is extremely reliable and will effectively protect your Arduino and the inverter from burning due to a malfunctioning delay effect.

Just add this to the above inverter configuration.

Adding an Automatic Voltage Regulator

Just like any other inverter the output from this design can rise to unsafe limits when the battery is fully charged.

To control this an automatic voltage regulator could be employed as shown below.

The BC547 collectors should be connected to the bases of the left side BC547 pair, which are connected to the Arduino via 10K resistors.

Arduino sinewave output correction automatic

For an isolated version of voltage correction circuit we can modify the above circuit with a transformer, as shown below:

Make sure to join the negative line with the battery negative

How to Setup

To set up the automatic voltage correction circuit, feed a stable 230V or 110V as per your inverter specs to the input side of the circuit.

Next, adjust the 10k preset carefully such that the red LEDs just light up. That's all, seal the preset and connect the circuit with the above Arduino board for implementing the intended automatic output voltage regulation.

The Complete Circuit Diagram

The complete diagram using the automatic voltage regulator and the delay ON timer would look like this:

You'll also like:

  • Grid Tie Inverter2C Wiring Details2C DiagramHow to Calculate Solar Panel, Inverter, Battery Parameters
  • hello2BworlddddHow to Interface Cellphone Display with Arduino
  • microcontroller pinoutMicrocontroller Basics Explored
  • IR2111 H-Bridge Inverter Circuit with Soft Start

Filed Under: Arduino Projects, Inverter Circuits Tagged With: Arduino, Full, Inverter, Pure, Sine, Wave

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!



Previous Post: « Arduino SPWM Generator Circuit – Code Details and Diagram
Next Post: Arduino Frequency Meter Using 16 x 2 Display »

Reader Interactions

Questions & Answers

Total Posts: 660
Newest Oldest
Shahin
June 11, 2026 • 2 months ago #208215

Hello engineer. I hope God gives you absolute health for providing such practical tools without your expectations. Thank you
engineer. I wanted to see if it was possible to design and build a practical circuit for detecting a fault. Thank you.

Reply
SwagatamAdmin
June 12, 2026 • 2 months ago #208250

Thanks Shahin, actually your digital multimeter and oscilloscope are the best gadgets for detecting faults in a circuit…
Or you can explain me what type of circuit are you referring to?

Reply
Ngwabe david
June 25, 2026 • 2 months ago #208861

thans but ineed a circuit that can charge spiro battery

Reply
شاهین
June 15, 2026 • 2 months ago #208378

Hello, don’t be shy, Mr. Engineer, thank you for your quick response. I think the multimeter you mentioned is a good solution. Thank you. I wanted to know if you are also working on metal detector projects. If so, is it possible for you to post a schematic of a practical and accurate metal detector? Thank you again for all your efforts.

Reply
SwagatamAdmin
June 16, 2026 • 2 months ago #208405

Thank you Shahin, for your feedback….I already have a few good article on metal detectors, you can check them out here:
https://www.homemade-circuits.com/vehicle-body-metal-detector-circuit/
https://www.homemade-circuits.com/how-to-make-simple-metal-detector/
https://www.homemade-circuits.com/stud-finder-circuit-find-hidden-metals-inside-walls/

Reply
Sam
June 11, 2026 • 2 months ago #208209

Hi.
Well, I am an old user of your site and visiting you after a long time and happy to see you are still serving humanity.
I have both a 48v and 12v, iron core transformers salvaged from old UPS (imported and sinewave, APC) but never used. Now intend to build a pure sinewave inverter and want to connect it with a 585w, 48v solar plate however I have certain problems:
1). The voltage of Solar plate can be between 36v to 60v (rated 48v, passing clouds etc.), so the inverter’s input can accommodate such voltage fluctuations.
2). I intend to directly attach inverter with Solar plate
3). Presently my load is about a total of 120 watts for two BLDC based electric fans, 220v (assumed to safe electricity, these fans have an electronic circuit attached above, which seems to convert AC to pulse mode DC and has remove controls to operate at 7 deifferent speeds). However, I intend to use a pc computer (450w) as well, in future so total watts can be around 600w or more.
4). The inverter can shutdown safely if input voltage is below a certain voltage i.e. 36v
5). The inverter also shutdowns safely if overloaded, load greater than a “preset” watt consumption i.e. greater then 200 or 500 watts.
6). Output needs to pure sinewave.
7). A simple way to calculate and accommodate, if I need to change the input voltage later on i.e. 12v or 24v etc.
8). Power FET’s can be used as low-cost variants, so build is cheaper.
9). The 12v transformer seems to be center tapped but other is not. So please suggest how to use transformers in either case i.e. a center tapped and without one or two wires only.

Please suggest me some circuits in light of above. If circuits are already tested then it shall be better otherwise, I may experiment. Moreover, using latest tech i.e. Arduino etc. if circuit can be reduced then it’s much better. Lower troubleshooting, and may have a chance to work first time. Moreover, I don’t need batteries (very expensive), just to utilize day light to save some grid electricity billing.
I have experience building a lot of analog circuits and also knows programming though never created a digital electronic circuit before.
Regards

Reply
SwagatamAdmin
June 24, 2026 • 2 months ago #208823

Hi, I think you can start the project with the circuit design as explained in the following article.
However for the transformer you will have to go with an iron cored toroidal transformer, rated at 0-36V 10 amps.
https://www.homemade-circuits.com/making-an-egs002-equivalent-board-using-arduino/
To change the 12V/24V voltage rating you will have to change the transformer accordingly.
If you want a ferrite based design then you may have to do some calculations. I can help with that also…

Reply
SwagatamAdmin
June 12, 2026 • 2 months ago #208247

Hi, thanks for your detailed explanation about the project…I am currently working on your project and it may take sometime to finish the basic design, which we can later on modify according to your specifications…I will let you know once it is done…

Reply
Kumah Andrews
May 26, 2026 • 3 months ago #207515

Please do raspberry pi pico own for us.

Reply
SwagatamAdmin
May 26, 2026 • 3 months ago #207533

Sure, thank you, I will try to include raspberry pi pico projects also in this blog soon

Reply
Andrews Kumah
June 9, 2026 • 2 months ago #208100

Please I am still waiting in eagerness

Reply
SwagatamAdmin
June 12, 2026 • 2 months ago #208249

Thank you for your request, Actually currently I am busy doing youtube videos so not getting time for your projects, but I have noted it and I will try to start it posting soon…

Reply
Manuline
February 22, 2026 • 6 months ago #201555

Hello,
Can I use this circuit for a 110W fan? (inductive load)
I have a transformer 2x9v – 160VA
Thanks

Reply
SwagatamAdmin
February 23, 2026 • 6 months ago #201583

Sure, you can operate a 220V fan, but after adding an LC filter at the output of the transformer…and also make sure to add snubbers across the MOSFET gates…

Reply
suat
February 19, 2026 • 6 months ago #201322

Hi Swagatam, When we compare the above ardunio waveform with the ideal AC waveform, do you think that Ardunio output is exactly the equivalent? I will use this for the combi boiler. So is it possible to say that they are compatible in the aspect of the waveform since the boiler circuits may be sensitive?

Reply
SwagatamAdmin
February 20, 2026 • 6 months ago #201375

Hi Suat, yes the microseconds are dimensioned precisely to match a standard mains AC waveform, however for more accurate structure you can take the help of the following calculator:
https://www.homemade-circuits.com/sine-table-calculator-for-spwm-arduino-code/

Reply
Reuben
December 6, 2025 • 9 months ago #194346

plse help me Hex file of Aduino puresine inverter ,i havent skils for convert codes to Hex file

Reply
SwagatamAdmin
December 8, 2025 • 9 months ago #194608

Here’s the HEX conversion for the Arduino code:

:100000000C945C000C9479000C9479000C947900A9
:100010000C9479000C9479000C9479000C9479007C
:100020000C9479000C9479000C9479000C948C0158
:100030000C9479000C9479000C9479000C9479005C
:100040000C9442010C9479000C9479000C94790082
:100050000C9479000C9479000C9479000C9479003C
:100060000C9479000C947900000000080002010053
:100070000003040700000000000000000000000072
:10008000250028002B0000000000240027002A0083
:10009000040404040404040402020202020203032E
:1000A0000303030301020408102040800102040836
:1000B000102001020408102011241FBECFEFD8E049
:1000C000DEBFCDBF11E0A0E0B1E0E4ECF4E002C09F
:1000D00005900D92A631B107D9F721E0A6E1B1E074
:1000E00001C01D92A232B207E1F70E94F7010C9401
:1000F00060020C94000090E0FC01EC55FF4F24914D
:1001000080579F4FFC018491882399F090E0880FDD
:10011000991FFC01EA57FF4FA591B491FC01E458E7
:10012000FF4F859194918FB7F894EC91E22BEC936B
:100130008FBF089590E0FC01E859FF4F2491FC0126
:10014000EC55FF4F3491FC01E057FF4FE491EE2353
:10015000C9F0222339F0233001F1A8F4213019F13C
:10016000223029F1F0E0EE0FFF1FE458FF4FA59178
:10017000B4918FB7F894EC91611126C030953E236D
:100180003C938FBF08952730A9F02830C9F0243060
:1001900049F7809180008F7D03C0809180008F7728
:1001A00080938000DFCF84B58F7784BDDBCF84B5AB
:1001B0008F7DFBCF8091B0008F778093B000D2CF3E
:1001C0008091B0008F7DF9CF3E2BDACF1F93CF9374
:1001D000DF93182FEB010E947B00209739F460E039
:1001E000812FDF91CF911F910C949A00CF3FD105C1
:1001F00011F461E0F5CFE12FF0E0E859FF4FE49111
:10020000E33031F140F4E130B1F0E230E1F0C038F8
:10021000D1057CF7E4CFE73029F1E83059F1E4303B
:10022000B1F780918000806280938000D0938B0032
:10023000C0938A0004C084B5806884BDC7BDDF91C7
:10024000CF911F91089584B5806284BDC8BDF7CF5A
:1002500080918000806880938000D0938900C09353
:100260008800EDCF8091B00080688093B000C0938B
:10027000B300E5CF8091B00080628093B000C0935E
:10028000B400DDCF1F920F920FB60F9211242F935F
:100290003F938F939F93AF93BF9380911E01909153
:1002A0001F01A0912001B091210130911D0123E097
:1002B000230F2D3758F50196A11DB11D20931D0167
:1002C00080931E0190931F01A0932001B093210100
:1002D0008091190190911A01A0911B01B0911C010C
:1002E0000196A11DB11D8093190190931A01A0934D
:1002F0001B01B0931C01BF91AF919F918F913F91D2
:100300002F910F900FBE0F901F90189526E8230F86
:100310000296A11DB11DD2CF1F920F920FB60F9260
:1003200011242F933F934F935F936F937F938F93FA
:100330009F93AF93BF93EF93FF9370E060E089E0EA
:100340000E94E60070E060E08AE00E94E60083EC34
:1003500090E00197F1F78091180181113AC0E09186
:100360001601F0911701E050FF4F608170E089E0C5
:100370000E94E60070E060E08AE00E94E600809162
:100380001601909117010196909317018093160121
:100390008091160190911701459754F01092170122
:1003A000109216018091180191E08927809318011D
:1003B000FF91EF91BF91AF919F918F917F916F913D
:1003C0005F914F913F912F910F900FBE0F901F9013
:1003D000189570E060E089E00E94E600E091160167
:1003E000F0911701E050FF4F608170E0C5CF789425
:1003F00084B5826084BD84B5816084BD85B582602A
:1004000085BD85B5816085BD80916E0081608093DA
:100410006E00109281008091810082608093810043
:100420008091810081608093810080918000816053
:10043000809380008091B10084608093B1008091AE
:10044000B00081608093B00080917A0084608093D6
:100450007A0080917A00826080937A0080917A009D
:10046000816080937A0080917A00806880937A001E
:100470001092C10089E00E947B008AE00E947B000C
:10048000109280001092810088EB93E09093890095
:1004900080938800809181008860809381008091A2
:1004A000810082608093810080916F0082608093E0
:1004B0006F00C0E0D0E02097F1F30E940000FBCF76
:0404C000F894FFCFDE
:1004C4008093A7B9CADAE7F1F9FDFFFDF9F1E7DA9C
:0604D400CAB9A7938000E5
:00000001FF

Reply
akash
July 19, 2025 • 1 year ago #184567

at 12v input my output voltage is not going above 80-90volts . when I increased the input voltage around 30v my drain to source diode burned (i was using 4148 diode 😐 ) , can I use uf4007 as a flyback diode . I am using a push pull diver with pnp and npn for gate driving . I have used your gate driving method too , but my output never goes over 90volts . I have also tried a different transformer but same problem . not added the feedback circuit yet . can you help me please . I also tried using a 12v zener to protect the gate .

Reply
SwagatamAdmin
July 19, 2025 • 1 year ago #184568

If you have used the second diagram with 4 BJTs, exactly as shown in the above article, then definitely it is the problem of your transformer.
Make sure the transformer primary is rated around 7-0-7V or 9-0-9V, and not 12-0-12V.
You can use freewheeling diodes across the transformer winding, between center tap and the outer taps. UF4007 is OK.
Please try with a 12v supply only, do not increase it.

Reply
akash
July 20, 2025 • 1 year ago #184598

sir thank you for the response . sir I have tried using a 9-0-9 transformer according to you but the results are same . can you please help me with this , I have to submit this projects within a week .

Reply
SwagatamAdmin
July 20, 2025 • 1 year ago #184609

Akash, that means something may be wrong either with your transformer or your meter. I think you should test it with an oscilloscope.
As you can see everything worked perfectly for my prototype. The 100 watt bulb illuminated fully, without dropping any output voltage.
Are you testing it with an output load or without load? What is the Ah rating of your battery, and current ratings of your transformer?

Reply
akash
July 21, 2025 • 1 year ago #184640

sir without load i am getting 100volts and with load its dropping . I am using a 3ampere power supply . sir I have seen people using a higher ampere transformer . should I go for that ? or should I go for higher amp power supply ?

Reply
SwagatamAdmin
July 21, 2025 • 1 year ago #184645

Akash, Please try the following design and let me know the results, if you still see the same problem, then certainly your transformer could be the culprit:
Arduino sine wave inverter circuit using TIP122 BJTs

Reply
Mia
May 22, 2025 • 1 year ago #178053

Hi Bro
Thanks for sharing your experiences.
I’m really keen to know about 3 phases and the codes.
you mean 3 phases, but with how much votage?
110V or 380V

Reply
SwagatamAdmin
May 23, 2025 • 1 year ago #178136

Thanks Bro, the voltage will depend on your choice, you can feed any desired DC voltage across the MOSFETs as per the load specifications…

Reply
fadhli
May 16, 2025 • 1 year ago #177211

1. anda menggunakan transformator jenis apa ? (inti besi, ferit, toroid) yang mana.
2. ideal waktu PWM berapa bagusnya ?
e-mail : [email protected]

Reply
SwagatamAdmin
May 16, 2025 • 1 year ago #177218

Iron core transformer is used in the above article.
For a ferrite core trafo you can use a pwm as high as 100kHz or above…

Reply
Anishka Prajapati
April 8, 2025 • 1 year ago #172107

may you please explain the Arduino UNO code sir which used in it …….

Reply
SwagatamAdmin
April 8, 2025 • 1 year ago #172136

Hello Anishka, you can refer to the following article for the full explanation:
https://www.homemade-circuits.com/arduino-spwm-generator-circuit/

Reply
Anishka Prajapati
April 3, 2025 • 1 year ago #171354

sir maybe I supply Arduino from laptop ??

Reply
SwagatamAdmin
April 3, 2025 • 1 year ago #171394

Yes, you can use the 5V from laptop USB to power your Arduino…

Reply
Anishka Prajapati
March 26, 2025 • 1 year ago #170534

sir is that IRFZ44N mosfet use kar sakte ??

Reply
SwagatamAdmin
March 26, 2025 • 1 year ago #170542

Yes, you can use IRFZ44 MOSFETs in the suggested design.

Reply
Anishka Prajapati
March 19, 2025 • 1 year ago #169871

how to make spwm from 4 mosfet in place of 2 like shown in 1st fig upto 80-100W power (please show circuit diagram or DM at my E-MAIL ID)

Reply
SwagatamAdmin
March 20, 2025 • 1 year ago #169898

Do you mean a 3 phase sine wave inverter using H-bridge topology?
Yes, I am planning to write an article on this topic.
I will post it soon and let you know.

Reply
Anishka Prajapati
March 20, 2025 • 1 year ago #169903

No I’m actually talking about 1 phase with H bridge and it’s really helpful if you reply it or make an article on it …. plsI appreciate it if you do

Reply
SwagatamAdmin
March 20, 2025 • 1 year ago #169928

I have created the diagram which you can see below, while in the meantime I will write the article description on this.
arduino sine wave full bridge inverter circuit diagram

For the code you can use the same code which was used in the above article…

Reply
Anishka Prajapati
March 20, 2025 • 1 year ago #169934

thank you very much sir I appreciate it and it’s really helpful for me …

Reply
SwagatamAdmin
March 21, 2025 • 1 year ago #169966

You are welcome Anishka,
For the complete article you can refer to the following post also:
https://www.homemade-circuits.com/arduino-h-bridge-sine-wave-inverter-circuit/

Reply
SwagatamAdmin
March 20, 2025 • 1 year ago #169908

OK got it! I will post it, and let you know soon..

Reply
Anishka Prajapati
March 24, 2025 • 1 year ago #170294

Sir if I make this project then it’s necessary that I need to use bread board?
And also if I wanna increase power output then I can use transformer?
And also sir is that I can use specific separate battery for supply Arduino UNO ?

Reply
SwagatamAdmin
March 25, 2025 • 1 year ago #170335

Anishka, Breadboard is not recommended for the H-bridge project, so you should try it only on a well designed PCB.
If you are using a 12V battery, then you can use a transformer as the “load” for converting 12v to 220v.
Separate battery is not required.
You can use a IC 7812 for getting the 12V supply, and IC 7805 for getting the 5V supply for the circuits from the main 12V battery.

Reply
Walker
March 21, 2025 • 1 year ago #169948

Hi Sir im designing same project, i would really appreciate your assistance. I can even pay you if i have to. Please send me an email for update

Reply
SwagatamAdmin
March 21, 2025 • 1 year ago #169980

Hi Walker,
No need to pay, if you have any related questions please feel free to ask, I will try my best to help you succeed with this project…

Reply
Walker
March 22, 2025 • 1 year ago #170096

I’m Designing a transformerless inverter capable of delivering 500W and output frequency of 60Hz. Beside adding DC boost converter what other changes are to made if i follow steps of your project. It’s a pure sine wave inverter like yours.

Reply
SwagatamAdmin
March 22, 2025 • 1 year ago #170100

No changes would be required in the H-bridge, you can build it exactly as shown.

Reply
Walker
March 22, 2025 • 1 year ago #170101

Meaning i will have to add DC boost code to your code and my calculated DC boost values i will obtain pure sine wave inverter delivering 500W and AC output of 60Hz?

Reply
Walker
March 22, 2025 • 1 year ago #170108

They were specific not to use a transformer that is why i chose to use DC boost converter

Reply
SwagatamAdmin
March 23, 2025 • 1 year ago #170135

Then you can use the boosted DC output supply across the H-bridge MOSFET drain/source, that’s all is needed.

Reply
SwagatamAdmin
March 22, 2025 • 1 year ago #170104

For bosting the battery voltage to a higher level at 60Hz, you only need to add a transformer at the output of the H-bridge MOSFETs, meaning the “LOAD” points must be replaced with the primary of the transformer, and the secondary can be used with an AC load with boosted output.

Reply
Luca
March 5, 2025 • 1 year ago #168785

Witch is the maximum output power possible with IRF540 ? I need to obatain 100VA 110V @ 400 Hz for a vintage avionic radio equipment. Thanks.

Reply
SwagatamAdmin
March 5, 2025 • 1 year ago #168822

100VA, 110V, 400Hz is easily achievable using IRF540 MOSFETs, provided the transformer and the battery are also appropriately rated.

Reply
Hillary
September 29, 2024 • 2 years ago #162046

Good day sir. can lm358 OpAmp be used for the feedback circuit?

Reply
SwagatamAdmin
September 29, 2024 • 2 years ago #162053

Hi Hillary, yes any standard opamp can be used.

Reply
Ainsworth Lynch
July 17, 2024 • 2 years ago #154938

Hey I built this circuit today after some years now, I keep getting one Fet blown, not sure if its because I am using Irfz44n Fets, I did not build the delay on circuit, Instead switched pin 9 and 10 to input on boot up and added a delay then switch them to output when the arduino is fully booted after 2 seconds but I still have the same fet shorting on each leg, the software method is a standard practice, I I still get output from the inverter with one fet blown 30v.

Would irf740 work better thats the only other thing I have.

Reply
SwagatamAdmin
July 17, 2024 • 2 years ago #154944

Hi, In my experiment I used IRF540 and did not have any such issues. But i don’t think the IRFZ44N can be the problem, unless the MOSFET has some internal defect. You can isolate the power supply input to the transformer center-tap and the Arduino, and then switch ON the Arduino first, and then after about 5 seconds switch ON the supply to the transformer and check the results.
irf740 may not be suitable because it is rated at 400V and your transformer may be rated at just 12-0-12V.

Reply
ainsworth lynch
July 17, 2024 • 2 years ago #154947

I added a software delay but when I read the article I realize the delay should just be for one Fet I delayed them both which is probably my issue.

also I used the modified spwm code that Mr Atton made im not sure if you tested that without issue also, if not I would just use your code.

Reply
SwagatamAdmin
July 17, 2024 • 2 years ago #154949

Please initially check with a manual delay, by isolating the transformer center tap and the Arduino, and please use only the code supplied by me, because it is the tested one.

Reply
Jonathan codjoe
June 28, 2024 • 2 years ago #153294

Hi swagatam. Trust you good?. I have designed the above circuit which is working perfectly fine. But my problem is the feedback circuit which I have designed just as it is but it is still not working. Please try and solve my problem for me. Thanks

Reply
SwagatamAdmin
June 28, 2024 • 2 years ago #153296

Thank you Jonathan,
I hope you have built and implemented the following feedback circuit:
Arduino regulation
I would suggest you to test this circuit stage separately using a variac.
In this circuit, can you please test how much voltage do you get across the 10uF capacitor.
Remember, this DC voltage across the 10uF is the direct interpretation of the AC 220V that comes from the inverter output. When the inverter output voltage rises, this DCV also rises. As soon as this corresponding DC voltage at pin#3 of the 741 IC goes above the pin#2 zener vooltage, the output pin#6 of the IC turns high causing the BC547 to conduct and ground the MOSFET gates, shutting down the inverter.
So please verify the above stage separately and let me know.

Reply
Kerim Fahme
February 17, 2024 • 3 years ago #149235

Hi Swagatam,
As you know, sinewave PWM (SPWM) could be generated at different high frequencies (though much higher than 50 Hz). Since I don’t have Arduino board (though I design the hardware and firmware of my controllers using AVR MCUs, as ATmega8 and ATmega32) I wonder if you measured the PWM frequency which is generated by the offered Arduino firmware above. Thank you.
For instance, let us assume that the SPWM frequency is around 16 KHz. Naturally, it needs to be filtered to generate the 50Hz pure sinewave output at the transformer secondary. I read many articles on how to build a pure sinewave inverter, but none of them shows how the SPWM filtration is done. The only device which is supposed to do it in their circuits is the inverter power transformer since there is no explicit filter. But to let the transformer act as a filter, its mutual coupling coefficient (K) shouldn’t be made close 1 (as in mains stabilizers for example). The more K is made lower than 1, the higher the leakage inductance between the MOSFETs and the load is. And this leakage inductance does the filtering (shunted also by the iron losses at the high frequencies). But the more (K) is made lower than 1, the lower the transformer efficiency is. In practice, separating the coils of the primary and secondary, instead of winding them on the same coil, lowers (K). The optimum distance between the two coils is usually determined by trial and error. But if by adding a small capacitor (<1uF) at the transformer output (not loaded), the output voltage is acceptable (its high frequency ripple is hardly noticeable), the transformer is ok.

Reply
SwagatamAdmin
February 17, 2024 • 3 years ago #149238

Thank you Kerim, for the valuable information.

Each 50 Hz half cycle is chopped into 7 pillars, or 7 pieces, so each 20 millisecond cycle accompanies 14 PWM peaks.
I know this may look a little higher to handle for an iron core transformer, but in my experiment it worked perfectly well, without any buzzing or heating up of the transformer.
Yes, adding a high voltage capacitor at the output side of the transformer helps to smoothen the SPWM cycles into pure a sinewave like frequency.

Reply
Kerim Fahme
February 17, 2024 • 3 years ago #149244

If I understood you well, the PWM of the Arduino program (above) is 700 Hz only. At this relatively low frequency, I expect the ripple of the sinewave output is not small. So, I wonder how it looks on your scope screen in your experiment. Please let me know if the output ripple could be made small even at this very low PWM frequency and without an external LC filter. Thank you.
But, even with such a high ripple, the generated output is much better than of a square wave or quasi-sinewave.
For instance, among your many published articles about the pure sinewave inverters, which one its PWM frequency is highest?

Reply
SwagatamAdmin
February 17, 2024 • 3 years ago #149250

Thank you Kerim, for calculating the frequency.
According to my knowledge the only way to reduce the ripple is either by using a capacitor at the transformer output or by increasing the pwm frequency and using a ferrite core transformer.
In the above Arduino concept I used a 3uf capacitor at the output which produced a relatively good sinewave, however if this capacitor value is increased that might further help to improve the sine waveform quality and reduce the ripples proportionately, although that would also incur some power wastage. The above sinewave inverter project uses the maximum frequency for the pwm among all the published articles.

Reply
Kerim Fahme
February 18, 2024 • 3 years ago #149257

I asked about the SPWM frequency because lately I wrote a code for ATmega8 to generate the SPWM at 15.625 KHz (8000 KHz / 512). (For instance, since about 40 years ago, I used to write my CPU/MCU codes in assembly language only). This code can be used for a push-pull inverter which I designed its hardware too. Its push-pull transformer could be driven by two sets of N-MOSFET which, in turn, are driven by discrete circuits using BJT; NPN & PNP for fast turn on-off with dead time.
By simulating the code and its hardware, the results were as expected. I set K=0.99 in the transformer model. I hope soon I will have the time to test it in real.
In case we will find a way to let you receive files from me, I don’t mind sharing my design here (code and circuit).

Reply
SwagatamAdmin
February 18, 2024 • 3 years ago #149260

MCUs existed 40 years ago? I did not know that. Thanks for sharing the info.
Sure, please feel free to share the codes anyway you like, through email or directly through comments using online free upload sites.
I appreciate your kind efforts.

Reply
Kerim Fahme
February 18, 2024 • 3 years ago #149271

Sorry for not being clearer. You are right, 40 years ago, MCUs didn’t exist, only CPUs did (as Z80).
I had to say on my precious post:
“In the last 40 years, I used to write first my CPU codes (for Z80), then my MCU codes (for C51 and AVR families).in assembly language only”.

Reply
SwagatamAdmin
February 18, 2024 • 3 years ago #149272

OK, got it, thanks for the clarification.

Reply
Damir
February 4, 2024 • 3 years ago #148944

Few suggestions:

– Can the delay circuit be realized mainly in the software? I think the Arduino microcontroller ensures that on power on, all I/O pins are set to the input direction and in the high-Z mode by the microcontroller electronics. Software must explicitly configure pins for output or PWM. Suppose the Arduino pins that drive BC547 transistors are pulled to the ground with 100k or stronger resistors. Would it be enough to ensure that the MOSFET stages initiate with a delay during the Arduino booting or start-up? MOSFETS will be active once the Arduino application reconfigures the pins driving BC547 transistors.

– The automatic voltage regulator can be realized mostly in the software. Arduino has 6 ADC inputs and is capable of performing tens of thousands of ADC conversions a second. A simple voltage divider with a diode and capacitor as a half-wave rectifier can be connected to the Arduino ADC pin. Arduino ADC pins have about 100k input impedance, so a half-wave rectifier should be good enough. After every SPWM cycle, Arduino can read the output voltage and decide what to do next.

Reply
SwagatamAdmin
February 4, 2024 • 3 years ago #148947

Thank you for your valuable suggestions, it would be indeed very nice if the delay feature and the automatic voltage control are added within the Arduino. Please let us know if you have the necessary programming codes for that.

Yes, if the Arduino pins that drive BC547 transistors are pulled to the ground with 100k or stronger resistors, that would be enough to ensure that the MOSFET stages initiate with a delay during the Arduino booting or start-up.

Reply
Ainsworth Lynch
July 17, 2024 • 2 years ago #154939

Would I only need to pull one side to ground or both bc547

Reply
SwagatamAdmin
July 17, 2024 • 2 years ago #154945

both the BJTs….

Reply
Omar
December 2, 2023 • 3 years ago #147628

how can I make closed loop single phase inverter using Arduino

Reply
SwagatamAdmin
December 2, 2023 • 3 years ago #147629

Please go through the above article, everything is explained in it.

Reply
RK Seth
October 22, 2023 • 3 years ago #146396

Hello sir I want to control inverter out put by varying the the duty cycle values of arduino by push button from 0 to 100% duty cycle at increment or decrement by 1%.
I want to make 0 to 10 volt pure sinwave inverter at 400 Hz frequency and the ac voltage can be controlled by microcontroller at +/- 1% duty cycle variation so that 10 volt AC change accordingly.
Thanks and regards.

Please suggest me the code and circuit.

Reply
SwagatamAdmin
October 22, 2023 • 3 years ago #146400

Hello RK, I wish I could solve your query, however my Arduino coding skills are not good enough, therefore it can be difficult for me to help you with this question.

Reply
Rk seth
November 21, 2023 • 3 years ago #147252

thanks for reply.

Reply
Stan
September 29, 2023 • 3 years ago #145538

So the CMOS based circuit seams like an inherently better circuit as circuit loading does not affect the arduino outputs? however, I notice there is no feedback mechanism like it the upper circuit. Is it not possible or just not needed because of the buffer?

Reply
SwagatamAdmin
September 29, 2023 • 3 years ago #145541

There’s no loading with the transistorized circuit also due to the presence of the 10K resistors. 10K is quite a high value and will absolutely not cause any loading on the Arduino.
Yes, feedback might not be necessary since the Arduino generates a fixed PWM.

Reply
stan
September 29, 2023 • 3 years ago #145560

then which circuit would you choose? I am planning to build a low powered 12V, 500ma, to 120V variable frequency inverter.

Also, I have started trying to source components for the CMOS version but find that at Digikey many items are either obsolete or require purchasing large quantities, I’m not willing to pay $3000 to use only 2 transistors. Can you suggest alternate parts?

Reply
SwagatamAdmin
September 29, 2023 • 3 years ago #145563

The transistorized version of the above Arduino inverter is the most efficient one and is a tested design. I would recommened this design. The 10K resistor associated with the Arduino outputs can be even raised to 100K to reduce loading.

I did not quite understand what you meant by “I’m not willing to pay $3000 to use only 2 transistors. Can you suggest alternate parts?” Kindly elaborate

Reply
Stan
September 29, 2023 • 3 years ago #145565

BC547 is listed as obsolete on Digikey. https://www.digikey.com/en/products/detail/onsemi/BC547/976363#product-details-substitutes

BC548 is also obsolete in bulk, but i I buy 6662 of them they are only .05 each. ($333.10) , https://www.digikey.com/en/products/detail/rochester-electronics-llc/BC548/11545848

i forget which one only had a $3000 option. i’ll have to take better notes in my searching

Reply
SwagatamAdmin
September 29, 2023 • 3 years ago #145568

That’s super strange because BC547 is the most standard type of BJT and one of the most used general purpose transistor…. how on earth this transistor can become obsolete??
You can try 2N2222 or any other equivalent transistor, they all will work.

Reply
Stan
October 1, 2023 • 3 years ago #145649

couple more questions about the Voltage regulator circuit.

1) what is a 4V7 zener? 4V, 7V 4.7V? or other?

2) there are 2 led’s shown in series with the gates on BC547. are they required? this will be in a box and used remotely. do they have a troubleshooting purpose?

Reply
Stan
October 1, 2023 • 3 years ago #145655

one more question about the voltage regulator, is this what you mean by IC741?
https://www.digikey.com/en/products/detail/texas-instruments/TPIC74100QPWPRQ1/1531097

if so, is there a through hole substitute?

Reply
SwagatamAdmin
October 1, 2023 • 3 years ago #145662

741 is an IC, not a voltage regulator, if you are not familiar with 741 IC then I am afraid you should not try this circuit, chances are you might not succeed.
IC 741 and LM393 comparison compressed

Reply
Stan
October 2, 2023 • 3 years ago #145671

Sorry, I did not recognize the Op-Amp symbol. The regulator I found is Also an IC. Searching on Both digikey and Mouser for IC741 resulted in nothing, so I went the hard way (drilling down) and had to choose a category. Voltage Regulator was just a guess. The wiring for the OP-Amp seams straight forward (other than the LED’s,) and i plan to use a socket so as to not damage the Chip when soldering, so i’ll take my chances. I’m just an electrician with electronics hobby experience not an electronics engineer. Sorry for the dumb questions, but I need this Arduino controlled inverter for one of my other hobbys (Astrophotography) .

Reply
SwagatamAdmin
October 2, 2023 • 3 years ago #145691

No problem, you can go ahead and build this project. The op amp output voltage control might not be necessary since the Arduino is generating a calculated fixed PWM, so the output voltage should be pretty constant.

Reply
SwagatamAdmin
October 1, 2023 • 3 years ago #145654

1) 4V7 = 4.7V
2) Yes they are required, since the LEDs prevent the leakage or the offset voltage from 741 output to reach the base of the BC547 transistors, thus preventing false switching of the transistors..

Reply
Stan
October 2, 2023 • 3 years ago #145670

are they just standard 12V(forward Voltage) Red LED’s?

Reply
SwagatamAdmin
October 2, 2023 • 3 years ago #145684

They are standard 3.3 V, 20 mA LEDs.

Reply
View Older Comments

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (134)
  • Automation Projects (18)
  • Automobile Electronics (104)
  • Battery Charger Circuits (90)
  • Datasheets and Components (109)
  • Electronics Theory (150)
  • Energy from Magnets and Earth (41)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (100)
  • Lamps and Lights (163)
  • Meters and Testers (72)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (30)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Security and Alarm (65)
  • Sensors and Detectors (107)
  • SMPS and Converters (46)
  • Solar Controller Circuits (62)
  • Temperature Controllers (44)
  • Timer and Delay Relay (50)
  • Voltage Control and Protection (44)
  • Water Controller (37)
  • Wireless Circuits (31)



Circuit Simulator

circuit simulator image



Subscribe to get New Circuits in your Email



Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |



Recent Comments

  • Swagatam on Electronic Circuit Projects, Tutorials, and Practical Engineering Solutions
  • Swagatam on Electronic Circuit Projects, Tutorials, and Practical Engineering Solutions
  • Swagatam on 4 Simple Battery Desulfator Circuits Explored
  • Swagatam on 4 Simple Battery Desulfator Circuits Explored
  • Swagatam on PIR Controlled Solar Garden Light Circuit

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin

© 2026 · Swagatam Innovations