IC 555 Inverter with Arduino Hi/Low Battery Shutdown Circuit

In this inverter design we use a 4017 decade counter and a ne555 timer Ic to generate a sinewave pwm signal for the inverter and an Arduino based automatic high/low battery cut-off with alarm.

By: Ainsworth LynchIn



In this circuit what actually happens is that the 4017 outputs a pwm signal from 2 of its 4 output pins which is then chopped up and if the proper output filtering is in place at the secondary side of the transformer it takes the shape or close enough to the shape of an actual sine wave form.

The first NE555 feeds a signal to pin 14 of the 4017 which is 4 times the required output frequency that you need since the 4017 switches across its 4 outputs, in other words if you need 60hz you would need to supply 4*60hz to pin 14 of the 4017 IC which is 240hz.

This circuit has an over voltage shutdown feature, under voltage shutdown feature and a low battery alarm feature all that is done by a microcontroller platform called the Arduino which needs to be programmed.

The program for the Arduino is straight forward and has been provided at the end of the article.

If you feel that you won’t be able to complete this project with the micro controller added it can be omitted and the circuit will work just the same.

How the Circuits Works

This IC 555 Inverter with Arduino Hi/Low Battery Shutdown Circuit can work from 12v, 24, and 48v going to 48v an appropriate version voltage regulator would have to be selected and the transformer sized accordingly also.

The Arduino can be powered with 7 to 12v or even 5v from a usb but for a circuit like this it would be good to power it from 12v as not to have any voltage drop on the digital output pins which is used to power a relay which turns on the Ic in the circuit and also a buzzer for low voltage alarm.

The Arduino will be used to read battery voltages and it only works from 5V DC so a voltage divider circuit is used I used a 100k and a 10k in my design and those values are plotted in the code that is programmed in the Arduino chip so you have to use the same values unless you made modification to the code or write a different code which can be done since the Arduino is an open source plat form and its cheap.

The Arduino board in this design is also connected up with an LCD display 16*2 to display battery voltage.


Below is the schematic for the circuit.


IC 555 Inverter with Arduino Hi/Low Battery Shutdown Circuit

I also designed the PCB for this specific SG3525 inverter with Arduino battery charger circuit, you can check it out and download it if needed from this link

