Home » 12V DC to 220 AC Power Converters » Sinewave UPS using PIC16F72
Sinewave UPS using PIC16F72

Sinewave UPS using PIC16F72

The proposed sinewave inverter UPS circuit is built using PIC16F72 microcontroller, some passive electronic components and associated power devices.

Data provided by: Mr. hisham bahaa-aldeen

Main Features:

The main technical features of the discussed PIC16F72 sinewave inverter may be evaluated from the following data:

Power output (625/800va) fully customization and can be upgraded to other desired levels.
Battery 12V/200AH
Inverter Output Volt : 230v (+2%)
Inverter Output Frequency : 50Hz
Inverter Output Waveform : PWM Modulated Sinewave
Harmonic Distortion : less  than 3%
Crest Factor : less than 4:1
Inverter efficiency : 90% For 24v System, around 85% with 12v System
Audible Noise : less 60db At 1-meter

Inverter Protection Features

Low-battery Shut-down
Overload Shut-down
Output Short Circuit Shut-down

Low-battery Detection and Shutdown Feature

Beep Start initiated at 10.5v (beep At Every 3-sec)
Inverter Shut-down at around 10v (5 pulses of beep in every 2-sec)
Over Load : Beep Initiated at 120% Load (beep at the rate of 2-sec)
Inverter Shut-down at 130% Overload (5 pulses of beep in every 2-sec)

LED Indicators are provided for the following:

Inverter On
Low-battery - Flashing in Low battery mode with Alarm
Solid ON During Cut-OFF
Over Load - Flashing at Overload cut-off with Alarm
Solid ON During Cut-OFF
Charging mode - Flashing at Charging mode
Solid ON During Absorption
Mains Indication - LED On

Circuit Specifications

8-bit Microcontroller Based Control Circuit
H-bridge Inverter Topology
Mosfet Switching Fault Detection
Charging Algorithm : Mosfet PWM based switch mode Charger Controller 5-amp/15-amp
2-step Charging Step-1: Boost Mode (led Flash)
Step-2: Absorption Mode (led On)
DC Fan initialization for Internal Cooling During Charging/inv Operation

Circuit Diagram:

PIC sine eave inverter circuit


PIC Codes can be viewed HERE

PCB details are provided HERE

The following explanation provides the details of the various circuit stages involved in the design:


You can also refer to this very easy to build pure sine wave Arduino based inverter circuit.

In Inverter Mode

As soon as mains fails, the battery logic is detected at pin#22 of the IC which instantly prompts the controller section to switch the system in the inverter/battery mode.

In this mode the controller begins generating the required PWMs via its pin#13 (ccp out), however the PWM generation rate is implemented only after the controller confirms the logic level at pin#16 (INV/UPS switch).

If a high logic is detected at this pin (INV mode) the controller initiates a fully modulated duty cycle which is around 70%, and in case of a low logic at the indicated pinout of the IC, then the controller may be prompted to generate burst of PWMs ranging from 1% to 70% at a rate of 250mS period, which is termed as soft delay output while in the UPS mode.

The controller simultaneously with the PWMs also generates a "channel select" logic through pin#13 of the PIC which is further applied to pin#8 of the IC CD4081.

Throughout initial time period of the pulse (i.e 10ms) the pin12 of the PWM controller is rendered high such that the PWM can be obtained from pin10 of CD4081 exclusively and after 10mS, pin14 of controller is logic high and the PWM is accessible from pin11 of CD4081, as a result using this method a pair of anti-phased PWM becomes accessible to switch on the MOSFETs.

Aside from that a high logic (5V) becomes accessible from pin11 of the PWM controller, this pin turns high each time inverter is ON and ends up being low whenever inverter is OFF. This high logic is applied to pin10 of each the MOSFET drivers U1 and U2, (HI pin) to activate the high side MOSFETs of the two the mosfet banks.

For upgrading the proposed microcontrollor Sinewave UPS, the following data may be used and implemented appropriately.


PIC16F72 component details

The following data supplies the full transformer winding details:

transformer winding details for sinewave ups using PIC16F72

Feedback from Mr. Hisham:

Hi mr swagatam ,how are you?

I want to tell you that pure sine wave inverter schematic have some mistakes, 220uf bootstrap capacitor should be replaced with a (22uf or 47uf or 68uf),,,a 22uf capacitors which is connected between pin 1 and pin2 of the 2's ir2110 is wrong and should be removed, also a hex code called eletech. Hex should not be use cause its make inverter shutdown after 15 seconds with low battery led and buzer beeps, if you have big dc fan so the transistors should be replaced with a higher current,for mosfets safety a 7812 regulator is recommended to be connected to ir2110...also there's d14,d15 and d16 should not be connected to ground.

I have tested this inverter and its really pure sine wave,i have run a washing machine and its running silently without any noise, i have connected a 220nf capcitor in the ouput instead of 2.5uf, refrigerator is working too, i will share some pictures soon.

Best regards

tested built prototype for sinewave UPS using PIC16F72

The schematic discussed in the above article was tested and modified with a few appropriate corrections by Mr. Hisham, as shown in the following images, viewers can refer to these for improving the performance of the same:

Now let us study how the mosfet switching stage can be built through the following explanation.


mosfet switching stage


MOSFET Switching:

Check with MOSFET switching circuit diagram below:

In this case U1 (IR2110) and U2 (IR2110) high side / low side mosfet driver are employed, check with data sheet of this IC to understand more. In this the two MOSFET banks with high side and low side MOSFETs are intended for transformer’s primary side switching.

In this case we are discussing the functioning of bank (applying IC U1) only since the supplementary bank driving does not differ from from each other.

