Design and Simulation of a 1kVA Arduino Microcontroller Based Modified Sine Wave Inverter Using Proteus

The paper uses Arduino Microcontroller to design a Modified Sine Wave Inverter. It employs Fourier transform to mathematically analyse its harmonic contents. It was shown that by eliminating third harmonics present, distortions can be reduced. The paper employs step by step methods to design various stages having, Transistor and MOSFET switches. Arduino codes were written using digitaWrite() and delayMicroseconds() functions in its Integrated Development Environment IDE to generate drive waveforms. It highlights how Arduino sketch could be compiled and hex files generated for simulation in Proteus ISIS. Power Transformer Simulation technique was explained. It is believed that proliferation of Inverter technology will enhance economic prosperity especially in the third world countries where dearth of electrical energy is being experienced. The design includes Liquid Crystal Display for the display of generated voltage and frequency. It is recommended that future improvement could be improvement in Liquid Crystal Display functions with robust programming that would foster ease of interactions between the device and the users.


Introduction
The ubiquitous electrical power problems in the third world counties have brought about lull in their economic fortunes. These problems range from epileptic power supply to total blackout with their attendant negatives. It was on this premise that most nations encourage importations of power generators in order to bridge the energy gap [1]. This solution is not without its own troubles. They bring about depletion of their nations' fossil fuel if those nations have reserves in one hand and noise pollution with its concomitant social problem in the other. With the surge in the research on renewable energy, production of solar energy related devices are on the increase; a photovoltaic panel or their arrays can be connected in series or parallel to meet their voltage and current rating respectively. In this way they generate Direct Current quantity which can be inverted by power inverters [2]. The development has brought about developments in the production of inverters. Thus Power Inverters have become household words. They are named after their output waveforms as Square Wave, Modified Sine Wave and Pure Sine Wave. Their Total Harmonic Distortion is 45%, 23.8% and 3% [3] respectively. Square wave types are not efficient, parade poor regulation and are not conducive for some electronic devices. Modified Sine Wave Inverters are the most common types in the market, their lesser THD of about half of that of square wave allows more electronics devices to work with them. This type has an improved efficiency and better regulation but its high number of harmonics still affects sensitive equipment such as medical monitors. It can also cause hum in a radio or sound system or snowy video picture [4]. Pure Sine Wave inverters can safely run more sensitive devices like laser printers, laptop computers, power tools, digital clocks and medical equipment [5].
Going by recent popularity of Microcontrollers, Arduino microcontroller can be used to generate drive waveforms, perform intelligent and logical operations provide low cost drive to Liquid Crystal Display LCD.

Methodology
The design uses Fourier Transform to determine harmonic content of a Modified Sine Wave inverter system. Since the series exhibit halfway symmetry, even terms are absent. The harmonics with the largest amplitude was found to be 3 rd term. The rest time β was adjusted to 30 0 in order to eliminate it. This phase corresponds to 1.6mS. Arduino codes were written and compiled in its Integrated Development Environment IDE using digitalWrite() and delayMicroseconds() [6]. Functions to generate two anti-phase waveforms needed to control the drive circuits, power stages and output Transformer ( Figure 1).
The designed circuit diagrams comprising transistor and MOSFET switches were wired in Proteus ISIS environment for Simulation transferred into wiring diagram of the Inverter.

Arduino Uno Microcontroller
A Microcontroller can be referred to as a computer on a chip. It parades input and output pins. Unlike a Microprocessor, it includes processor with memory location for storing programs written in C language.
Arduino Uno board, Figure 2, has an Atmega 328 on it as the main Microcontroller. Using this unit does not require extra money for a Programmer. Codes or sketches and compilations are done on its Integrated Development Environment IDE. This advantage makes prototyping of embedded system easier by engineers and electronic systems enthusiasts [7]. The board has sis analog inputs to handle analog signals and thirteen I/O pins for input and output functions.

