Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
COURSE
O-149
Project Report On
Guide: Syndicate:
Lt Cdr Kulveer Singh Lt NR Karunaratne
Lt PU Prabhu
Lt Nitish Awasthi
1
Design and implementation of FPGA based musical fountain
Acknowledgement
1. We sincerely thank our project guide Lt Cdr Kulveer Singh who guided us in
carrying out project successfully. His knowledge on the subject helped us to cross
many hurdles, which we faced time to time during the completion of the project.
2. We convey our gratitude to the staff of FTP, LES who directly or indirectly
helped in successful completion of this project. A special word of thanks is rendered
to SI FTP who motivated us to achieve the newer horizons in the project.
2
Design and implementation of FPGA based musical fountain
Certificate of Merit
This is to certify that under mentioned officers of ‘O’-149 have successfully completed
the project “Design and implementation of FPGA based musical fountain” and have
been able to achieve the desired results as a partial fulfillment of requirements for ‘L’
specialisation at INS Valsura.
The project report compiled by them is an indication of the successful completion of the
project under my guidance.
(Kulveer Singh)
Lieutenant Commander
Project Guide
3
Design and implementation of FPGA based musical fountain
CONTENTS
CHAPTER INDEX
2. Introduction
1O. Conclusion
Appendix :
1. Wiring diagram
4
Design and implementation of FPGA based musical fountain
CHAPTER 1
6
Design and implementation of FPGA based musical fountain
CHAPTER 2
INTRODUCTION
INTRODUCTION
7
Design and implementation of FPGA based musical fountain
The various units of the system are
1. Audio unit
2. Musical Intensity Divider unit
3. FPGA Controller unit
4. Interfacing unit
5. Pumps
Audio unit consists of a musical player which acts as main input for control unit.
The fountain controller unit consists FPGA. Musical intensity divider circuit is
used to determine the intensity of incoming audio signal and output is given to FPGA.
FPGA controls the pumps
The fountain control unit is capable of controlling the water performance. The
fountain control system includes variable speed pumps which are used to control the flow
of water through the discharge conduits and ultimately the height of the stream of water
projected by the discharge outlet. The fountain control system is capable of varying the
speed of the pumps in accordance with an audio input signal and thereby control the
height of the stream of water. The fountain control system has the added ability of
providing a unique performance based on different pieces of music without the need of
reprogramming.
Fountain consists of pumps and piping arrangements. The pumps are controlled
by control unit.
8
Design and implementation of FPGA based musical fountain
CHAPTER 3
9
Design and implementation of FPGA based musical fountain
Musical Musical FPGA
player intensity Controller
divider circuit Unit
The main function of the musical fountain is that the fountain pattern has
to change according to the musical intensity of the musical note.
The function of the of the musical intensity divider circuit is to sort the
musical intensity of note into various level and give the output of the maximum intensity
at the particular instantaneous time.
The brain of the project is the FPGA. The function of the FPGA is to
generate pulses which run the pumps through MOSFET’s . The pulses are generated
according to the intensity of the musical note. The programming of the FPGA is done in
such a way that according to a particular intensity of the musical note a set of pulses is
given to run the pumps. For each intensity a particular code will be executed.
10
Design and implementation of FPGA based musical fountain
CHAPTER 4
11
Design and implementation of FPGA based musical fountain
The function of the of the musical intensity divider circuit is to sort the musical
intensity of note into various level and give the output of the maximum intensity at the
particular instantaneous time.
The circuit contains its own adjustable reference and accurate 10-step
voltage divider. The low-bias-current input buffer accepts signals down to ground, or V-,
yet needs no protection against inputs of 35V above or below ground. The buffer drives
10 individual comparators referenced to the precision divider. Indication non-linearity can
thus be held typically to 1/2%, even over a wide temperature range.
Versatility was designed into the LM3914 so that controller, visual alarm,
and expanded scale functions are easily added on to the display system. The circuit can
drive LEDs of many colors, or low-current incandescent lamps. Many LM3914s can be
“chained” to form displays of 20 to over 100 segments. Both ends of the voltage divider
are externally available so that 2 drivers can be made into a zero-center meter.
14
Design and implementation of FPGA based musical fountain
The interfacing of LM3914 to FPGA is done through Optocoupler F817.
Optocoupler acts as an isolator. The optocoupler has a LED inside it which is supplied by
output of LM3914. The LED provides the gate signal to the transistor inside F817 which
gives the required the required voltage to the FPGA pin.
The output of the LM3914 is given to the J2 6pin accessory header to the pins F7,
E7, B6.
15
Design and implementation of FPGA based musical fountain
CHAPTER 6
16
Design and implementation of FPGA based musical fountain
Key Components and Features
Slide Switches
17
Design and implementation of FPGA based musical fountain
The Spartan®-3E FPGA Starter Kit board has four slide switches, as shown in
Figure .The slide switches are located in the lower right corner of the board and are
labeled SW3 through SW0. Switch SW3 is the left-most switch, and SW0 is the right-
most switch.
Operation
When in the UP or ON position, a switch connects the FPGA pin to 3.3V, a logic
High.When DOWN or in the OFF position, the switch connects the FPGA pin to ground,
a logic Low. The switches typically exhibit about 2 ms of mechanical bounce and there is
no active debouncing circuitry, although such circuitry could easily be added to the FPGA
designprogrammed on the board.
18
Design and implementation of FPGA based musical fountain
As shown in Figure , the Spartan®-3E FPGA Starter Kit board supports three primary
clock input sources, all of which are located below the Xilinx logo, near the Spartan-3E
logo.
• Clocks can be supplied off-board via an SMA-style connector. Alternatively, the FPGA
can generate clock signals or other high-speed signals on the SMA-style connector.
• Optionally install a separate 8-pin DIP-style clock oscillator in the supplied socket.
19
Design and implementation of FPGA based musical fountain
The Spartan-3E Starter Kit includes embedded USB-based programming logic
and an USB endpoint with a Type B connector. Via a USB cable connection with the host
PC, the iMPACT programming software directly programs the FPGA, the Platform Flash
PROM, or the on-board CPLD. Direct programming of the
parallel or serial Flash PROMs is not presently supported.
Expansion Connectors
The Spartan®-3E FPGA Starter Kit board provides a variety of expansion
connectors for easy interface flexibility to other off-board components. The board
includes the following I/O expansion headers.
• A Hirose 100-pin edge connector with 43 associated FPGA user-I/O pins, including
up to 15 differential LVDS I/O pairs and two Input-only pairs
The 6-pin accessory headers provide easy I/O interface expansion using the
various Digilent Peripheral Modules. The location of the 6-pin headers is provided in
Figure.
21
Design and implementation of FPGA based musical fountain
Header J1
The J1 header, shown in Figure is the top-most 6-pin connector along the right
edge of the board. It uses a female 6-pin 90° socket. Four FPGA pins connect to the J1
header,FX2_IO<4:1>. These four signals are also shared with the Hirose FX2 connector.
The board supplies 3.3V to the accessory board mounted in the J1 socket on the bottom
pin.
J1
Spartan-3E FPGA
FX2 101
B4
FX2 102
A4
3.3V
FX2 103
D5
FX2 104
C5
GND
3.3 V
Header J2
The J2 header, shown in Figure is the bottom-most 6-pin connector along the right
edge of the board. It uses a female 6-pin 90° socket. Four FPGA pins connect to the J2
header, FX2_IO<8:5>. These four signals are also shared with the Hirose FX2 connector.
The board supplies 3.3V to the accessory board mounted in the J2 socket on the bottom
pin.
J2
Spartan-3E FPGA
FX2 105
A6
FX2 106
B6
3.3V
FX2 107
E7
22
B7and implementation of FPGA based musical fountain
Design
FX2 108
GND
3.3 V
Header J4
The J4 header, shown in Figure 15-10, is located immediately to the left of the J1 header.
It uses a 6-pin header consisting of 0.1-inch centered stake pins. Four FPGA pins connect
to the J4 header, FX2_IO<12:9>. These four signals are also shared with the Hirose FX2
connector. The board supplies 3.3V to the accessory board mounted in the J4 socket on
the bottom pin.
J4
Spartan-3E FPGA
FX2 109
D7
FX2 110
C7
3.3V
FX2 111
E8
FX2 112
F8
GND
23
Design and implementation of FPGA based musical fountain
3.3 V
CHAPTER 7
24
Design and implementation of FPGA based musical fountain
INTRODUCTION TO VHDL
PROGRAMMING
INTRODUCTION TO VHDL
PROGRAMMING
25
Design and implementation of FPGA based musical fountain
VHDL is not a case sensitive language. One can design hardware in a VHDL IDE
(such as Xilinx or Quartus) to produce the RTL schematic of the desired circuit. After
that, the generated schematic can be verified using simulation software (such as
ModelSim) which shows the waveforms of inputs and outputs of the circuit after
generating the appropriate testbench. To generate an appropriate testbench for a particular
circuit or VHDL code, the inputs have to be defined correctly. For example, for clock
input, a loop process or an iterative statement is required.
The key advantage of VHDL when used for systems design is that it allows the
behavior of the required system to be described (modeled) and verified (simulated) before
synthesis tools translate the design into real hardware (gates and wires).
A final point is that when a VHDL model is translated into the "gates and wires"
that are mapped onto a programmable logic device such as a CPLD or FPGA, then it is
the actual hardware being configured, rather than the VHDL code being "executed" as if
on some form of a processor chip.
CHAPTER 8
The program is so designed that the PWM signals are varied according to the
intensity of the incoming audio signal. The PWM signals are sent to the ports of header J1
and J2 pins A6,C5,D5. The following program is executed when the FPGA receives the
input signal.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity sp3etest is
Port ( clk : in std_logic;
key : in std_logic_vector(3 downto 0);
bits : in std_logic_vector(2 downto 0);
led : out std_logic_vector(2 downto 0);
Pump : out std_logic_vector(2 downto 0));
end sp3etest;
process(clk,clk_scaler)
begin
if clk = '1' and clk' event then
clk_scaler <= clk_scaler + '1';
end if;
end process;
begin
if Pwm_Clk = '1' and Pwm_Clk' event then
pwm_count <= pwm_count + 1;
end if;
end process;
begin
for i in 0 to 2 loop
if(pwm_count < Pump_Val(i)) then
Pump(i) <= '1';
led(i) <= '1';
else
Pump(i) <= '0';
led(i) <= '0';
end if;
end loop;
end process;
process (key,bits,Pump_Val,dly)
begin
if dly = '1' and dly' event then
if key(3) = '1' then
if key = "1000" then
Pump_Val(0) <= "00000000";
Pump_Val(1) <= "00000000";
Pump_Val(2) <= "00000000";
elsif key = "1001" then
28
Design and implementation of FPGA based musical fountain
Pump_Val(0) <= "10111111"; --75%
else
if bits = "111" then
29
Design and implementation of FPGA based musical fountain
CHAPTER 9
30
Design and implementation of FPGA based musical fountain
INTERFACING FPGA TO MOSFET
The output of the FPGA is given to the J2 6pin accessory pin A6 and J1 6pin
accessory header to the pins C5,D5.
CHAPTER 1O
CONCLUSION
32
Design and implementation of FPGA based musical fountain
Conclusion
The aim of this project to design and implement FPGA based musical fountain has
been acheived. The pump varies its speed according to the musical note. FPGA acts as the
controller of the fountain and it is achieved by VHDL programme. Three pumps can be
controlled using the FPGA
33
Design and implementation of FPGA based musical fountain
APPENDIX
34
Design and implementation of FPGA based musical fountain
Wiring Diagram
35
Design and implementation of FPGA based musical fountain
36
Design and implementation of FPGA based musical fountain