As soon as the inverter is ON the controller renders the pin10 of U1 is logic high which subsequently activates the high side MOSFETs (M1 - M4) ON, PWM for channel-1 from pin10 of CD4081 is applied to pin12 of the drver IC (U1) and likewise it is administered to the base of Q1 via R25.

While the PWM is logic high the pin12 of U1 is also logic high and triggers the low side MOSFETs of bank 1(M9 - M12), alternately it launches the transistor

Q1 which correspondingly renders the pin10 voltage of U1 logic low, thereupon turning OFF the high side MOSFETs (M1 - M4).

Therefore it implies that by default the high logic from pin11 of the microcontroller gets switched ON for the high side MOSFETs among the two the mosfet arrays, and while the associated PWM is high the low side MOSFETs are turned ON and the high side MOSFETs are switched OFF, and through this way the switching sequence keeps repeating.

Mosfet Switching Protection

Pin11 of U1 can be used for executing the hardware locking mechanism of each of the drivers units.

By standard fixed mode this pin may be seen fixed with a low logic, but whenever under any circumstance the low side MOFET switching fails to initiate (let's assume through o/p short circuit or erroneous pulse generation at the output), the VDS voltage of low side MOSFETs can be expected to shoot up which immediately causes the output pin1 of comparator (U4) to go high and become latched with the help of D27, and render pin11 of U1 and U2 at high logic, and thereby toggle OFF the two the MOSFET driver stages effectively, preventing the MOSFETs from getting burnt and damaged.

Pin6 and pin9 is of +VCC of the IC (+5V), pin3 is of +12V for MOSFET gate drive supply, pin7 is the high side MOSFET gate drive, pin5 is the high side MOSFET receiving route, pin1 is the low side MOSFET drive, and pin2 is the low side MOSFET receiving path. pin13 is the ground of the IC (U1).


While the controller operates in the inverter-mode it repeatedly monitors the voltage at its pin4 (BATT SENSE), pin7 (OVER LOAD sense) and pin2 (AC MAIN sense).

Should the voltage at pin4 rise above 2.6V the controller would take no notice of it and may be seen escaping to supplementary sensing-mode, but as soon as the voltage here drops to around 2.5V the controller stage would prohibit its functioning at this point, switching OFF the inverter-mode such that the low battery LED turns ON and prompting the buzzer to beep.


Over load protection is a mandatory functionality implemented in most inverter systems. Up here, in order to cut-of the inverter in the event the load goes beyond the safe load specifications, the battery current is first detected across the negative line (i.e the voltage drop across the fuse and negative path of the low side MOSFET bank) and this greatly reduced voltage (in mV) is proportionately intensified by the comparator U5 (composing of pins12,13 1nd 14) (make reference to circuit diagram).

This amplified voltage output from pin14 of comparator (U5) is rigged as inverting amplifier and applied to pin7 of the microcontroller.

The software compares the voltage with the reference, which is for this particular pin is 2V. Quite as talked over previously the controller senses the voltages in this pin besides operating the system in the inverter-mode, every time the load current augments the voltage at this pin builds up.

Whenever the voltage on pin7 of the controller IC is above 2V the process shuts off the inverter and switches to overload mode, shutting off the inverter, turning ON the overload LED and causing the buzzer to beep, which after 9-beeps prompts the inverter to switched-ON again, inspecting the voltage at pin7 for a second time, suppose in case the controller identifies pin7 voltage to be below 2V, it then operates the inverter on normal mode, other wise it disconnects the inverter yet again, and this process is known as the auto-reset-mode.

Like in this article we articulated beforehand that when in inverter-mode, the controller reads the voltage at its pin4 (for Low-batt), pin7 (for overload) and pin2 for AC main voltage status. We comprehend that the system may be functioning in twin mode (a) UPS mode,(b) inverter mode.

So before inspecting the pin2 voltage of PIC the routine before anything else confirms at what mode the unit may be working by sensing the high/lo logic at pin16 of the PIC.

Inverter to mains changeover (INV-MODE):

In this particular mode as soon as the AC main voltage is detected to be in the vicinity of 140V AC, the changeover action can be seen implemented, this voltage threshold is pre-settable by the user, implies that in cases where the pin2 voltage is above 0.9V, the controller IC may shut off the inverter and switch to mains-on mode, where the system examines the pin2 voltage to test the AC mains failure and maintain the charging process, which in this article we will be explaining later on.

Inverter to Battery changeover (UPS-MODE):

Within this setting each time the AC main voltage is in the vicinity of 190V AC the changeover may be seen enforcing to battery mode, this voltage threshold is also software pre-setteble, meaning when ever the pin2 volage is above 1.22V the controller may be expected to switch ON the inverter and switched to battery routine wherein the system inspects the pin2 voltage to verifies the AC mains absence and operates the charging schedule which we would be discussing further down in the article.


In the course of MAINs ON Battery charging may be seen initiated. As we may understand while in battery charging mode the system may be functioning using the SMPS technique, let us now understand the working principle behind it.

To charge the battery the output circuit (MOSFET and Inverter transformer) becomes effective in the form of a boost converter.

In this case all the low side MOSFETs of the two the mosfet arrays work in sync as a switching stage while the primary of the inverter transformer behave as an inductor.

As soon as all of the low side MOSFETs are switched-ON the electric power gets accumulated in the primary section of transformer, and as soon as the MOSFETs are OFF this accumulated electric power is rectified by the in-build diode inside the MOSFETs and the DC is kicked back to battery pack, the measure of this boosted voltage would depend on the ON-time of the low side MOSFETs or simply mark/space ratio of the duty cycle used for the charging process.


While the equipment may be conducting in the mains-on mode, the charging PWM (from pin13 of micro) is progressively augmented from 1% to highest specification, in case the PWM raises the DC voltage to the battery, the battery voltage too increases which results in a surge in the battery charging current.

The battery charging current is monitored across the DC fuse and negative rail of the PCB and the voltage is additionally intensified by the amplifier U5 (pin8, ppin9 and pin10 of the comparator) this amplified voltage or detected current are applied to the pin5 of microcontroller.

This pin voltage is scheduled in software in the form of 1V, as soon as the voltage in this pin is rises above 1V the controller may be seen restricting the PWM duty cycle until finally it's pulled down to below 1V, assuming the voltage on this pin is decreased to below 1V the controller would instantly begin improving the full PWM output, and the process may be expected to go on in this manner with the controller upholding the voltage on this pin at 1V and consequently the charging current limit.


Construct the card thereby confirming each and every wiring, this includes LED connectivity, ON/OFF switch, feedback via inverter transformer, 6-volt mains sense to CN5, -VE of battery to card, +VE of battery to large heatsink.

Initially do not plug the transformer primary to the pair of small heat sinks.

Plug in battery +ve wire to PCB via MCB and 50-amp ammeter.

Prior to proceeding for the recommended testings be sure to check the +VCC voltage at the pins of

U1 - U5 in the following sequence.

U1:pin#8 and 9: +5V, pin#3: +12V, pin#6: +12V,
U2:pin#8 and 9: +5V, pin#3: +12V, pin6: +12V,
U3: pin14: +5V, U4: pin20: +5V, pin1:+5V, U5: pin4:+5V.

1) Power Up the battery MCB and check the ammeter and also be certain it doesn't jump beyond 1-amp. If the ampere shoots then remove U1 and U2 briefly and switch ON the MCB again.