Program for the Battery Cut Off:

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
int analogInput = 0;
float vout = 0.0;
float vin = 0.0;
float R1 = 100000.0; // resistance of R1 (100K) -see text!
float R2 = 10000.0; // resistance of R2 (10K) - see text!
int value = 0;
int battery = 8; // pin controlling relay
int buzzer =7;
void setup(){
pinMode(analogInput, INPUT);
pinMode(battery, OUTPUT);
pinMode(buzzer, OUTPUT);
lcd.begin(16, 2);
lcd.print("Battery Voltage");
void loop(){
// read the value at analog input
value = analogRead(analogInput);
vout = (value * 5.0) / 1024.0; // see text
vin = vout / (R2/(R1+R2));
if (vin<0.09){
vin=0.0;//statement to quash undesired reading !
if (vin<10.6) {
digitalWrite(battery, LOW);
else {
digitalWrite(battery, HIGH);
if (vin>14.4) {
digitalWrite(battery, LOW);
else {
digitalWrite(battery, HIGH);
if (vin<10.9)) {
digitalWrite(buzzer, HIGH)
else {
digitalWrite(buzzer, LOW
lcd.setCursor(0, 1);
lcd.print("INPUT V= ");

55 thoughts on “IC 555 Inverter with Arduino Hi/Low Battery Shutdown Circuit

  1. Have questions? Please feel free to post them through comments! Comments will be moderated and solved ASAP.
  2. swagatham sir,
    can you pls give me a circuit of voice controlled home appliances.i need to control appliances using voice.i need it to be done without any android or bluetooth.its similar to one in modern cars using voice recognition.no problem whether it is arduino or microcontroller.In net there are circuits but they uses an android phone..pls help sir

  3. Pls sir, Am new to circuit but I real love developing circuit.

    We are working on a project where IC NE555 timer will be at the transmitter and the receiver side.

    Pls sir I want the remote control to have at least 4 channel

  4. Sorry for the late reply, I am tied up with work. I got the boards a while now and assembled one just now I am having some difficulties so far ill send links to pics and vids when my internet is back up to speed.

    Whats happening is that I am getting 55v ac max from a 12-0-12v transformer with no load connected to it duty cycle is wrong its at 24% max and frequency at that duty cycle is about 300hz, if I adjust frequency to 50hz then the output from the transformer will be 0.

    I checked the 555 output freqency and I realized its at 1khz at its lowest if I adjust 500k pot its max is about 6khz and I think the aim should be to get about 200hz to send to the 4017 ic.

    Im am wondering what the issue is I used all correct components, Ill do some more tests in the mean time.

    • the duty cycle will decide the output RMS voltage, so that's the crucial thing which will need to be set correctly. for a 12V transformer, the battery voltage should be 15V, or for a 12V battery, the trafo should be a 9-0-9v

    • first test the inverter without the PWM…make sure the inverter produces 330V RMS (470 peak) at the output.

      once this is confirmed then you can connect the PWM and adjust the pot until the output voltage settles at 220V RMS (310V peak).

      By the way your transformer looks very small so it won't support more than 50w or 60 watts

  5. I know the transformer is small… I always use small transformers for testing. Hard part is I didn't proto type this circuit first even though I can because I have sufficient parts I'm using the pcb I made but I guess I could just remove the 555 timer and check

  6. When I removed the 555 it had no effect, same results….. What I realised is that I am getting only 6v ac between center tap and each end of the transformer so thats why I am getting half the voltage I should get.

    I switched output fets and the same result I only changed some of the bjt since I am getting a lowr gate voltage on one Fet 10v and the other Fet is getting 12v to the gate.

    Doing something like a diode test across Fets on the 2 different sides give 2 different results also.

    • the fet gate peak voltage should be almost equal to the IC supply voltage, and if still the fets are not conducting well then those are not good for sure.

      remove the trafo and replace with 12V car lamps with the drains and check the intensity that will prove whether the fets are faulty or the trafo. the intensity must be 50% of their full intensity since the dutycycle is supposed to be 50%, this will prove the FETs are OK, otherwise not.

  7. I actually dont have an 12v car lamps but I have alot of fets both new and old I replaced the Fets more than once and the transformer is new and I have dozens of them and I tried a couple and same results, the Fets seem to be good and the transformer is also.

    the test you wanted me to do Im sure I wouldnt get 50 percent brightness the duty cycle is just sitting at 25% and where the transformer is connected to when removed btween center and one side is 12v and center and the other side is probably 2v highest.

    Ill go back through again by changing the bjt's related to that side, since the mistake I made at the beggining was to reverse the battery connection.

    • I was referring to the 50Hz frequency at 50% duty cycle from the 4017 IC that would cause the bulbs to glow at 50% illumination, I was not referring to the PWM from the IC 555, anyway it won't be relevant for the trafo since it has two winding working in tandem.

  8. Also could you do a check for me also the first 555 which is sending the signal to the 4017 ic, its suppose to be sending 200hz for my normal 50hz operation but I am getting 1khz minimum. If you check I used (2) 1nf capacitors shouldnt I be able to get much lower frequency?

  9. I rebuilt the circuit this morning using back all the same components, I got a better result this time around. I got the duty cycle to 50% this time the lowest I could adjust the frequency was to 300hz plus hz that would be the only problem really.

    The voltage is at 79v from the output of the transformer but that's because I'm using a 12v transformer where the transformer connects to the board I am getting 9.3v between center and each side and 18v across both end terminals.

    So that would seem to require a 9v transformer. My battery voltage is currently at 12.7v

    Oh i made one change because at first connect I had some issues also the duty cycle was low and fluctuated alot and the led I had installed was blinking and there was no loose connections on the board so I checked the voltage across the Led and I was only getting 2v so I removed the resistor and the Led from the circuit.

    Before I did that the voltage at the transformer connections output without the transformer connected was 4vdc and when I removed the led and the resistor it went up to 10.4vdc

  10. I replaced the 1nf capacitor with a 33nf and I got the 555 frequency to 206hz the 500k pot can reduce it even further.

    leaving it at 206hz I got 51hz from pin 2 and pin 7 on the 4017 but testing the transformers output I am getting 117hz, isnt the push pull topology suppose to work in a manner of sending 2 different 50hz to the 2 different fets the drive the transformer to send 50hz output?

    Or should I reduce the frequency lower to send 25hz through each output of the 4017?
    also the voltage of the output reduced to 65vAC from the 79Vac that I had it when the frequency was reduced to 117hz so ill assume if I reduce the frequecy to 50hz then the voltage will go a bit lower also, so after I get my 9V transformer I think the voltage might still be low.

    What about trying to change around the resistance values between pin 7 of the 555 along with the capacitor the get the correct frequency at the highest voltage?

    • if you have not skipped pinouts across the 4017 outputs then you may need to set the 555 frequency at 100Hz and check the response at the trafo output….

      the duty cycle must be also set to 50% with the above frequency

  11. OK while I set the frequency to 100hz on the 555 the output frequency from the transformer remains roughly the same place and the transformer starts to hum, I normally hear that sound wen the frequency gets low on a transformer when the wave isn't pure.

    I did another test to remove the 555, the one sending the pwm signal and the duty cycle sat exactly at 50% and the frequency reached 51hz also which is adjustable voltage at 69vAc so the issue I have been having is with the pwm stage… At what frequency is it to oscillate to chop the waves, I was thinking 100hz, mine is sitting at 139.8hz now.

    • from the diagram it seems pin7 and pin3 are skipped, so the frequency at pin14 of the 4017 should be 200Hz (@ 50% Duty cycle) and not 100Hz.

      doing this should create 50Hz frequency at the gates of the fets.

      the PWM from the lower 555 is matter of experimentation, preferably it should be 200Hz too.

      that means the upper 555 output could be also used for PWM chopping, and the lower 555 completely eliminated

  12. the Lower 555 was an idea I got from your page http://www.homemade-circuits.com/2016/08/sg3525-pure-sinewave-inverter-circuit.html

    the lower 555 is just in place basically to modify the wave of the inverter since im trying create a spwm wave form.

    In other words the top 555 is to generate 200hz to send to the 4017 ic to create 2 different 50hz output to the gates of each FET, I was expecting to use the lower 555 timer to further cut the wave into a more precisely calculated wave form as to give a smother wave closer to mains wave form.

    • yes I know it's my idea, I was trying to make the design simpler by eliminating the lower 555.

      the upper 555 output can be itself used for chopping and creating the modified sinewave

    • sorry I think I am missing something here…the lower 555 will be required and its frequency will need to 4 time the frequency of the upper 555, that is 200 x 4 = 800Hz.

      please ignore my earlier suggestion regarding eliminating the lower 555 and the 200Hz for the lower 555 frequency.

  13. based on he capacitors I had available the closest I got to 800hz for the lower 555 was 1000hz and testing the ouput of the transformer that way I got 600hz so I increased the output again but the frequency got higher on the transformer so what I did was to keep reducing the frequency of the lower 555 until I got 66hz, to lower the frequency of the 555 I had to increase the value cap each time but the highest I had was 470nf so I adjusted the 500k pot a bit to reduce the frequency to 50hz so its ok in a way.

    What I notice is that the frequency keeps jumping between 48 and 52hz which I would think is ok but keeping it stable would be better, not sure why its jumping, the dut cyle also jumps a bit, its between 49 & 51%.

    The frequency on the lower 555 is now at 30hz thats what I had to set it at the get 50hz from the transformer.

    I could have gotten 50hz woth higher freqncies but as I said in an earlier post each time I tried that once I reduce the frequency too much with the 500k pot then the voltage drops also.

    My current output voltage is at 65v using a 12v transformer and battery voltage is at 12.32v so I expect when the battery is fully charged and I have a 9v transformer it should be sending out the proper voltage.

    • your meter is giving wrong readings, as it is picking up the lower 555 frequency and getting "confused".

      if you use 50Hz for the lower IC you will never get the required sinewave at the output.

      the upper IC555 is responsible for the 50Hz frequency, and the lower IC is responsible for shaping the sinewave by chopping the upper 50Hz.

      the upper IC must have 200Hz, while the lower should have 800Hz according to the calculations.

      you can try connecting a 0.47uF/400V capacitor across the trafo output winding and check the readings again

      even with 12V trafo and 12V batt, you are supposed to get around 200V at the output….remove the lower PWM feed and confirm again, if still it is 65V then something's not right in your circuit

  14. Iremoved the 470nf cap and used a 22nf cap instead (thats on the lower Ic555) and the frequency testing between pin 3 and GND was at 915hz didnt get it down to 800hz but I still tested it. the upper Ic555 is fixed at 207hz once I dont shift the 500k pot sending 207hz to pin 14 of the Ic4017 and the 4017 is sending out 51hz from pin 2 and 51hz from pin 7.

    Adding the transformer at the output I am getting 500hz and that doesnt change the reading I get from the upper 555's 207hz going to 4017 and the Ic4017 output 2&7 still remains 51hz but the transformers primary and secondary gives the same frequency.

    output Voltage is still 65-66v

    if I remove the lower 555 the output frequency is exactly equal to the the outut frequency of the Ic4017 (51hz) but the voltage still remains 65-66v and thats testing the 110v side of the transformer that I need, If I test across both ends of the transformer (220v leads) I get 130v regaurdless if the lower Ic555 is in the circuit or not it only affects the frequency.

    I dont have a 0.47 uf cap to put across the output, however I have (4) 0.1uf 400v caps I could parallel.

    • the output from the trafo will be low only if the duty cycle is low or the transformer winding has problems, otherwise a transformer will always produce voltages exactly as per its specs.

    • OK I think I understood the problem….as discussed earlier the 4017 output pinouts are skipped alternately that's the reason why you are getting 50% output from the trafo….

      do this:

      use pin#3 and pin#2 as the outputs, and connect pin#4 with pin#15…this will immediately correct the issue and enable 120V from the trafo….

  15. Well if I was prototyping I could do that but it's a pcb so I can't do that, why would i need to do that though? The side to where the transformer is connected the (12v) side its only receiving 7.5v-0-7.5v which is about 15v across each end so I would be expecting to get about 66v wouldn't that be so.

    I paralleled (2) 0.1uf caps on the output of the transformer and the voltage increased I'm now getting 9v-0-9v that's 18v across each end and 75v at the output of the transformer.

    The frequency however is reading higher I am now reading 159.8hz, the frequency on the lower 555 is 921hz but it's duty cycle is 1.1% I think that's the problem.

  16. I l am not going against your recommendation, I was just asking why since I don't know the reason.

    Also I could re draw my schematic to reflect what you said.

    Also why is the duty cycle so low on the lower Ic555 timer, 1.1% is that ok?

    And your method sounds better to me since it would raise the voltage level higher.

  17. Ok I cut the trace from pin 7 and I am using pins 2 and 3 as outputs and I bridged pins 4 and 15 and I got 113v output I managed to reduce the frequency to 55hz and I think that should be ok for now.

    What I tried was removing the 3 0.1uf caps I had in parallel on the 110v side of the transformer and the frequency changed I started reading 800+hz once I put them bback then I started getting 55hz again, but I dont think my meter reads frequency well.

    • yes now it will give the right amount of power and can be optimized with the lower PWM feed for regulating the RMS.

      your meter is reading whatever it's collecting from the source, and since the source may be accompanied with different types and hidden harmonics all those are getting trapped by the meter….better to check the waveform in an oscilloscope.

  18. I have a hand help scope I am not sure if its acurate as it should be, I see the wave forms, not sure if I can check the output of the the transformer so I always use it only on the low voltage side and the waveform of this inverter doesnt change when I include or remove the lower 555 timer.

    I have the frequency now set to 900hz on it and the duty cylce is a 1.1%

    • you can use your computer like a scope if you wish by downloading Goldwave software, and then feed the inverter output to your pc at 1V peak and then assess the waveform with the above mentioned highly advanced software view

  19. oh kool poor man Oscope 🙂

    So basically any audio software like that can be used for example Adobe Audition, sound forge, software that show wave for for audio tracks?

    Also if I am to use that method of a scope wouldn't I need to build several voltage dividers depending on the voltage level I am testing?

    • yes but with much advanced graphical view than a real scope.

      any similar software will also work

      you can use a resistor divider for getting approximately 1V corresponding to 120V.

      you can use a pot for the ground resistor for adjusting the output precisely.

  20. Well the thing is appliances in my country is rated for 50hz so it's not necessary to get 60hz also the voltage level is ok i guess the circuit is ok where it is.

    Using outputs 2 and 3 and bringing pins 4 to 15 on the 1c4017 what exactly did that do?

  21. Oh i have never seen that regulation… All machines or devices in my country is rated 50hz and 110 or 115v or 120v.

    My country is 50hz only from the power grid so even 220hz devices operate at 50hz, 415v at 50hz 600v at 50hz

    • I am not sure how that may be possible, as far as I know it is strictly not recommended to use 120V at 50Hz or vice versa…

      this may be OK only for those appliances which has an SMPS based power supply, like all electronic appliances etc.

  22. We run all appliances from it, factories operate just fine and homes, not all places get voltages that high though it would be who is closets to the transformers that step down the high tension voltage to 220v single phase at 50hz, after that 220 is sent to near by houses if tested you will get 120v @50 hz but most of the other house get like 115v 50hz that's our countries rated voltage from the power company.

Leave a Comment