Adaptable 12vDC/220vAC Pure Sinewave Inverter

Picture of Adaptable 12vDC/220vAC Pure Sinewave Inverter
Here is a very simple pure sinewave inverter based on the microntoller "PIC 16F628A", "don't freak out !", NO it is not difficult to use microntollers, actually it could not be any easier than this.

For those wondering, Yes I myself designed the circuit concept, schematic and components but had to hire a programmer to write the code since I have no idea how to write software programming, I even paid him money to do this job since no one works for free these days, probably if he see this instructable he would be laughing at me on how I gave everything for free here :-/

The principal used for creating the sinewave:
Most hard work in this circuit is done by the 16F628A chip itself, where it divides the half wave into small segments generating PWM train of pulses to create each half wave as shown in the pic, generated oscillation then go to get amplified by the 4 transistors Q1,Q2,Q3 and Q4 where they feed the power stage to drive the power transistors. Can't be much simpler than that !

There are 2 options to program the 16F628A:
1- Most of the electronic parts selling shops do this service for you for an additional 3$ cost, where you take the program which is a "Inverter.HEX" file in our case, written on a disk to the shop and they will hand you an already programed 16F628A.

2- If you're an electronic hobbiest I suggest you buy your own programing device (I bought mine for 22$) and experiment with it because the microcontroller applications that can be built are endless. I bought the cheapest / smallest USB one which is a DIY K128 it came along with a CD containing the MicroBurn software "older versions known as MicroPro" and a driver for your computer, after setting up the driver and operating the thing, it programed the 16F628A IC in 10 seconds !
Here is a link to see how the programmer looks like.

Note: Both 16F628 and 16F628A will work, the difference is that the 'A' has more memory capacity, but both work the same.

The filter:
The 2.2 uF capacitor which is the filter is a very very important part of this design, without it you'll never get a pure sine wave.
I have included 2 screen shots of the oscilloscope (with-filter and without-filter) so you can see the difference and importance of this capacitor.

Other notes:
- Included is the movie file "IMG_0690.MOV" in case you encounter any problem and need to see the wave form on pins 11 and 12 of the 16F628A how it looks like.

- The PIC16F628A is so sesitive to static, if you're sitting on a plastic chair never touch the IC's pins with your hand.

- You can build bigger versions of this inverter up to 5000w, to see what needs to be done on the power stage please see details on my other instructable here

- Heat sinks are required to cool the power transistors they should be big enough to cool the transistors, they are separate and should NOT touch each other.

- Wiring connections marked in dark black on the power stage section should be thick enough to handle the big amps drain from the batteries.

- A cooling fan will be needed to reduce heat off the heat sinks and transformer.

- Be cautious when building this circuit it involves high voltage which is lethal, any part you touch when the circuit is ON could give you a nasty painful jolt, specially the heat-sinks, never touch them when the circuit is on to see if the transistors are hot.

Do not forget to rate this instructbale with 5 stars "of course if you like it and appreciate the effort done" and also click the "follow me" button to keep updated of future instructables and updates that I do.

We need to get this inverter to perfection by adding some more options to it like:
- Low DC Battery voltage detection to trigger a buzzer and a to auto-stop oscillation at some point.
- Heat detection to trigger a fan ON
- Battery level indicator 3 LEDs (High-Medium-Low) and to trigger charger ON
We'll need some help to code the above..
so any suggestions, help in coding or design on this project to make it better are very welcomed so send your thoughts.
1-40 of 401Next »
obagi2 days ago

hi can i buy the IC programmed from you ?

my email

thank you

Lubous16 days ago

Hi Nickk!

Can I use IGBT? (Euptec IGBT BSM200GA 120DN2SE3256)

What are the possible adjustment of the excitation transistors.

Thank you for your response.

slimp22 days ago
alfathia1 month ago

hello nikky

hw can i get this pure sinewave circuit diagram with the code please


maclee4real1 month ago

hello Nickk, thanks for the wonderful topic, please is there a way you can upload the the code in .c language?

please i know it will make us understand this more and to modify the project and add more function to it. For educational purpose.

Is there a way you can ask the
programmer for the source code, i think we can use it to modify this
design, like adding an LCD, and charger to the microcontroller.



creativeasad9 months ago
Hi nick!, good day.
want to ask the logic that you used in the PIC uC.
means its creating a pulse with different width each time but for how much milliseconds.
nickk (author)  creativeasad9 months ago
Hello creativeasad,
As I mentioned before, I'm not good at coding and had to get help from a coder to do the programing part. I really don't have much details on this part.

Is there a way you can ask the programmer for the source code, i think we can use it to modify this design, like adding an LCD, and charger to the microcontroller.


maclee4real1 month ago

hello Nickk, thanks for the wonderful topic, please is there a way you can upload the the code in .c language?