2) Power ON by toggling the given ON/OFF switch of the inverter and check whether or not the relay clicks ON, illuminating the "INV" LED. If it doesn't then check the voltage at pin#18 of the PIC which is supposed to be 5V. If this is absent check components R37 and Q5, one of this may be faulty or incorrectly connected. If you find the "INV" LED not switching ON, check if the voltage at pin#25 of the PIC is 5V or not.

If the above situation is seen to be normally executing, go to the next step as described below.

3) Using an oscilloscope test pin#13 of the PIC by alternately switching ON/OFF the inverter switch, you can expect to see a well modulated PWM signal appearing at this pinout each time the inverter mains input is switched OFF, if not then you can assume the PIC to be faulty, coding not implemented correctly or the IC is badly soldered or inserted in its socket.

If you succeed in getting the expected modified PWM feed over this pin, go to pin#12/in#14 of the IC and check the availability of 50Hz frequency on these pins, if not would indicate some fault in the PIC configuration, remove and replace it. If you are to get affirmative response on these pins, go to the next step as explained below.

4) The next step would be to test pin#10/pin#12 of the IC U3 (CD4081) for the modulated PWMs which are finally integrated with the mosfet driver stages U1 and U2. Additionally you would be also required to check the potential differences at pin#9/pin#12 which is supposed to be at 3.4V approximately, and at pin#8/pin#13 may be verified to be at 2.5V. Similarly verify pin#10/11 to be at 1.68V.

In case you fail to identify the modulated PWM across the CD4081 output pins, then you would want to verify the tracks terminating to the relevant pins of the IC CD4081 from the PIC, which could be broken or somehow the obstructing the PWMs from the reaching U3.
If all is fine, let's move to the next level.

5) Next, attach the CRO with U1 gate, toggle the inverter ON/OFF and as done above verify the PWMs on this spot which are M1 and M4, and also the gates M9, M12, however don't be surprised if the PWM switching are seen out of phase M9/M12 as compared to M1/M4, that's normal.

If the PWMs are entirely absent on these gates, then you can check pin#11 of U1 which is expected to be low, and if found high would indicate that U1 may be running in the shut-down mode.

To confirm this situation check voltage at pin#2 of U5 which could be at 2.5V, and identically pin#3 of U5 could be at 0V or under 1V, if it's detected to be below 1V, then proceed and check R47/R48, but if the voltage is found to be above 2.5V then check D11, D9, along with mosfets M9, M12 and the relevant components around it to troubleshoot the persisting issue, until corrected satisfactorily..

In case where the pin#11 of U1 is detected low and still you are unable to find the PWMs from pin#1, and pin#7 of U1, then it's time to replace IC U1, which would possibly rectify the issue, which will prompt us to move to the next level below.

6) Now repeat the procedures exactly as done above for the gates of the mosfet array M5/M18 and M13/M16, the troubleshooting would be exactly as explained but with reference to U2 and the other complementary stages which may be associated with these mosfets

7) After the above testing and confirmation are completed, now it's finally time to hook up the transformer primary with the mosfet heatsinks as indicated in the sinewave UPS circuit diagram. Once this is configured, switch ON the inverter switch, adjust preset VR1 to hopefully access the required 220V regulated, constant sinewave AC across the output terminal of the inverter.
If you find the output to be exceeding this value or below this value, and void of the expected regulation, you may look for the following issues:

If the output is much higher, check voltage at pin#3 of the PIC which is supposed to be at 2.5V, if not then verify the feedback signal derived from the inverter transformer to connector CN4, further check voltage across C40, and confirm the correctness of the components R58, VR1 etc. until the issue is rectified.

8) After this attach an appropriate load to the inverter, and check the regulation, a 2 to 3 percent falter can eb considered normal, if still you fail a regulation, then check diodes D23----D26, you can expect one of these to be faulty or you may also try replacing C39, C40 for correcting the issue.

9) Once the above procedures are successfully completed, you can carry on by checking the LOW-BATT functioning. To visualize this try short circuiting R54 with the help of a pair of tweezers from the component side, which should instantly prompt the LOW-Batt LED to illuminate and the buzzer to beep for a period of around 9 seconds at the rate of  a beep per second approximately.

