Вы находитесь на странице: 1из 7

A Quick and Dirty Function Generator

ELP 305 : Design and System Laboratory


Ritik Vijayvergiya : 2014EE10479
Utkarsha Agwan : 2014EE10492
Shubham Malhotra : 2014EE30537
March 1, 2017

Date Performed: February 16 & 23, 2017


Instructor: Professor Subrat Kar & Professor SMK Rahman

List of Figures
1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Sine Wave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Square Wave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 Triangular Wave . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6 Different Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1 Objective
Producing simple waveforms using a microcontroller (effectively making a simple
function generator)

1.1 Problem Statement


To design a simplified function generator using UART and PWM (Op Amp
required). Then, we use a LED matrix to show the waveform keeping a constant
timescale.

1.2 Going Further


a. To use our design to make a simple function generator where we can
display X and Y axis (suitably auto-scaled) and control the frequency,
phase and amplitude of the signal by adding the necessary controls.

1
b. Play with producing the Lissajous pattern for two sine waves (First feed
the same sine wave into both channels of a oscilloscope Then Produce two
different sine waves and feed them to a 2-channel oscilloscope.)

2 Apparatus
We used the following equipments and machines :

• Arduino • Connecting wires


• LED Matrix Display • Potentiometer

• Push button • Op-amp 741


• Breadboard • Arduino Code Editor Software

3 Challenges Faced
a. It was easy to draw the wave but difficult to make it moving i.e. a real
function, we took up this challenge and created a moving pattern rather
than just drawing the wave.
b. Implementing varying frequency other parameters model.

c. Another challenge we faced was initialisation error in Arduino where we


needed to remove 2 pins and then upload our code.
d. Debugging posed yet another challenge as the code was quite long & com-
plex.

4 Block Diagram for Interfacing


For block diagram refer figure 1 on page 3

5 Circuit Diagram
For circuit diagram to connect GLCD to Arduino refer figure 2 on page 4 (4)

2
Figure 1: Block Diagram

3
Figure 2: Circuit Diagram

6 Flowchart for Code

4
7 Observations
The GLCD screen displays the function depending upon the user demand.

a. In the figure 3 on page 5, is the display of sinusoidal function on GLCD.


b. In the figure 4 on page 6, is the display of square wave function on GLCD.

c. In the figure 5 on page 7, is the display of triangular wave function on


GLCD.
d. In the figure 6 on page 7, demonstrates how function parameters can be
changed. It shows a sine wave with a different frequency.

Figure 3: Sine Wave

8 Conclusion & Result


We can make a basic function generator using Arduino Uno for sinusoidal func-
tions, square wave and square wave. We need GLCD to display the output.
While understanding the working of GLCD, we saw a whole range of graphics
designs we can make on a GLCD which gave us an insight where and how to
use it in future.
We also learned how we can change parameters of a function like changing the
frequency of the sine wave in our function generator.
In conclusion we succeeded in using Arduino to generate functions.

5
Figure 4: Square Wave

References
[1] Tutorial on Pulse Width Modulation. Available at https://www.arduino.
cc/en/Tutorial/PWM

[2] Tutorial on filters. Available at http://www.electronics-tutorials.ws/


filter/filter_2.html
[3] LM741 Op-amp specifications. Available at http://www.ti.com/lit/ds/
symlink/lm741.pdf
[4] Circuit Diagram. Available at https://playground.arduino.cc/uploads/
Code/GLCD_Documentation.pdf

9 Link to Code Repository


https://docs.google.com/document/d/1KozwIMKOZVydedDfyqOJBds88TLx8PR1PTRza6mLW_
A/edit?usp=sharing

6
Figure 5: Triangular Wave

Figure 6: Different Frequency

Вам также может понравиться