Sunteți pe pagina 1din 7

Chapter3

Software Description
3.1 Introduction to Software:
We are using Arduino for generating PWM signal to control our switching circuit. Here is a
slight intro about Arduino and PWM signal.

It is an open source controller hardware and software integrated. Arduino can perform many
functions by reading the input. We can use our board to make various outputs by using the
micro-controller programming language. Algorithm depends upon your approach and the wiring
you used. To use it we have to use IDE software.

Arduino is used by students, professionals and others to perform various functions for their
projects daily which includes simple and complex instructions as well.

Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping.
All Arduino boards are completely open-source, providing its user the ability to fulfill a set of
instructions according to their needs and adapt accordingly. This is open source and hence used
widely over all the world.

PWM works with progression of DC square wave with zero to one ratio. The on time of PWM can be
very somewhere in 0 to 100%.Now, the varied power is transferred to the load, if it is passed through
the filter the given voltage would be proportional to PWM.
Figure 1: PWM Duty Cycle

Arduino IDE is software that carries a text editor for writing code and a series of toolbars to help
refine our code. The codes written in IDE are called as sketches. The sketches are typed in text
editor. Message area gives feedback as to what is happening, it can display errors. The screen
displays text form output by Arduino IDE, including error messages and other related
information. The toolbar buttons permit us to confirm and upload programs or create and save
sketches, and open the serial monitor for further details. Arduino IDE provides software library
from wiring project which give many procedures of common input and output. [9]
Figure 2: Software Interface

Arduino UNO is based on ATmega 328P.Contains 14 digital input/output pins out


of which 6 are for PWM and 6 analog inputs also a 16MHz quartz crystal a USB
connection port and the power port on the other side it has small reset button and
an ICSP header. The maximum resolution of its PW M is 10bit such that it can
make 1024 intervals in a cycle. If we use 8 bit cycle it will use 256 equal intervals
and if we use 4 it will use only 32 intervals. So we can say that Arduino has all the
things which a micro-controller should have.
divide a half sine wave into ‘n’ sections(segments) to generate PWM signals according to the
average value of each section. If T is the time for complete cycle of Sine wave, T/2 is the time
for a half cycle, and T/2n is the time for each section. We update the PWM Values (the number
of intervals constituting the ON-time) after every T/2n time to generate a Sinusoidal PWM for a
half cycle. The other half cycle is generated by reversing the order of the sections constituting
the half cycle
I have used 50 Hz frequency in this project. 50 Hz means time period of sine wave will be 20ms
and the time period of half cycle will be 10 ms, which is used for both positive and negative
cycles. But the total time of all pulses should be equal to 10ms (time period of half cycle of sine
wave).

Load the Code to PIC Microcontroller:


 Connect your Arduino using the USB cable.

 Choose Tools→Board→Arduino Uno to find your board in the Arduino menu.

 Open the Arduino software. This shows the menu bar with file, functions, open, save and setting
options.

 You have to choose the serial port on which it is connected

 Now to go to upload button


Figure 3: Programming Flow Chart
3.2 Description of Programming Flow Chart:
1. First we initialize the variables.
2. Then set the
3. duty cycle.
4. Call the function of the duty cycle.
5. Then increment in the duty cycle.
6. If the duty cycle is less than or equal to 100 percent, then call function of the duty cycle.
Ifnot, then decrement in the duty cycle and then call the function.
7. If the duty cycle is greater than or equal to zero then decrement the duty cycle, if not then call
the function.

Resistive power control circuit is not power efficient so mostly PWM controller circuits are used.
If a PWM signal is passed through a filter, the resultant output is the dc voltage which varies
proportionally with the duty cycle of the PWM.The Arduino is working here for producing for
control signals for driver circuitry. We have two square waves and two level PWM at 180
degrees which are out of phase. For controller to give the desired output it has to be
programmed. This is a simple concept implemented with Arduino. For instance, we have 50Hz
sinusoid with unity magnitude and it is multiplied by impulse train of 5000Hz so we have
complete cycle of sinusoid contains 100 impulses 5000Hz can be produce in the same fashion. [4]

S-ar putea să vă placă și