In case the above does not happen, you may check pin#4 of the PIC, which should be normally at above 2.5V, and anything lower than this triggers the low batt warning indication. If an irrelevant voltage level is detected here check whether or not R55 and R54 are in a correct working order.

10) Next up it would be the overload tripping feature which would need to be confirmed. For testing you can select a 400 Wait incandescent bulb as the load and connect it with the inverter output. Adjusting VR2 the overload tripping should initiate at some point on the preset rotation.

To be precise, check the voltage at pin#7 of the PIC where under correct load conditions the voltage will be over 2V, and anything above this level will trigger overload cut-off action.

With a sample 400 watt, try varying the preset and try forcing an overload cut -off to initiate, if this does not happen, verify voltage at pin#14 of U5 (LM324) which is supposed to be higher than 2.2V, if not then check R48, R49, R50 and also R33 any of these could be malfunctioning, if everything's correct here simply replace U5 with a new IC and check the response.

Alternatively you can also try increasing the R48 value to around 470K or 560k or 680K etc and check if it helps solving the issue.

11) When the assessment of inverter processing is finished, experiment with the mains changeover.Keep the mode switch in inverter mode (keep CN1 open) switch-ON the inverter, hook up the mains wire to the variac, step up the variac voltage to 140V AC and check the inv to mains changeover triggering occurs or not. If you find no changeover in that case confirm the voltage at pin2 of microcontroller, it needs to be > 1.24V, in case the voltage is smaller than 1.24V then inspect the sensing transformer voltage (6V AC at its secondary) or take a look at the components R57,R56.

Now that the changeover shows up scale down the variac voltage to below 90V and examine the mains-to-inverter changeover action is established or not. The changeover ought to happen since now the voltage at pin2 of microcontroller is less than 1V.

12) Soon after the above assessment is completed, experiment with the mains-changeover in the UPS mode. Enabling the mode-switch in the UPS mode (keep CN1 shorted) start the inverter, link up the mains wire to the variac, increment the variac voltage to around 190V AC and observe the UPS-to-mains changeover strikes or not. Should there be no changeover action then simply take a look at the voltage at pin2 of microcontroller, it needs to be over 1.66V, as long as the voltage is lower than 1.66V then simply confirm the sensing transformer voltage (6V AC at its secondary) or perhaps inspect the elements R57,R56.

Right after the changeover pops up, scale back the variac voltage to 180V and find out whether the mains-to-UPS changeover comes about or not. The changeover ought to strike since now the voltage at pin2 of microcontroller could be witnessed to be over 1.5V.

13) Eventually take a look at the customized charging of the attached battery. Hold the mode switch in the inverter-mode, administer mains and step up the variac voltage to 230V AC, and determine the charging current which should rise smoothly in ammeter.

Fiddle with the charging current by varying VR3, so that the current variation could be witnessed varying in the middle of around 5-amp to 12/15-amp.

Just in case the charging current is seen to be much higher and not in a position to be scaled down at preferred level then you may try increasing the value of R51 to 100k and/or if still that does not improve the charging current to expected level then perhaps you can try decreasing the value of R51 to 22K, please bear in mind that once the sensed equivalent voltage at pin5 of microcontroller becomes at 2.5V the microcontroller may be expected to regulate the PWM and consequently the charging current.

In the course of the charging mode remember that, precisely the lower branch of MOSFETs (M6 -M12 / M13 - M16) are switching @8kHZ while the upper branch of MOSFETs are OFF.

14) Additionally you can inspect the operation of the FAN, FAN is ON each time the inverter is ON, and FAN could be seen switched OFF whenever the inverter is OFF. In a similar manner FAN is ON as soon as Charging is ON and FAN will be OFF when charging is OFF


About the Author

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials. If you have any circuit related query, you may interact through comments, I'll be most happy to help!

