Mechatronics project
GENERATING A SINE WAVE BY USING A MICROCONTROLLER
1
Background
 Microcontroller is basically a device which is used as an interface between the physical system and
computer software
 A microcontroller is a small and low-cost computer built for the purpose of dealing with specific tasks,
such as displaying information in a microwave LED or receiving information from a television’s remote
control. Microcontrollers are mainly used in products that require a degree of control to be exerted by
the user.
 Invention of Microcontrollers. It was during 1970 and 1971 when Intel was working on inventing the
world's first microprocessor, that Gary Boone of Texas Instruments was working on quite a similar
concept and invented the microcontroller
2
Arduino : microcontroller
 We have use 8 bit Arduino uno microcontroller its specifications are given below
 Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino board are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online. we can tell our board what to do by sending a set of instructions to the
microcontroller on the board. To do so we use the Arduino programming language(based
on Wiring) and the Arduino Software (IDE) based on processing.
3
Arduino
Arduino uno Arduino nano
4
Circuitry
 Arduino uno microcontroller
 Nano arduino microcontroller
 Connecting cable
 Bread board
 USB cable
 470 microF Capicitor
 Jumper wires
 LED
5
PWM (pulse with modulation)
 Pulse Width Modulation, or PWM, is a technique for getting analog
results with digital means. Digital control is used to create a square wave,
a signal switched between on and off. This on-off pattern can simulate
voltages in between full on (5 Volts) and off (0 Volts) by changing the
portion of the time the signal spends on versus the time that the signal
spends off. The duration of "on time" is called the pulse width.
6
PWM (cont.)
7
Program for sine wave in Arduino Uno
int op=5;
float ip=A0;
float x;
float z;
void setup() {
pinMode (op,OUTPUT);
pinMode (ip,INPUT);
Serial.begin(9600);
}
8
Program for sine wave
void loop()
{ for ( x = 0; x <360; x++)
{
z=sin(x*PI/45);
z=(z+1)/2*255;
analogWrite(op,z);
z=analogRead(ip);
z=((z-1024)/512)+1;
Serial.println(z);
delay (20);
} }
9
Program for displaying sine wave in nano
arduino
int sen=A2;
void setup()
{
Serial.begin(9600);
pinMode(sen,INPUT);
}
void loop()
{
int j=analogRead(sen);
Serial.println(j);
}
10
Description of work
 First we arrange an arduino kit containing Arduino microcontroller ,Nano
microcontroller , breadboard ,capacitor ,LED and jumper wire.
 We install the program in microcontrollers with the help of arduino software.
 With the help of capacitor we generate a sine wave and display its characterstics
on the arduino software plotter
 We use nano micro controller for displaying output wave
11
Result :
 We generate sine wave
12
Conclusion :
Microcontroller can generate sine wave as well as many other wave forms
And we can use microcontroller for many other uses
13
Reference :
 https://www.arduino.cc/en/Tutorial
 https://www.youtube.com/watch?v=GclZjwfnnDM
 https://www.arduino.cc/en/Tutorial/PWM
14
Contribution:
 Manvendra singh kushwah
 Rahul agrahari
 Lokesh meena
 Naveen kumar
 Mukul kumar
 Keshav mayor pandey
 Arpit sharma
15

Arduino Information by Arpit Sharma

  • 1.
    Mechatronics project GENERATING ASINE WAVE BY USING A MICROCONTROLLER 1
  • 2.
    Background  Microcontroller isbasically a device which is used as an interface between the physical system and computer software  A microcontroller is a small and low-cost computer built for the purpose of dealing with specific tasks, such as displaying information in a microwave LED or receiving information from a television’s remote control. Microcontrollers are mainly used in products that require a degree of control to be exerted by the user.  Invention of Microcontrollers. It was during 1970 and 1971 when Intel was working on inventing the world's first microprocessor, that Gary Boone of Texas Instruments was working on quite a similar concept and invented the microcontroller 2
  • 3.
    Arduino : microcontroller We have use 8 bit Arduino uno microcontroller its specifications are given below  Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino board are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. we can tell our board what to do by sending a set of instructions to the microcontroller on the board. To do so we use the Arduino programming language(based on Wiring) and the Arduino Software (IDE) based on processing. 3
  • 4.
  • 5.
    Circuitry  Arduino unomicrocontroller  Nano arduino microcontroller  Connecting cable  Bread board  USB cable  470 microF Capicitor  Jumper wires  LED 5
  • 6.
    PWM (pulse withmodulation)  Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. 6
  • 7.
  • 8.
    Program for sinewave in Arduino Uno int op=5; float ip=A0; float x; float z; void setup() { pinMode (op,OUTPUT); pinMode (ip,INPUT); Serial.begin(9600); } 8
  • 9.
    Program for sinewave void loop() { for ( x = 0; x <360; x++) { z=sin(x*PI/45); z=(z+1)/2*255; analogWrite(op,z); z=analogRead(ip); z=((z-1024)/512)+1; Serial.println(z); delay (20); } } 9
  • 10.
    Program for displayingsine wave in nano arduino int sen=A2; void setup() { Serial.begin(9600); pinMode(sen,INPUT); } void loop() { int j=analogRead(sen); Serial.println(j); } 10
  • 11.
    Description of work First we arrange an arduino kit containing Arduino microcontroller ,Nano microcontroller , breadboard ,capacitor ,LED and jumper wire.  We install the program in microcontrollers with the help of arduino software.  With the help of capacitor we generate a sine wave and display its characterstics on the arduino software plotter  We use nano micro controller for displaying output wave 11
  • 12.
    Result :  Wegenerate sine wave 12
  • 13.
    Conclusion : Microcontroller cangenerate sine wave as well as many other wave forms And we can use microcontroller for many other uses 13
  • 14.
    Reference :  https://www.arduino.cc/en/Tutorial https://www.youtube.com/watch?v=GclZjwfnnDM  https://www.arduino.cc/en/Tutorial/PWM 14
  • 15.
    Contribution:  Manvendra singhkushwah  Rahul agrahari  Lokesh meena  Naveen kumar  Mukul kumar  Keshav mayor pandey  Arpit sharma 15