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.
X ??? 20hZ or 20mhz ??
<p>Hi Nick,</p><p>I really want to build your inverter. I do not have the PIC16F628A chip. I do however have a PIC16LF872-I, can I use this? I do not know much about microprocessors? Thanks</p>
Visit www.alldatasheet.com download the internal specification of both ICs compare and see if the have similar configuration
<p>got it work but i am having some issues the worst is the amp draw its like 6 amp<br>is there any fuirrite core try or help ?</p>
<p>have source code?</p>
<p>what's outuput frequency? i need 60Hz</p>
<p>Hi Nick.</p><p>I've built an inverter based on your designs and the output is a 51Hz 230V sine wave. The problem I'm sitting with is that the power stage draws too much current and drains my DC power source very quickly. When the inverter is switching (no 220VAC load connected to transformer) my 12V supply is sourcing 8Adc to the transformer. Is this normal for your design? Any sugestions?</p>
Hello sorawist please contact me via facebook boonserm chaiwong and facebook.com/radiorepair. the language I'm stronger
Thanks,and ican use mosfet for that;which are a good
Hello Dear,I want to have a circuit diagram of power inverter mosfet supported 2TV,4bulbs,1refregerator,1woofer<br>If you have ,please send us a link or a diagram<br>Thanks sir.
If possible CT is 12-0-12<br>
This is my email :herrylalarakoto8@gmail.com
This is my email :herrylalarakoto8@gmail.com
<p>I few years that do not program pics ago, but after asking for the source code, I remembered that there is a small software we can see the source code, the software is called winpicpro, I attached the link plus a file you need to run it.<br> <a href="https://www.mediafire.com/#hhn2olmmlgdsd" rel="nofollow">https://www.mediafire.com/#hhn2olmmlgdsd</a></p><p><a href="http://www.mediafire.com/download/pcjk9655c6688kq/WinPicProg.exe" rel="nofollow">http://www.mediafire.com/download/pcjk9655c6688kq/...</a></p><p>http://www.mediafire.com/download/5ztftcylausanlu/Inverter.asm</p>
<p>So is this the source code?</p>
<p>so is called an assembler programming language for the pics, avr, etc. There are several types of programming languages</p>
<p>will compile with MPASM and results in an asm file. Also you can create programs from the languages in C</p>
<p>please i need the source code.thank's pacocable@hotmail.com i need for 50hz, thnak very much</p>
<p>Guys I really do not have the source code.</p>
<p>will compile with MPASM and results in an asm file. Also you can create programs from the languages in C</p>
<p>will compile with MPASM and results in an asm file. Also you can create programs from the languages in C</p>
<p>at these points should measure 50 hz ?? or how many hz ?? thank you very much. I've ridden only part of the circuit relating to the pic as you can see in the scheme to test and then add the transistors</p>
<p>on pin 12 and 13 pic measuring frequency is 50 Hz, is that correct?</p>
<p>yes 50Hz is correct, you can see it in one of the pics: 52Hz</p>
<p>Hello Nick, thank you for a great work in this circuit. Can you please send me the code to make some modifications and get it back for the community. My email joelricci76@yahoo.com.</p><p>Thanks again :0)</p>
<p>Hi Nick!</p><p>Thanks for sharing such a wonderful circuit but I am seriously confused about the size of transformer. Are you using a normal Soft Iron core transformer or a Ferrite core transformer? If you are using soft iron core transformer then I think a terrible effect by the name of 'core saturation' can occur which might cause a huge damage. Please do clarify. </p><p>Thanks!</p>
Hi tambi007,<br>This is a normal iron core trans.<br>Transformer saturation should not happen as long as you're using the correct size for the setup, if you use a small trans probably yes this may occur.
<p>i bread boarded the pic and need to know how to wire the outputs to 2 igbt half bridges to chop 320vdc from my solar into 220vac@50hz</p>
<p>i bread boarded the pic and need to know how to wire the outputs to 2 igbt half bridges to chop 320vdc from my solar into 220vac@50hz</p>
<p>i bread boarded the pic and need to know how to wire the outputs to 2 igbt half bridges to chop 320vdc from my solar into 220vac@50hz</p>
<p>Hi. Thanks for your effort. If you can send me the source code, I'll do some modification modification to it to add battery low alarm etc.. You can mail me at fmulder25@gmail.com</p><p>And another hint, for everybody who wants to do the pcb's yourself, use photoshop to open the jpg files and then rescale to 34.266% to print.</p>
<p>thanks for the scaling factor and saving me 30 sheets of paper! beers to you friend!</p>
Let me ask the .her Taking A link cod . Thank you
<p>Hi Nick. May I please get the code want to add some more lines into the code like I want to add a solar controller with it and measure voltages etc</p>
<p>HEX file is wrong. Circuit is inverting square wave and almost 110Hz.</p>
<p>Included a pic from my oscilloscope, u can see clearly the sinewave, why are you misleading and saying 'is wrong'.</p>
<p>You can't ignore the filter. It is what stabilizes the circuit to 50Hz</p>
<p>thanks .</p>
<p>Dear Nick </p><p>Thank you share this information</p><p>am software programmer and also Atmel micro controller programming with full developing environment. don't worry about write a code, a programmed the mcu. I can help you from here. but i need your help to how to design the inverter part i need 3-5KVA inverter </p>
<p>Thank you Nick, it was helpful</p><p>.</p>
<p>Hello nick, i have made inverter this. But inverter it produces frequency 109 hz in voltage 24 volt, how will get frequency 50-60 hz? thank you.</p>
<p>hello nick, i will like to add more program line in the code to display, over heat, battery level etc on 2 x 16 display. if i can get the code.</p>
<p>sir i need a 50hz code of pic 16f628a could u plz send me at 1tahahassan1@gmail.com?</p>
<p>IT IS 60HZ SIR?,IF IS NOT PLLEASE SENT ME THE CODE FOR 60HZ</p><p>THANK YOU SIR!</p><p>chancom53@gmail.com</p>
Hello Nick, I lukman from indonesia , i has succeeded in making inverter this .But why when i pairs of capacitor filter voltage down ? i wore 2.2 oof / 400 volt . Capacitor a fan , whether it will in dressing with capacitor other kinds ? thank you for info you . Sorry english is not good , i wore a dictionary . my gmail lalukman90@gmail.com
<p>poderia enviar o c&oacute;digo fonte, edil.lsandrade@gmai.com</p>
<p>Please sent me the code (for 50hz).</p><p>milanerg@gmail.com</p><p>tnx</p><p>TNH</p>

About This Instructable




More by Nick_Zouein:Aux Input for BMW 325i Business CDAdaptable 12vDC/220vAC Pure Sinewave InverterTransforming a 300W Sinewave DC/AC mini inverter to a 5000W monster
Add instructable to: