musical gloves

Download Musical Gloves

Post on 02-Jan-2016

20 views

Category:

Documents

1 download

Embed Size (px)

DESCRIPTION

Musical Gloves. Work group: Razan Qraini, Dalal Mughrabi Supervisors: Dr.Raed Alqadi , Inst.Haya Sammanah. What is Musical Gloves?. - PowerPoint PPT Presentation

TRANSCRIPT

Musical GlovesWork group: Razan Qraini, Dalal MughrabiSupervisors: Dr.Raed Alqadi, Inst.Haya Sammanah

What is Musical Gloves?This pair of Electronic Piano Gloves allows you to play music with your fingertips without touching the piano. Just slip the gloves on and you can then start playing cool music on the piano box from a distance. Each finger tip represents different music note. A fun, low cost and alternative to a real piano or keyboard.

Motivation Make playing piano easier, funnier and cooler.Build a cheap and portable piano box.Build a modern piano box that allows you to play music in one room and hear it from the other room by using bluetooth. Problem FacedHall Effect sensors were our number one challenge because they arrived too late.The size of the piano box is small, so components are very close together and it was difficult to keep a distance between wires.We need a fixed 5v voltage source, it can be provided by batteries but the problem is it drain so fast.We bought an analog hall effect sensors. But after testing them and measuring the output voltage, we found out that they work as a digital sensors (The output is either logic 0 or logic 1).Other problems appear with boot loader software program.The PIC sending data with noise to the Bluetooth module so the application keep stop working.

Features1. Playing Piano without touching

2. Playing Piano from android mobile.

3. Increase/decrease the volumeMethodologyWe use PIC-C for the microcontroller programming.

We use the eclipse for android programming. System DescriptionOur system consist of these main parts:piano box which contains on the top, the piano buttons, on each button there is a Hall Effect sensor.The microcontroller which is programmed so that it can process these sensors values and passes it to the speaker or Bluetooth module and to play the sound of each specified note.The glove with small magnets on each finger; this glove is worn by user to play music above the piano box.

Systems Hardware PartComponents of project:Hall Effect sensors.Amplifier LM324 Microcontroller PIC18F46202Voltage Regulators.Bluetooth Module RN-42

1. Hall Effect Sensor

When subjected to a magnetic field, it responds with an output voltage proportional to the magnetic field strength. The voltage output is very small (V) and requires additional electronics to achieve useful voltage levels.Need 5 volt.Low noise.The output signal from a Hall Effect Sensor is the function of magnetic field density around the device. When the magnetic flux density around the sensor exceeds a certain preset threshold, the sensor detects it and generates an output voltage called theHall Voltage,The Hall Effect provides information regarding the type of magnetic pole and magnitude of the magnetic field. For example, a south pole would cause the device to produce a voltage output while a north pole would have no effect. Linear and digital we use the digital as the strength of the magnetic field increases the output signal from the amplifier will also increase until it begins to saturate but the digital on when there is filef and off when there is no. At this project we use the analog sensor (linear) SS49E, the output voltage for this sensor according to the table below ranges from 2.25 to 2.75 when the magnetic field is zero B=0G, but when the sensor enter a magnetic field the output voltage will be zero.

92.LM324 Amplifier

Op-amps are high gain electronic voltageamplifier. The output voltage is many times higher than the voltage difference between input terminals of an op-amp. So we use it to double the sensor output voltage twice . If IN+ (input 2) is greater than IN- (input 3), the output is high, IF IN- is greater than IN+ the output is low (ground, GND).103.Microcontroller PIC18F4620

Basic circuitThe microcontroller which is programmed so that it can process these sensors values and passes it to the speaker or Bluetooth module and to play the sound of each specified note. The processor that is used in our project is microcontroller Pic18F4620. This processor has many ports; in this project we use the Port B. Though this project represent piano so we need to identify the 7 main harmonies notes ( do ,re ,mi ,fa ,so ,la ,si ) each note presented by hall effect sensor instead of button So when the first sensor activated for example the process will generate a do note using specific frequencies and play it using speaker which is connected to port D pin D0 114.Voltage RegulatorAt this project we used two voltage regulators:9v to 5v regulator: Used with microcontroller and Hall Effect Sensor.5v to 3.3v: Used for the bluetooth module circuit.

5.Bluetooth Module RN-42

Bluetooth wireless technology These modems work as a serial (RX/TX) We use the bluetooth module in our project in order to play the piano using mobile instead of using the speaker, so the bluetooth module's job here is to receive the data from the PIC which is represented by the idintifier for each note and send it to the android then the andoird recognize the identifier and play the sound related to that note. Interfacing with the pic tx >> rx ,, rx >> tx

137.The speaker

We use an amplifier in order to increase the sound of the speaker. Capacitor to eliminate the noise and We use Rheostat in order to increase and decrease the volume. We use port D pin-D0 to draw the output drom PIC.

14Microcontroller Programming Notes and OctavesMusical notes are simply sound waves of particular frequencies. Each note is played for certain duration and there is a certain time gap between two successive notesMusical notes can be generated using square waves of the note frequencies.

Notes and Octaves

Table of frequncies17Generating audio tones in PICCWe used this function:generate_tone(long frequency, long duration) with frequency and duration as parameter.so it generates a square wave signal on the appropriate pin, this function calculate the period of each note by using the equation:Period = (Duration / Frequency)as long as this period it not equal to zero it will play the sounds by using the delay function; do_delay(int ms_delay, int num_ms, int us_delay, int num_us)

Generates wave at set frequency (Hz) for set duration (ms) Duration=1s18Flow chart

Bluetooth Interface with PIC:

The microcontroller is required to interface with Bluetooth via UART interface. We use the printf(), this function is a library routines , it calls a routine which places characters of the printf statement in the UART buffer to get it transmitted from there to another Bluetooth device (in our case the mobile Bluetooth).Lazm n7tha bl interrupt20Android ProgrammingAndroid ProgrammingNow at this project we use the four major tasks necessary to communicate using Bluetooth: setting up Bluetooth, finding devices that are either paired or available in the local area, connecting devices, and transferring data between devices.

This project is based on mobile phone communication with the Microcontroller through Bluetooth, here we are using the Android based mobile, and to communicate with the controller we need the supporting software installed in the mobile phone. Connect the Bluetooth module with microcontroller using the serial port communication.The Android platform includes support for the Bluetooth network stack, which allows a device to wirelessly exchange data with other Bluetooth devices

22Android ProgrammingClasses and interfaces we used to create Bluetooth connections:1. Bluetooth Permissions2. Setting up Bluetooth3. Finding Devices4. Connecting Devices5. Managing a Connection

>> At this project we will receive the data from PIC's Bluetooth using mBluetoothSPPConnection.read()

In order to use Bluetooth features in the application, we need to declare Bluetooth permissions:2. Before application can communicate over Bluetooth, we need to verify that Bluetooth is supported on the device, and if so, ensure that it is enabled.,,,, BluetoothAdapter which represents the local Bluetooth adapter and Enable Bluetooth

3. Using theBluetoothAdapter, we find remote Bluetooth devices either through device discovery or by querying the list of paired (bonded) devices. Device discovery is a scanning procedure (mac address and device name) but if it paired Before performing device discovery, it's worth querying the set of paired devices to see if the desired device is already known. To do so, callgetBondedDevices().

4. In order to create a connection between application bluetooth module we must open a server socket and initiate the connection (using the server device's MAC address to initiate a connection). At this point, each device can obtain input and output streams and data transfer can begin,

5. you can share data between devices. Using the BluetoothSocket, the general procedure to transfer arbitrary data is simple:Get theInputStreamandOutputStream

>> from printf

23Flow Chart

To the Demo .