please i know it will make us understand this more and to modify the project and add more function to it. For educational purpose.


abuhafss1 month ago

Hi Nickk

Pleased to see your simple design, and really amazed & appreciate your sharing.

I just need your confirmation, for a 1000W & 1500W do we need 2 x 12V batteries and 12-0-12 transformer?

nickk (author)  abuhafss1 month ago

I suggest you build my other inverter, it is 100% heavy duty & reliable, better than this one.

abuhafss nickk1 month ago

Actually, my requirement is 1000W and I want use it at my farm where there is no power. I plan to set-up a charging system in my car for an extra battery, which I will use with this inverter.

henry_oshomah2 months ago
henry_oshomah2 months ago
acky22 months ago

Hi every one!

First special thanks to nickk for his all wonderful articles specially on power electronics, I want to use the same nickk's circuit for my inverter, but am using pic 16F877A & 20Mhz crystal can any one help me with source codes.

My email is, hope to here from you soon.


What is the rating of transformer is it 12-0-12 or 6-0-6 .? Thanks in advannce

mpavlovič43 months ago

hello nickk and others!
Can anybody please tell me what kind of transformer should I use?
I tried with toroidal transformer, but it does not work.
Thank you for your answers!

ggadogbe4 months ago
Hi nikk thank for helping some of us for opening our eyes in power electronic. I want to ask if can i use IR2110 gates driver with a mosfets and drive in H-BRIDGE with PIC16f628A have a pure sine wave if am wrong let me know pls is my email:
ggadogbe4 months ago
Yes this what i want. Hmmmm the circuit look simple and let me ask why did pic did not have mosfets as it out put. I hope it works hmmm.
twyeth4 months ago

hi nick

ive built the circuit but the only piece thats got me stuck is x1 on your diagrams, i cant work out what values or anything is, novice electronics builder:)

bisudw4 months ago

can i do this to get 110v ac from 6v 4.5ah battery???

FATEHROMIA4 months ago

very good

dnc400854 months ago

Great Instructable, very informative. I would also like to take a look at the source code if possible as I would like to port it to an AVR

arunvtkl4 months ago

hi nickk plese give 50 hz sinwave Program in ASM COD

i using MPLAB IDE

scinova5 months ago

Hi Nickk,

Could you post the source code?

kjunaid5 months ago
Hello Nickk..!
I have been designing same project with Feedback Control of Output Voltage, one thing i want to ask that what is actual purpose of Driver Transistors, I had tried to test the circuit which i designed without Driver Transistors and feeding the pulse directly to 2N3773 which resulted as my MicroController got burnt.. I used 2N3773 instead of MOSFET
ssrivastava115 months ago

what all changes i need to do in the current circuit to make it a 2000 watt inverter??

is it just the transformer or any additional changes required..

if only transformer change is required for it can you please suggest me the rating of the transformer

with regards

Shubham Srivastava

zilent16 months ago

Hi nickk,

I've been looking at your schematics and I'm wondering, would it be possible to use multiple smaller transformers with their outputs in parallel using this design?

npyasith6 months ago

Hey nick,

I built this circuit but I keep getting high voltages instead of 230V. I used the transistor 3055 instead of 3773. Is this the problem???

walaa877 months ago
hello Nick,
Can you give me the best of him did you come on this circuit using (irf3205) Please,
walaa87 walaa877 months ago
1000w , 50HZ
wissydebest7 months ago
hello Nick, can i use PIC16F648A in place of PICF628A BECAUSE I CAN'T FIND PIC16F628A?
wissydebest7 months ago
thank you Nick, your circuit is good, please i can not find the optocoupler MCT2E and i used 4N35 but it is not detecting any overload, in fact the circuit shows overload even when the 4N35 is removed, please help me
the1cyrus7 months ago
Could you provide the source code?
asheikh78 months ago
Hye nick i really like your work but can you please verify me that how much voltage should i receive at the collector of 2N3773??? I am receiving 2.5 volt at the output of PIC is that correct?????
Please reply asap!
Aryan Sheikh.
kasamiko8 months ago
Hi nickk,

Do you have a hex for 60HZ output?

nguyenson3189 months ago
When plugged into the device can be reduced voltage you?
tramas9 months ago
Hi Nickk,
I would like to build a 1000 watt inverter 12-220 v 50 hz.
have I to use a transformer 6 +6 -> 220 with what power?
By this power of the schema components are fine?

Thank you and congratulations for the project
Sorry for my english........
maclee4real9 months ago
Hi Hickk, I have the Arduino R3 uno board, i know its possible to use it and program the PIC, but here you put just the hex file, which is very difficult to understand. can u please put to code or sketch.
thanks alot
THE PROJECT IS GREAT, ,i program with pic in mikro C but i would like to see the code of this project please.
1-40 of 401Next »