308 thoughts on “Sinewave UPS using PIC16F72”

  1. thanks so much for your time, please sir, I will like the updated file for this cause I want to build it too I need the code, PCB layout and every other important information, I will be delight to get your response as soon as possible here is my mail: Eric I guitars gmail.com

    • Thank you eric, I have provided all the accessible information I could in the two links. Presently I do not have any additional info other than the linked data.

    • Hi Idris, this project was acquired from an external source so i do not have much idea regarding the procedures for implementing it practically.

  2. please tell me sir,why pin no.- 21,22,23 have been left? If it is noy so,tell me from which parts these pins have been connected.and also tell me, will this ups give fast switching between line and inverter without interruption power supply?
    please tell me.

  3. sir how to set battry over charge cutoff .
    bicose this do not stop charging.
    battry voltage up to 15v but charging is continue
    sir plis help me .

  4. hello I have a problem with the inverter ups pic16f72.
    is that when the inverter is in battery mode for a long time it switches to network mode by itself and then goes to operate in battery mode without being connected to the electrical network.

  5. hi,
    Can I design it with high frequency transformer or I have to use low frequency transformer only since the transformer size is becoming too big and costly

    • As far as I know the above circuit is not designed to work with high frequency transformers, so i am sorry you will have to depend on heavy iron core transformer for this design.

  6. Swag,I have some questions because I know before you published this article you would have tested it.
    1.what value does 4E7 resistor means and what does the E stand for?.
    2.how can I test PWM signal without oscilloscope using multi meter or other means?.
    3.Has anyone succeed in building this inverter

    • Jojo, I have already clarified many number of times in the earlier comments that this data was tested and provided by another user and not by me, and therefore i won’t be able to help much regarding the working details or troubleshooting of this design.

  7. hai swagatam,
    i have mahendra powerol ups 800va having the similar circuit using pic 16 f , now i want to have switch for charging off and on manually so that when inverter in ac mains mode i want to charge the battery by solor charger and in night i can switch inverter charger

    • Ravindra, All information is provided in the articles above, I do not have any additional details other than these

  8. Hi, it’s a pleasure meeting you. Your article has given me a breakthrough in some of the problems I faced during some practical work. More power to your elbow. But I beg to ask the author of this project if he could assist to write the code in C or C++. I don’t understand assembly language but I can try C . I wish to understudy it and make changes if possible. Thanks.

    • Thank you very much, I will try to get the contact details of the author if possible, and request him for the necessary modifications.

  9. Swagatam what changes I have to make if I want to add battery of 24v . I think it will work only I have to adjust the low battery right??

    • Nikhil, the low battery will need to set up at 22V and the transformer primary will also need to be changed accordingly

          • Okay , I understood the low battery part but cant understand the maximum charge voltage it will cutoff . I tried mailing the author but he didnt respond . This is the only part where I am stuck .

            • I did not study how the charger is configured to work….if you are having problems, you can use an external charger circuit for the design

    • Nikhil, All information is provided in the article, no additional data is with me other than what is provided in the article.

      • Ok Thanks . This are the updated files right? because I am in a confusion by reading the comments . Because you passed on some updated files to some viewers .
        And how to open .pcb file attached in the schematics part for layout of pcb .

        • Hi Nikhil, you can perhaps check out the following link, it might help you to get further information regarding the project


          • okay swagatam I will try that link and implement it and confirm testing post it in the comment .
            Also one more question this is also valid for 3kva right?? if I apply suitable rated transformer and battery .
            And are you planning on starting on youtube channel??

            • Thanks Nikhil, yes you can upgrade the inverter to any desired levels simply by upgrading the transformer, battery and the mosfets appropriately.
              I am creating the videos just to show the readers how the designs were confirmed with practical testing

  10. Hello swag,
    I am ready to start my inverter. My Batteries are 36 volts up to 43 volts. If I start the system, then a nice sound of Mosfets is available. My problem is the voltage to primary coil of transformer. There are only 6 volts if I measure with my multimeter. At the high voltage side of transformer there is 15 volts? Do you have an idea why that it is?I think the signals of mosfets are ok. I measure it with oscilloskope.

    • Hello Michael, I appreciate your interest, however I am really sorry I won’t be a able to suggest anything useful regarding this project since it was not designed by me, and microcontroller is not within my area of expertise…

  11. Hello,
    I also want to try to implement this circuit. if I may ask what to change if the battery voltage is 36v. I have a working platform whose battery I would like to use completely.
    Thank you for your reply

    • Hello, use this 36V for the mosfet drains, and use a transformer that may be rated at slightly lower than this voltage level…

      make sure to supply the circuit stages with 12V or as instructed in the article….

      • thanks for your quick answer. I will do so. What about a transformer of 24/230volts is that possible or too much lower. I think, these are easy to obtain.
        best regards Michael

          • Thank you for help. Another question is the circuit for Mosfet. It’s not clear if I have to use only a separate Resistor R2-R5 for Mosfet or needs each Mosfet all the Parts like R7/R2/R6/D1/D2 ?

            • I am not sure why two symbols are shown, but you ignore that, and use a single resistor 4.7 ohms for each of the gates.

  12. hello Sir,
    i have Sukam FALCON sine wave inverter 800VA, So the PIC16F72 microcontroller is dead but i checked all the components are well as well as i replaced some bad components too, but my problem is.. i can’t able to find new preprogrammed PIC16F72 SINE WAVE microcontroller with local sukam Engineers also they suggest to buy new Sine wave inverter card. So i want to know here u have provided PIC Codes in this “rk_sin_mod.rar” So it will work if i program new PIC16F72 with the hex is provided with this “rk_sin_mod.rar”…Actually i have a programmer device and i know how to program by use windows but my main problem is i am confused will it work or not! Also i checked the PCB design is almost same design…but i need to know if the program not supports whether it is possible of further damage of additional components or simply it won’t start..please clear my doubts..

    • Hello Ashwani, all the data provided was acquired from an external source, so I am sorry I cannot suggest whether they will work perfectly or not, or whether the codes will be compatible with your inverter…

  13. thanks for this useful information. please what programmer and software is the best for programming pic16f72. thank you all in anticipation

  14. hello Swagatam, i have been looking for such circuit, thank god i got it in your site, please can you send me the code that works, and the updated schmetic as edited circuit diagram?

    • Hello Anas, I have already provided the link in the previous comments where you may find more details, I will provide it yet again, you can refer to the following links, but I am NOT sure whether they have the specific elements which you looking for or not:



  15. Hi Adim

    I am on a project using the circuit diagram provided and the PCBs but am currently having problems in components placing on the PCBs cus no the components are not specified pls is there any way u can help me
    My email: planedonholyboi@gmail.com

    • sorry, I won't be able to advise anything regarding the above design since it's not mine and I have not yet investigated the design thoroughly…

  16. sir your inverter gives pure sine wave without load than when i apply a load so bulb gets flikring so plz rectify the problem. And also when i applied mains for charging than my mosfet gets burn so plz suggest me.

  17. Hi, Mr swagatan
    I sent a mail to Mr. Hisham and not been answered may be you could help me in persuading him in my capacity. i have designed and tested the above project very well, truelly i must say its pure sine wave now am trying to use to drive my 96v and tranfotmer using semicron skm145gb088d for the mosfet power stage, pls i just want to know if the circuit will be able to drive the igbt and also charge back with the same, and if there is anytging to consider.later i will post pictures of my design. Thanks Johnson

    • Thanks Johnson, I am glad you could make it successfully, please refer to the the following post for getting all the remaini8ng files related to the above design


  18. Hello, I've got a lot of your help. I've mounted the inverter with pic16f73 to pcb, the model that uses two ci lm358n and two tlp250 plus the file to record the pic does not work on this circuit you can kindly send me the correct file. thanks for listening.

  19. Hello everyone help me I am looking for details on the transformer example "WNDG-2 SECONDARY 263-TRN 17SWG" so if I understand 17SWG it is the diameter of the winding queue and 263-TRN is the number spins to be made at SECONDARY?

  20. I am doing a project on sine wave inverter using PIC16f72. So I am referring your circuit.But I am deleting some part from that circuit. I also don't have any idea about the coding of the project. From the figure attached I am not going to use the circuit part of 'ac mains input, relay circuit,12v fan circuit'.
    So I have a question that will that circuit run properly or not? What changes should be done in coding?
    If there are changes in the coding can you provide me that code?

    • sorry, I won't be able to advise anything regarding the above design since it's not mine and I have not yet investigated the design thoroughly…

  21. Dear Bhanu, yes that's possible, you can create any power just by upgrading the trafo and the mosfets and the battery.

  22. sir i have made 1 kva sine wave inverter according to your uploaded project in homemade website.

    but sir it occure some problem when i ON the inverter than low battery beap occure and inv goes to shut down.

    • Risji, I have already mentioned in many of the previous comments, that this is project is not designed by me, and I have not investigated its internal details.

  23. Dear, mr hisham.
    I am interested to your project.I am trying to make your project but I am failed to make. please send updated hex file & pcb. I will be greatfull to you. my mail id :mustapha.hamouda@gmail.com

  24. Hex File made for PIC18F4550 – which is a 40 pins Chip. Though it has some similarity with PIC16F72.. Please if this circuit is workable with PIC16F72..
    Thanks for your work – am ya die hard fan…….

  25. Sir I have designed another version of the pic16f72 inverter I will like you to help me inspect it if it's gonna work correctly how do I share the image in the forum

  26. I posted a question since 26th of January, no reply has been given. thought this is a site where you can learn more and become better.
    i hope a reply will be given someday.

  27. Good job here. please can you explain how you achieved the feedback in your code and circuit.i cant still figure it out. i am in need of an explanation concerning that.

    if you dont mind you can send we a write up concerning that.
    email: adegbite.timothy@yahoo.com

  28. Hello Everybody….

    you can see another version of the above sinewave inverter here


    but I am not sure whether this is the correct one or not….please verify it yourself.

    • Please can you help with with pcb for just the CPU side of this inverter so I can use it with push pull topology or in the case of FET upgrade

  29. Sir can you please send me the circuit that i use to send the hex code from my pc to pic16f72 because I already have everything I need to the only thing is that I don't know how to send programs to the pic16f72 because i don't need to buy any spi or jdm in the market i only need to build it by myself that why am asking you about the circut that use to send it my hex code..please sir i need your answer immediately please

  30. There is a problem with the code. The signals coming out of the pic are not stabilizing. Every 10 seconds there is a peak in the transformer output voltage, at least about 10V.

    • Sorry folks, as I will not use the ups mode and only the inverter, the pin 2 of the pic had to be grounded. Respected problem.

  31. Hello…to all electronics guiders in this project…but,I have a query about transformer that can I use CRGO transformer core instead of CRNO of core number '6' ,for 800 va inverter production …because, I just got this 6 number CRGO transformer core for 800 va inverter project from local market.please….reply me.

  32. Hello,, sir.all is OK but this inverter creating extra sound at the time of battery charging and inverter on….this sound type some_like sound of cricket at night.so, please guide me to recover from this problem of unbearable sound.otherwise, I am totally confused that at time of transformer 'stand by' mode it is fully silent but in the condition of charging and invertering…it generates sound.I observed that sound is inducing when pwm is generating by PIC…and my cooling fan sound is much less than this unacceptable sound of ups part.so, please,please, please help me to know the problem of sound.

  33. thanks, Mr. Tayo Akinbiyi, i have just seen the one you sent. The schematic and hex code. can you please send source code and pcb. and Derrick, i will send you the one sent to me.

  34. Hi,
    Thats great share Thanks!
    But I would like to ask this:
    I have a transformer with additional primary winding which can +30v -30v in order to act as a stabilizer. I think you should also include that because if voltage goes below 220 the charging voltage may drop and will effect the charging.
    Would really like to see your reply!

    • Hi TANVEER !
      The charging menthod is boost(pfc) charge ,it can charge even 110vac .

      Dear sir Swagatam Majumdar,can you share me update file work with led ?

      Thank !

    • You'll be having proper charging voltage even if the mains voltage are low. So, no need to modify that. I think the battery terminal will have 17v in the case of charging so you have 2v additional if you consider 15v for charging the battery.

  35. Hi sir I'm building 48vdc inverter this pure sine wave inverter circuit so what should I do to supply the pic16f72 because 12v regulater cannot handle 48v battery I use the one you recommended to me but it couldn't because it out put is 9vdc and some of the ic like ir2110 pin3 need 12v please guide me thank you hope to hear from you soon

  36. OK sir thank for respond me but I want to put a variable resistor so where it should be connected and what value thank you

  37. Hi sir thank you for the good work I build your sine wave inverter and it works very fine but one thing I want you to help me out is the LCD if I connect it only displayed every thing but it don't display the inverter A/C on the screen like 230v please guide me to solve it thank you hope to hear from you soon

  38. Hi sir please I'm having a littel problem with the 48vdc to 12v DC it heat up when I connect 48vdc and the mje340 burned I resistor to drop the volt but still blowing thank you hope to hear from you soon

    • Hi Daniel, that cannot happen unless you exceeded the current through the transistor.

      remember the transistor is supposed to provide power only to the IC and not to the mosfets or the battery charger.

      The IC would consume some milliamps which the transistor can easily handle….also make sure that the base resistor is reasonably high….you can use a 4k7 initially

  39. Hi foks can someone help I'm having a littel problem with this circuit the problem is that if I power on the circuit I all the voltage correct but a few minutes the low side mosfets start heating without any load I got 230v at out put I will be very happy if someone can gud me I'm trying to upload the picture and the wave fom but it's couldn't think you hope to hear from anyone

  40. Sir, what is alternate parts or circuit instead of this main sensing transformer(6volt 50MA). Because, this small size of transformer is not available in our market. Please, response me with solution…. I know you are great engineer_

    • That transformer is used for the main input sensing that is fed to the microcontroller pin. If you don't have that transformer available you can use any transformer of any voltage but you need to use a circuit of 7805 voltage regulation to give 5v input to the microcontroller (otherwise it can result in blown chip). If you understand the circuit well. You can also use a 6v 500mA transformer for that purpose. There is no issue. The designer used 6v 50mA because there is no special need of current instead of sensing the main only.

  41. No I don't hear any noise I use my small dril machine and fan it works smoothly I'm trying to upload the wave form for Mr swagaton to see but it's couldn't but I'm still trying

    • You can upload the picture on the web anywhere (google it "upload photos") you'll be having a link to these uploaded picture then share that link here in comments. Do post waveform and also capture a clear picture of your assembled circuit board. I'd like to see how it looks like.
      I checked the code & schematic already the inverter is equivalent to 50Hz frequency. So, this would be best for your home and office use.

  42. Hi sir this is the wave form of the inverter is good or not I used 2.2uf/4oov sir I'm having a problem the low side of the ir2210 got hot without load please let me have the email address of the person who designed this circuit so that he can guide me solve it

  43. Hi sir I completed this circuit today it works fine but I did not put any load from Monday going I will upload the wav form on this blog sir can I use this for high frequency inverter I mean chopper inverter? Thank you hope to hear from you soon

  44. Great job. Thanks for sharing. SAir what is the program language you used to write the provided code.as i am not famelier with that code .Could you please forward the micro c code of this inverter circuit.

  45. Hi sir please kindly tell me the language you use to program this 16f72 because i am doing projects in PIC in micro C language and i have no any idia about the program supplied. please kindly send me the code if you write it in micro c language my e mail is "kulangaadikari@gmail.com"

    • Hi AAA, the program is in assembly language. If you understand this language this should work with both MikroC and PIC C or MATlab. But in order to make it work you need to change the specific of the written code. All software compiler have their own specifics. So you can check on your program's website for the specifics.

  46. Hi Brother how are you? I just saw this post and found it real useful. I must appreciate your effort. This is absolutely amazing. Do you have any output waveform graph. Coz, it looks like that it should be something looks like sinwave isn't it? Or a pure sine wave. The work is amazing, hats off..! Also in the modified diagram (the second one) it is hard to read the values of the components. So can you please take time to just write up them. So, it would be easy for your visitors to read them. Have a great day and stay blessed (Y)

    • Thank you Syed, I am sorry I do not have the waveform images because this circuit is not mine, it was submitted by one of the members of this site

      if you click the diagram and then press cntrl+ you will be easily able to enlarge it to a readable extent…

  47. Hi sir please I did not see the circuit I searched it but I did not find it can you please send it to my email address (danieladusei573@gmai. Come or anything to prov that this is the circuit thank you hope to hear from you soon

  48. Hi sir please I want you to help me I am building 96v inverter I don't have the circuit that can convert 96v d/c to 12v d/c to supply the circuit so all I need is the circuit that can convert 96v d/c to 12v d/c,sir please if you have that circuit please send it to me thank you hope to hear from you soon

  49. Hi sir I sent you some messages but you did not reply me I'm having a problem with the circuit I got all the voltage correct but the lm324 if I removed from it the voltage come's out but if I connect it the voltage stop please guide me with that hope to hear from you soon thanks you

  50. Sir please I build this Sine wave Inverter circuit but I'm having a problem with the ir2210 pin1 and also lm324 so please can you please forward me the update version to my email address (danieladusei573@gmail.com I hope to hear from you soon thank you

  51. The led version of these code works fine,except that it has very little delay time when it changes from inverting to mains for charging.But while the lcd version does not sense mains at all.i will be glad if any one from these good forum could send me the updated version of these code (takelectronicsvent@gmail.com)

  52. Hello everyone, thank you for the nicely explained project . I am willing to build this ups and basically upgrade it further. Can I please have the latest files, code and circuits (without lcd). Your assistance is greatly appreciated. Keep up the great work.

  53. sir, i have a problem in this circuit.because, there are two numbers of U4 ,,, where one is LM324 and another is pic16f72.so, what will be the U4 ic name.may this IC(LM324) one or two pieces in whole circuit ?

  54. hi sir thank for this diagram i want to build but my problem is cd4081 can i replace it with cd4082 thank yo hope hear from

  55. Fanyo
    Hi Admin,

    Well done for the nice job for everyone to benefit.
    Can you please forward me the updated files, so i can make it for my family house. my email is:Ikwueze80@gmail.com

    Thanks and be Blessed

  56. please, tell me that, can i use 14*18 AWG WIRE FOR 1200 VA TRANSFORMER(24 volt inverter) in PRIMARY WINDING ? where you said that 3*12 AWG IS required in primary(1200 va inverter).

  57. sir, can i use irfz44n for 1200 va inverter without using irf3205 transistor.if possible then, how much is required to 1200 va inverter.


    • Swapan, lower voltage will require proportionately higher current and vice versa….at 12V you would require 1200/12 = 100 amp transformer

  59. Thank you so much.Can you show the PWM signals on the oscilloscope and the output wave form of the inverter at load.

  60. HImr.Swagatam Majumdar .i donot know what is line (H/L)?and where must be conected to this wire (H/L)?
    please answer me soon.thanks a lot.

  61. Hi Shiji Sebastian, I have the LCD code for this project, I don't think I have any problem with code, it seems I have hardware issue, I can see high voltage at pin 11 of IC IR2110 which therefore shutdown the low side output of the gates. I have checked and recheck all components corresponding to that area still unable to detect the fault, please any suggestion. here is my email kolleyjaymec@gmail.com.

  62. hi house, I build this circuit, I can see voltage on pin11, 12, 13 and 14 but pin 11 of ic1 and 2 is high which then shutdown the IC ir2110 from generating pulse to feed the gates. I have checked all components relating to ic324 pin 1,2 and 3, still voltage at pin1 of ic324 is still high. and if I remove the ic324 it will generate gate but burnt the low sides mosfet.
    please what else can I try to make pin 11 of ic ir2110 low

  63. Does the pcb design that is shares have all the changes mentioned by Mr. Hisham. If not can anyone please sent me the updated pcb design so that i can make one at home. I am new to this so please forgive any mistakes. My email id:donygeorge1987@gmail.com

  64. dear sir will you please send me complete circuit diagram or its data and its code is not running at my mplab software will you please help me out

    • dear Syed, the above design has been tested practically…so I am not sure why it's not working on your simulator…sorry no idea about it.

  65. Dear Admin:

    First of all I want to thank you for your fruit full contribution to the world.

    Please send me the updated code for PIC16F72 based sine wave inverter.

    I will be thankful to you.

  66. helle,i have almost the same ups circuit that boughti on the internet and it did not work and i feel there is mistake in it and i want to ask if i can upload the file for correction thanks. from Allen

    • hello, thank you for your consideration, it would be great if you could provide the correct details verified by you, folks will surely appreciate that

  67. hi Showing sebastian, please can you send me the code that works for you, all the codes I have here are not working for me

  68. Hai sir I do the project it's working fine. Now i trying to add a LCD display please send c code. Thanks

    • dear shiji sebastin

      i have two doubts to share with you
      1. which is the software you used for opening the PCB Design (.PCB file) ?
      2. what method/instrument used for converting code to PIC16f72 IC ?

  69. sir
    have you confirm from Mr. Hisham maybe the other part is working? because from your mail he said he has only test cpu part.
    then where is the rs232 part and lastly I need more details on J1 connection, I know is for LCD but more details on it
    I have started working on the project

    • Olaleye, please contact Mr. Hisham through the given email ID, I am sure he will respond with the required answers and help you to solve the problem.

    • Thanks for your help and support. Please can you help me with the pcb of the CPU side separately. And can I use it for a pushpull topology inverter. I need your reply urgent

  70. sir
    I use pic16f877a for this circuit, I load the hex file on it successfully but no signal seems to be coming out from H/L, cH-1, PWM, CH-2 logic pins and no led is turning on
    pls what can I do? I have spent time and money on this project. pls help

  71. Olá Swagatam

    Mesmo sabendo muito pouco do inglês aprecio os seus projetos. Adoro a área de inversores. Entendo a maioria dos seus projetos e é o site de ajuda que eu precisava para melhorar meus conhecimentos. gostaria de saber se posso industrializar alguns de seus projetos no Brasil. Grato, Silas

    • Graças Grato, sim, definitivamente você pode tentar meus projetos inversor para aplicação industrial, sinta-se livre para experimentá-los.

    • Hello Hisham, am really impressed with the knowledge u are imparting on others to improve ones practical skill. Pls i want you to send me detail of this pic coding for the sinwave,my email is omolezone2ng@gmail.com. i will be very glad to hear from you,hope to talk with you subsequently.thanks

  72. Thanks for the quick response.just want to know if u get my question right.I mean the same code you use for pic16f72, can I use it directly without modification.Regards

  73. Thanks for the quick response.
    just want to know if u get my question right.
    I mean the same code you use for pic16f72, can I use it directly without modification.

  74. Thank you for your reply Sir.(12v design )but in that pin 0v only but I m getting ac sense change over, after adding 100w load few seconds low battery or overload sense coming that time I have tested overload 7th 0v and battery pin 2.9v but I m getting low battery and overload..I m using 100ah new battery.and 16mhz crystal oscillator is correct or anything need to change.i m using 22micro farad for bootstrap sir…please sir help me out in this problem..is there any problem in program please clarify sir I m waiting for your reply.

  75. Please help me out in this sir I m getting main sense in inverter mode without giving main supply to inverter,what is the bootstrap capacitor value then transformer ratio 7v/230v please help me out in this sir I m waiting for ur reply…thank you sir.

    • hi chinnathambi thambi
      please check the voltage on pin2 of microcontroller it should be 0v when no ac mains,boot strap capacitor you can use (any range between 22uf and 100uf),transformer ratio 7v/230v is ok,good luck

    • Pls let me know wt is the correct voltage ratio of transformer 7v/230 or various ratio.and then wt will be the bootstrap capacitor value.one I have done project but in inverter mode automatically ac main sense will occur without ac present in main please sir let me clarify

    • Sir please help me in this what is the bootstrap capacitor value and transformer ratio 7v/230v or something else..and then this is correct program or what because I have done this project but in inverter mode in getting ac main sense continuously without giving main input what should I do sir please reply as soon as possible.

Leave a Comment

Do NOT follow this link or you will be banned from the site!