Fourier Series of a Modified Sine Wave Inverter
If f(x) is defined on the interval -π ≤ x ≤ π and f(x) = f(x + 2π), that is, the waveform is periodic ( Figure 3) [8].   The Modified Sine waveform is an odd function since A waveform that exhibit odd symmetry, only Sine terms are present, a 0 =0 [8] Hence, It repeats itself in magnitude but reverses in phase after every half period. The same thing is applicable over a quarter wave [3]. In this case, a n = b n =0 for even n, that is, all even harmonics are absent.
Since Sinnπ =0 at odd n, SinnπSinnβ=0 [ ] For an even n, b n = 0 because =1 So, b n is the amplitude of the odd harmonics present and can be controlled by varying the rest period or angle The fundamental at n=1 is b 1 The next harmonic is the 3 rd which has the highest amplitude. It can be deduced that any harmonic content can be eliminated when Cos term is made to be equal to Cos 90 0 . That is, for nth term, Cos

Design of a MOSFET Switch
The insulation between gate and source terminals makes the input impedance to be very high in the range of mega ohms [11], hence it draws very small current thus MOSFETs are voltage operated.
They can be used as switch when they work in their cut-off and saturated regions. The drain load is inductive having ohmic resistance, that is, 12V section of the power transformer connected in the step-up configuration. Drain voltage V D = 12V for 12V-0-12V transformer.

Selection of Inverter Output Transformer
While the Inverter rating is 1kVA and at frequency of 50Hz to be powered with 12V Deep cycle battery. Using a Push Pull topology [12], a 12V-0-12V is required. That is 24V centre tapped. The transformer is going to be used in step-up configuration.

The Complete Circuit
The two anti-phase square waveforms are generated using Arduino Uno microcontroller. The outputs taken from pin 7 and 8 drives the transistor switches having +9V as Vcc. Thus output generated switches to 0V and +9V. These outputs are employed to drive the MOSFETs switches connected in parallel. A centre tapped 12V-0-12V transformer in step-up configuration serves as the load to the MOSFETs stage. So a switched 12V, 84A in the primary side produces 220V, 4.5A at the secondary. A low value capacitor across the output leads is a low pass filter to filter out other odd harmonics present. A fixed regulator 7809 takes in +12V dc to produce +9V that powers the transistor switches ( Figure 7).

Simulation Using Proteus ISIS
The codes are written on Arduino 1.8.5 Integrated Development Environment IDE and compiled. Hex files were automatically generated. The address of the files is displayed on the report thus: C:\Users\OYEWOL~1.AKI\AppData\Local\Temp\arduino_ build_380484/inverter_project2.ino.hex.
On Proteus 8 environment, the Arduino board was double right clicked. An edit component dialog box was displayed while the copied hex file address is pasted on the program file field after which an OK button was clicked. Clicking the RUN button commenced the simulation. A Digital oscilloscope displayed the two drive waveforms. Figure 8 shows inverter output with 1kW, filament lamp [13].

Simulation of Inverter Transformer on Proteus
Let L be inductance of the windings in Henry, N the number of turns and is the permeance. By comparing the two transformer sides, taking N p and N s for the Primary and secondary windings respectively, Inductance L is proportional to the square of the number of Turns N, that is, Using the transformer as a Step up device, low voltage 12V side becomes the primary winding. Taking L s =1H.

Conclusion and Recommendations
It has been shown how Arduino Uno Microcontroller can be used to produce Modified Sine Wave Power Inverter. The application of Fourier Transformed has allowed the determination of the rest time towards elimination of the most pronounced 3 rd harmonics. In order to further remove the remaining odd harmonics, a low pass filter should be connected between inverter output and loads. It is noteworthy that in some applications like AC motor drives, filtering of harmonics may not be needed. The design of transistor and MOSFET switches from the first principles, selection of transformer, programming on Arduino IDE, Simulation on Proteus coupled with clear step by step methods will gender learning by other researching engineers and electronic systems enthusiasts. Figure 10 shows further design incorporating Liquid Crystal Display LCD for the display of terminal voltage and power frequency.
The under listed are recommendations made for further study and improvements: 1. Programming should include functions that could sense battery voltage and shut down the system in case of low voltage that may want to over-drain it.
2. Future efforts should be made towards production of the units on Small and Medium Scale by upcoming entrepreneur for economic benefits in the developing nations.
3. The usage of Printed Circuit Board technology is advocated in the future works.

4.
The design may include interactive functions between the user and the device.