Monday, November 25, 2024

Android Smartphone-Based Function Generator

Android smartphones are rapidly becoming popular in the education industry. Some can even be used as signal or function generators. Bulky signal generators available in the market are costly and complex to operate.

Android smartphones can be used as signal generators to perform basic tasks. Android-based function generators are not as advanced as standalone function generators, but these are a good option for basic applications.

This Android-based function generator output is in the range of audio frequency signals (20Hz-20,000Hz), available at the audio output port of cellphones. Most cellphones have 3.5mm audio jack output ports. You can use an audio cable with the audio jack between the cellphone and external devices or any other applications.

- Advertisement -

Signals can also be amplified using a suitable amplifier, if required, for interfacing with other devices. While interfacing with external devices, a proper protection circuit must be used to prevent any damage to the smartphone.

Android-based function generator

Android smartphones are capable of generating audio frequency range signals and tones. Digital signal processing (DSP) hardware available on Android smartphones can be used as a function generator, but with some limitations.

- Advertisement -

Functions available on the smartphone-based function generator are square wave, sine wave, triangular waveforms, sawtooth-wave and supported frequency range from 20Hz to 20,000Hz. Signals generated using an Android smartphone can be tested using a digital storage oscilloscope (DSO) and Windows PC-based CRO software (Zelscope).

Requirements for function generation

  1. Android smartphone
  2. Internet access to download apps from Play Store
  3. One of the following apps: Function Generator, Frequency Generator, Tone Generator, Sound Generator and Impulse—all available for free download on Play Store

Requirements for testing

  1. DSO
  2. Windows-based CRO software
  3. USB sound card
  4. Audio cable for connection with PC
  5. AUX cable for connection with DSO

Function Generator app installed on Android smartphone along with audio and crocodile cables for connection to DSO is shown in Fig. 1.

Function Generator app installed on Android smartphone along with crocodile cables
Fig. 1: Function Generator app installed on Android smartphone along with crocodile cables

Steps to perform signal generation

Function Generator app

Download Function Generator app by Keuwlsoft from Play Store, and install it on your smartphone. Function Generator app running on ca ellphone is shown in Fig. 2.

Function Generator app
Fig. 2: Function Generator app
  1. Select channel for signal (CH1 or CH2).
  2. Select waveform, such as sine, triangular or square. Select CH1 (channel) and sinewave (waveform), as shown in Fig. 3.
  3. Select FREQ block and adjust frequency using sa lider or text input box.
  4. Select OUT from OUTPUT section, as shown in Fig. 4.
  5. Corresponding function output signal will be available at audio OUT of the cellphone. You will be able to hear the frequency sound in the loudspeaker of your phone or headphone if connected to the phone.
  6. You can use a 3.5mm audio jack at cellphone audio OUT to connect to an external device, as mentioned above.
  7. You can add noise to the generated signal.
  8. Options are also available for modulating the waveform using FM or AM, as shown in Fig. 5.
  9. VOL is used for increasing or decreasing the volume in OUT section.
  10. You can provide range in output signal using START and STOP options in SWEEP section. The slider can be used to change mode in SWEEP settings.

AM signal of amplitude-modulated sinewave on DSO is shown in Fig. 6.

Select channel and waveform
Fig. 3: Select channel and waveform
Select OUT for output signal
Fig. 4: Select OUT for output signal
FM and AM modulation
Fig. 5: FM and AM modulation
AM signal of amplitude modulated sinewave as observed on oscilloscope
Fig. 6: AM signal of amplitude modulated sinewave as observed on oscilloscope

Sound Generator app

Sound Generator app (from Alok Mandavgane) is another option for sawtooth-wave, square-wave, triangular-wave and sinewave signals. White noise generation option is also available on this app. The Output is available at the phone’s loudspeaker.

The app has a simple interface and is easy to understand. Frequency and volume control sliders are provided at the top of the app, and function type settings are provided at the bottom, as shown in Fig. 7.

522Hz square-wave signal using Sound Generator app
Fig. 7: 522Hz square-wave signal using Sound Generator app

It supports signal range from 20Hz to 20,000Hz. Select the frequency and switch on/off button to activate the signal and then select the type of wave-like sinewave, square-wave and so on. A 522Hz square-wave signal generated using the Sound Generator app is shown in Fig. 7.

Testing the signals on DSO

Signals can be tested or analysed on a standalone digital oscilloscope, or PC-based oscilloscope software. Follow the steps given below for testing the signals on DSO. Connections with DSO are shown in Fig. 8.

 DSO used to observe output of the signal generator from Android app
Fig. 8: DSO used to observe output of the signal generator from Android app

Connect DSO with Android phone’s 3.5mm jack using suitable cables (aux and crocodile).

  1. Check values and signal waveforms on DSO.
  2. 440Hz sinewave and 537Hz square-wave signals generated by Signal Generator app as observed on DSO are shown in Fig. 9 and Fig. 10, respectively. (Note that, 3.5mm jack aux cable can cause some distortions in signals on DSO.)
    440Hz sinewave output as observed on oscilloscope
    Fig. 9: 440Hz sinewave output as observed on oscilloscope

    537Hz square-wave output as observed on oscilloscope
    Fig. 10: 537Hz square-wave output as observed on oscilloscope

Testing the signals on PC

You can also use PC-based CRO software, such as Zelscope Demo Version, to analyse the generated signals mentioned above. Frequency signal values and waveforms are obtained on Zelscope software.

A USB sound card is used in this case, as it minimises any damage caused to the internal sound card of the PC if a high-value signal is applied. Options to save waveform images and text values are also available in this software.

Connect the audio jack from the cellphone output port to the microphone port of the laptop/PC. If the waveform is not obtained on Zelscope software, adjust the microphone settings on the PC.

Analysis of 440Hz sinewave signal

The output from the 3.5mm jack of Android smartphone is given to the PC through a USB sound card. A 440Hz sinewave signal generated on Android app, which is to be analysed on Zelscope, is shown in Fig. 11.

440Hz sinewave signal
Fig. 11: 440Hz sinewave signal

The 440Hz sinewave signal tested on Zelscope software is shown in Fig. 12.

Frequency captured on Zelscope software
Fig. 12: Frequency captured on Zelscope software

Analysis of 440Hz square-wave signal

Similarly, a 440Hz square-wave signal generated using the Android App and its corresponding frequency on Zelscope software is shown in Fig. 13.

Square-wave signal obtained on Zelscope software
Fig. 13: Square-wave signal obtained on Zelscope software

Noise generated on the PC-based software is less than that observed on the DSO. It can be minimised using a good audio signal source and good-quality cable.

Caution

Use a proper protection circuit while connecting an Android smartphone to the PC for Function Generator application. It is recommended to use a USB sound card instead of directly connecting the smartphone audio output to mic/audio input of the PC or laptop.


Madhuram Mishra is pursuing ME (digital communication) from NITTTR, Bhopal. He has keen interests in circuit design and Arduino boards.

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Electronics News

Truly Innovative Electronics

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics