Mobile Function Generator Using Android

0 downloads 0 Views 333KB Size Report
Keywords: function generator; power; mobile application; audio port; android. 1. ... at the audio port of the phone then need to be interfaced to the CRO or to a.
Available online at www.sciencedirect.com

ScienceDirect Procedia Computer Science 00 (2014) 000–000 www.elsevier.com/locate/procedia

ICAC3’15

Mobile Function Generator Using Android Elijah Mathewa, Dr. Sunil Karamchandanib, Mr. T.D. Biradar c a

Student, Department of Electronics and Telecommunication, D.J. Sanghvi College of Engineering,Tel:+91-9969378804 Email: [email protected] b Assistant Professor, Department of Electronics and Telecommunication, D.J. Sanghvi College of Engineering,Tel:+91-9969378804 Email:[email protected] c Assistant Professor, Department of Electronics and Telecommunication, D.J. Sanghvi College of Engineering,Tel:+91-9969378804 Email:[email protected]

Abstract The project attempts to create a cell-phone application using Android in order to implement a function generator which generates different A.C. sources (like sine, sawtooth and square) so as to power different circuits. Function generators are available only in labs. Hence, if implemented on phone which is commonly available, it can be used extensively at home or on field. The audio port capability of the cell-phone is also explored in more detail. Replacing the function generator used in the lab with the android based function generator in times of emergency is the ultimate aim of the project and ways and means to accommodate the same along with extensive programming is the scope of this project. © 2015 The Authors. Published by Elsevier B.V. Peer-review under responsibility of organizing committee of the 4th International Conference on Advances in Computing, Communication and Control (ICAC3’15). Keywords: function generator; power; mobile application; audio port; android

1. Introduction Researchers and on-field engineers face an acute need for a function generator generating sinusoidal waves of different frequencies. These needs usually occur in remote areas (i.e. at home, on-field, etc) where labs cannot be easily accessed. Also, if a large number of function generators are needed, it is impossible to meet large demands in short intervals of time. The high cost and the bulkiness of function generators makes it impossible and unnecessary for researchers to buy these function generators for their personal use. Also, the physical transfer of function generators can pose a threat to the safety of the function generators.

1877-0509 © 2015 The Authors. Published by Elsevier B.V. Peer-review under responsibility of organizing committee of the 4th International Conference on Advances in Computing, Communication and Control (ICAC3’15).

2

Author name / Procedia Computer Science 00 (2014) 000–000

These problems led me to consider for a portable alternative. There was only one device which was universally in the hands of almost every individual, i.e. a cell phone. Hence, if a function generator is implemented on the cell phone, then every researcher could possess a function generator on their phone in times of need. The outburst of android devices in the last few years have given rise to the use of smart phones worldwide. Android software being freeware also greatly boosted the chances of combining the two different worlds of Telecommunication devices (like function generator) and software (like android and java programming). Thus, this project aims at implementing the function generator on the cell-phone using the android platform. Thus, this option provides solution to all the problems mentioned above i.e. Researchers and on-field engineers can use the function generators on their cell at any hour without having to approach labs. The high cost and bulkiness are cut down making it a zero-cost approach. Also, this is a highly portable and safe option. If function generators are required in large numbers, it is easily made available to all through the android market. There are also some disadvantages which will be acutely evident but as said before, this application is not a replacement to the traditional function generator but a great boon when it is unavailable and inaccessible. The range of frequencies over which this application works is the biggest disadvantage as it is designed only for audio frequencies (from 20 Hz to 20,000 Hz). The fact that not more than 2-3 volts are obtainable is another inherent disadvantage. This is because the power of the battery of the cell-phone is used and hence high power cannot be generated. Hence, the traditional function generators in the labs can never be replaced. The applications of the function generator on-field are many, some of which are as follows: the set up of digital devices and their hold can be tested, receiver/wireless sections comprising of RF and IF are tested and calibrated, amplifiers are tested for gain and for compression point of 1dB, the differential outputs are configured in sweep mode, the drift of oscillator effect is determined on a circuit, the design margins of circuit boards driven by clock are tested. It can be used as a local oscillator. Receiver response can also be tested by using it as an RF exciter after modulating it.[1] Our project mainly consists of 3 phases: i.

Generating sinusoidal, sawtooth and square waveforms of varying frequencies using java

ii.

These waveforms generated then need to be transmitted to the audio port of the phone using Android capabilities and hardware along with Android and java coding

iii.

The waveforms now available at the audio port of the phone then need to be interfaced to the CRO or to a working project

2. Waveform Generation Using Java Step 1 of the project involves generating sinusoidal, sawtooth and square waveforms each of varying frequencies. If a sinusoidal wave of one frequency can be generated, then by creating a variable potentiometer (knob) on the display of the phone, the frequencies can be varied thus generating sinusoidal waves of varying frequencies. Here is a thread which generates a sinusoidal wave of single frequency. Thus, through the following thread, we have generated a sinusoidal wave of 19 KHz.

Author name / Procedia Computer Science 00 (2014) 000–000

3

Figure 1: Thread generating sinusoidal wave of single frequency

The sawtooth wave and the square wave too of a single frequency can also be generated by java by manipulating the functions in the above thread but it is not yet implemented and will be done in due course of time. Now, in order to generate the same sinusoidal, sawtooth and square waves of varying frequencies, a java code for a variable potentiometer (knob) is written in which as the pot rotates, the frequencies vary resulting in waves of varying frequencies. Knob.java file is written which forms a visible knob on the screen of the phone and manipulation of the vertical and horizontal distances of the pointer of the knob will specify a particular scale and using this scale, we can generate frequencies which can be used in generating the waves. The scale generated is used to formulate frequency in the following manner: Figure 2. Scale generated used to formulate frequency

4

Author name / Procedia Computer Science 00 (2014) 000–000

3. Android Encapsulation The java codes for generation of sinusoidal, sawtooth and triangular waves have been written but they cannot be used on the smart phone without encapsulating the java code into the android environment. The android environment consists of mainly the AndroidManifest.xml. It is necessary that every application should have an AndroidManifest.xml file (having that same name) in its root directory. The more important informations about the application is given by the Manifest file to the Android system. The system should possess this information before any of the application's code could be implemented. There are many functions the manifest does, a few of them are as follows [2-4]: 

The Java package is named by the Manifest file. The application requires a unique identifier. This is provided by the package name.



The different application components are described by the AndroidManifest file — especially the activities, broadcast receivers, services, and content providers. These components make up the content of the application.



The classes are also named by Manifest file. These classes implement each component and also the capabilities of the components are published (for example, the type of intent messages which can be handled). The Android system is made aware of the components and the conditions under which they can be launched through the declarations.



The processes which host the application components are determined by the Manifest file.



There are permissions which are mandatory for the application if it wishes to access certain protected API parts. These are listed by the Manifest file. Also interactions with other applications are declared by these permissions.



There are certain permits which others are supposed to have in order to ensure interaction with the components of the application which are also declared by Manifest file.



The Instrumentation classes are listed which provide profiling information during the run time of the application. These declarations are cut off before the publishing of the application. During the development and testing of the application, they are written in the manifest itself.



The application requires a minimum level of Android API. This is declared by the Manifest file.

The libraries are listed by the Manifest file which must be linked by the application.

4. Interface With CRO One such method used by [5], makes use of the audio port. A tone was generated at the audio port pin and signal available was processed further. This is one of the types of harvesting where 7.4 mW power is delivered to the load having an efficiency of 47% using components and that costs about $ 2.34 in volume of 10K [5].Using the audio port appeared to be advantageous since the microphone pin can be used for feedback mechanism back to the mobile. Standard audio port pin configuration is as shown in the figure 3. There are multiple research and engineering challenges when the headset port is used to power and communicate with external peripherals. The output voltage signal given by the headset is very low, which is more often than not lower even than typical transistor threshold voltages. To be useful, it must be converted to a higher voltage using energy harvesting and voltage boosting circuit that can operate with input AC voltages in the 200mV range.

Author name / Procedia Computer Science 00 (2014) 000–000

5

Figure 3: Standard configuration of audio port

There is a limit in the voltage headroom, hence it is difficult to implement simple rectification without considerable power losses, and in some cases, it may be required to implement maximum power point tracking. There is a codesign problem iteratively presented when the audio waveform ideally produced is matched against the cost, efficiency of conversion and complexity of the circuit harvested.[5-6] In the harvesting technique used above maximum power transfer is occurring at a RMS voltage of 240 mV and it delivers 66.0 mA, when connected to a load impedance of 3.6. We have made use of a Samsung GT-S5570. For a Samsung GT-S5570, android Signal Generator produces 550Vpp. SineWaveGeneration.java generates the sine wave using the function Math.sin(angle) which returns the sine of the angle given in the input. An array is defined having name “samples” and type float which keeps storing the values of the sinusoidal signal at specified instances. We have created an object of class AndroidAudioDevice which writes the values of the sample on the output port of the audio jack. Another java file takes the sine wave produced in SineWaveGeneration.java and sends it to the audio port of the mobile which is then converted from electrical signal to audio signal which can then be heard and seen on the CRO as shown in figure 4.

6

Author name / Procedia Computer Science 00 (2014) 000–000 Figure 4: Sine-wave generated from cell-phone displayed on CRO

The results of the square and sawtooth wave could not be put up in this paper as they are being worked upon and it would take a while for concrete results to be displayed.

Conclusion Thus, we have been able to design an application using android implementing a function generator on the cellphone of which the sine wave generated is displayed above. The square and sawtooth waves are not displayed as they are being worked upon. It is indeed a great advantage when function generators are unavailable at home or onfield. It is also highly advantageous in providing a function generator application into the hands of every researcher possessing a smart-phone. If power and other considerations are taken, then in future years, there will be no need of any function generators in the laboratory as each one will have a function generator on their phone.

Acknowledgement I would like to place on record my deep sense of gratitude to my professors (Dr. Sunil Karamchandani and Mr. T. D. Biradar) who have guided me throughout this project, for their generous guidance, help and useful suggestions. It was very kind of them to be available for all my doubts regarding the dissertation work. References 1. Dave R. New Portable signal generator ideal for field engineering applications. Signal Forge; page 80 http://www.signalforge.com/home/sf1/page_80/signalgenerator_signalsource_functiongenerator.html 2. http://developer.android.com/guide/topics/manifest/manifest-intro.html 3. Sheng KY, Sonal V, Thomas S, Prabal D. Hijacking Power and Bandwidth from the Mobile Phone’s Audio Interface. London: ACM DEV ’10; Dec 17-18, 2010 4. Lokesh KRP, Rama BRB, Rama KS. Cognitive Radio Sensor Node Empowered Mobile Phone for Explosive Trace Detection. MECS; 4th Sept, 2012