Smartphone Bench Instrument Apps: Disappointment or Delight?

If you are interested in electronics or engineering, you’ll have noticed a host of useful-sounding apps to help you in your design and build work. There are calculators, design aids, and somewhat intriguingly, apps that claim to offer an entire instrument on your phone. A few of them are produced to support external third-party USB instrument peripherals, but most of them claim to offer the functionality using just the hardware within the phone. Why buy an expensive oscilloscope, spectrum analyzer, or signal generator, when you can simply download one for free?

Those who celebrate Christmas somewhere with a British tradition are familiar with Christmas crackers and the oft-disappointing novelties they contain. Non-Brits are no doubt lost at this point… the crackers in question are a cardboard tube wrapped in shiny paper drawn tight over each end of it. The idea is that two people pull on the ends of the paper, and when it comes apart out drops a toy or novelty. It’s something like the prize in a Cracker Jack Box.

Engineering-oriented apps follow this cycle of hope and disappointment. But there are occasional exceptions. Let’s tour some of the good and the bad together, shall we?

The Weaknesses

There is a lot of test equipment you can download, but are they any good?
There is a lot of test equipment you can download, but are they any good?

Of course, it’s not that simple. Modern phones have plenty of processing power, but when it comes to analogue input and output they are restricted to only the hardware they need to make a telephone call. A single microphone input, and a stereo output that can drive a line input on an amplifier, or a set of headphones. Unless you have spent a lot of money on a very high-end phone targeted at audiophiles these will not be served by particularly high-end silicon, the ADC and DAC will top out at somewhere just above the CD sample rate of 44.1kHz and will not have the quietest noise performance. They will not be in any way calibrated, so the best you can hope for from your hardware in terms of measuring ability will be a bandwidth of somewhere just above 20KHz with no ability to produce or measure quantifiable voltages. To give some context, even a 5-dollar USB sound card for your PC will be capable of a higher bandwidth than that you’ll find in your phone.

Our question posed earlier in this piece then becomes “Why buy an expensive oscilloscope, spectrum analyzer, or signal generator, when you can simply download one for free that only has a 20KHz bandwidth and can’t accurately measure or produce a known voltage?” It doesn’t sound very encouraging, does it.

But looking at it another way, you can’t argue with free. If you are working at audio frequencies then perhaps they can offer something useful. Even with their limitations perhaps there are still areas in which they can deliver useful insights, and that’s what we’ll now investigate.

The Strengths

We’ve looked at the shortcomings of a mobile phone as an instrument platform, but does it have any strengths? In one respect here we are fortunate. A phone may not be able to measure voltages accurately, but it should be able to do so when it comes to frequencies and timing. All the actions of its microprocessor will be governed by a crystal oscillator, which while it won’t be calibrated to an incredible standard will still be good enough for the purposes of a free mobile phone instrument.

Even if we can’t entirely trust our phones on matters of amplitude we can do so in this field, if it returns a frequency or period reading we can believe it. Another area in which we can place some trust in our phones lies with waveform generation. Within the limitations of its DAC we know that it is designed to reproduce whatever waveforms a piece of music can supply it, so for the purposes of a very simple audio benchtop instrument we can trust it to produce the sine, square, and triangle waves we’d expect from a basic signal generator.

Having considered the likely usefulness of a mobile phone app instrument and thus having an idea of what to expect, it’s time to sit down at the bench with a phone and try a few for real. This isn’t a review of the apps themselves but a look at the feasibility of an app as an instrument, so we’ll mention a few apps but not review their individual features in detail. Our device for these tests is a Moto G4 running Android 6.0.1.

Signal Generators

The Keuwlsoft function generator.
The Keuwlsoft function generator.

We started by looking at the performance of a phone as a signal generator. There are a lot of results for a search on “signal generator” or “function generator”, one of the ones near the top was keuwlsoft’s offering, capable of producing sine, triangle, and square waves from 22kHz down to an improbable-sounding 471.16mHz, as well as a selection of noise sources and modulation effects.

Installed on the phone, it rewarded us with a tone in the speaker after the usual moment to decipher its UI. Plugging in a 3.5mm jack with a lead to our ‘scope, and we could see the three types of waveform as expected. The frequency was measured as exactly the figure in the app. At the upper end of the frequency range above 20KHz it became obvious that the waveform was diminishing and distorting, however that is probably a feature of the Moto’s audio hardware. Otherwise the amplitude stayed pretty constant over the audio range.

On the subject of amplitude, these apps are usually calibrated in percentage of the maximum amplitude they can serve, there is no voltage reading. However to give an idea of the output level, with both the in-app gain and the device volume set to maximum we measured 945mV RMS for a 1KHz sinewave. Knowing that figure it was a simple matter of setting the in-app gain to a calculated percentage to give a lower figure, for example to achieve a 500mV RMS reading we set it to 52.91%. It’s not perfect by any means, but if you have measured the output at full volume it is possible to impose some level of calibration.

Having exercised the phone’s capabilities producing waveforms, it’s time to consider its abilities measuring them. There are a variety of apps freely downloadable that offer either oscilloscope, spectrum analyzer, or a combination of both functionalities.

Input Problems

If you're very lucky, your app might have an input selection screen.
If you’re very lucky, your app might have an input selection screen.

The first thing we encountered when installing these apps was the nature of Android’s approach to audio hardware. By default these apps take their input from the microphone. Everyone who installs them probably spends a while whistling at their phone to see a nice waveform or spectrum peak appear, but sadly for our purposes a microphone is no use. We need a physical input, and you might think that could be served by the microphone input on the device’s 3.5mm jack plug. Unfortunately a modern phone is not the same as a cassette recorder of old, so we quickly discovered that simply plugging in the appropriate TRRS lead did not magically switch over from the microphone.

Instead that changeover is handled by software, and whether it works for you will depend on how lucky you are in your combination of phone, OS version, and app. We did not find any apps that recognized an audio source plugged into the jack socket by default on the Moto, though a couple of spectrum analyzer apps offered a source selection option in their settings between the built-in microphone, and the line input.

A cheap USB sound card as an Android audio input.
A cheap USB sound card as an Android audio input.

Happily there is an alternative that shouldn’t cost too much if your phone is a fairly recent one. Since version 5 there has been support in Android for USB sound cards, so if you have an OTG cable you can plug one in and reboot the phone to find its default audio input and output now come through the sound card. To test the oscilloscope apps we did this with the Moto and a cheap no-brand USB audio dongle, and it performed very reliably. It’s important to reboot the phone with it plugged in, we found it wasn’t always recognized when plugged in after reboot. It’s also worth noting that even though our USB card is capable of more than CD-quality sample rates there was no provision to enable these in any of the software.

Whichever way you get your working input to your phone, there is one further thing to beware of. A mobile phone input is designed only for use with a headset microphone for making calls, thus it expects a microphone level signal. It will top out somewhere well under 100mV, and anything above that (such as line level audio) will push it into distortion. Further, it does not have anything like the resilience of a real ‘scope input so unless you are only measuring up to about 50mV you will have to build some form of protection circuitry. Have a look at this preamplifier project for an example. For the purposes of our tests when using the Moto’s input jack we wound down our signal generator to an appropriate level for the input.

Spectrum Analyzers

The Vuche Labs spectrum analyzer when fed with a 1kHz square wave.
The Vuche Labs spectrum analyzer when fed with a 1kHz square wave.

Having now dealt with the prerequisites of getting a signal into our phone, it’s time to look at some apps to use it. Starting with a spectrum analyzer, we found that Vuche labs’ Advanced Spectrum Analyzer offered the ability to select the Moto’s 3.5mm jack as an input, and presented an interface that was easy to get working. When presented with a sine wave it obligingly produced a single peak, and on changing to a square wave it showed the harmonic content as you might expect. It consistently identified the fundamental frequency on the low side by a few Hz, for example showing a verified 1KHz as 990Hz.

On the Y axis it returns a figure in dB. As always the question is “dB relative to what?”, and the answer here appears to be relative to the maximum level quantifiable by the device. So if you have time to calibrate it against a known instrument as described above and do some calculations you could get some idea of  a real figure, however in the majority of cases this scale can at best be considered as indicative only for relative quantization of peaks.

Oscilloscopes

When looking at oscilloscope apps we tried almost every one that the Google Play Store could find for us, and none of them offered an ability to select the Moto’s 3.5mm jack that would work. It’s not to say that none of them support it on other phone and OS combinations, merely that none of them worked for us. So when testing these apps we had to resort to the USB sound card mentioned above, a mild inconvenience but one that a subset of the apps had no problems recognizing.

LabNation's SmartScope showing a 1kHz sine wave.
LabNation’s SmartScope showing a 1kHz sine wave.

SmartScope Oscilloscope from LabNation is a companion app to their oscilloscope peripheral which gives the features you’d expect from a “proper” ‘scope, but it also has a mode that supports the phone’s audio input. We liked it because unlike many other ‘scope apps it has a user interface allowing easy pinch-and-zoom selection of timebase period and voltage. In the time domain it’s extremely easy to measure period with this app, but the amplitude domain like those on the other apps can not be trusted when not using their peripheral and would need calibration against a known instrument. It does however handle different waveforms as you’d expect from a conventional oscilloscope, and provides a handy way to look at the shape of an audio waveform.

Cracker Or Bench? Our Conclusions

So after several hours at the bench installing and trying test equipment apps, what do we think? The overwhelming impression is that none of these apps could replace the real instrument on their own using just the phone’s hardware. It’s quite possible that with a dedicated peripheral they could provide a good instrument, but that is beyond this article.

That said, do these apps offer any useful functionality, and is it worth keeping them on your phone? We’d say yes in that a not very good instrument is better than no instrument, but we’d like to qualify that by looking at each case individually.

Signal generators, at least in the audio range, are something at which the apps do a passable job. If your voltage requirements extend only to audio line level and below, and you have no wish to venture above 20kHz, they make a useful audio source that is capable of delivering a variety of combinations of waveform. Definitely useful.

Spectrum analyzers though are not a field in which the phone performs as well as signal generation. These apps are fine in the frequency domain so as long as you stay within the voltage range of the input you can use them to gain a view of what frequencies are present, however the lack of intensity calibration is an Achilies’ heel. It’s probably best to consider these as half-useful, half-novelty.

Oscilloscope apps are sadly closer to the Christmas cracker. Yes, you can see the shape and period of the waveform, but there is only a certain amount of information to be gleaned from these readings. The most useful feature of an oscilloscope as we see it is as an accurate time-domain voltmeter, and without that ability the app becomes significantly less useful. Three-quarters-novelty, quarter-useful.

Could these apps be improved? Definitely if their developers took the time to incorporate input selection to ensure that all users could force them to listen to the microphone jack. Unfortunately the feature that would be most useful, calibration in the voltage domain, is probably beyond the capabilities of a phone’s hardware without buying extra peripherals, which rather defeats the object.

After all, the one thing these apps have going for them is that they cost nothing, and that’s more than you can say for a Christmas cracker. Do you have suggestions for useful instrument apps? Let us know in the comments below.

24 thoughts on “Smartphone Bench Instrument Apps: Disappointment or Delight?

  1. If its nothing critical, I use a function generator on my iphone, mostly just for a “does this amp work or not” kind of test signal of for signal tracing. Or, if I’m working on house wiring I’ll plug my phone into a set of computer speakers, crank the volume and then go flip breakers until the sound stops. Since I’m pretty deaf to certain frequencies, it helps that I can tune to a certain tone I know I can hear all the way across the house. I don’t expect the actual signal fidelity to be measurement quality though. One of these days I’ll have a list of which breaker controls what room!

    One thing I have been using a lot of lately, just because its quick and dirty, is a vibration analyzer on my phone that uses the IMU for balancing motors and props on my smart phone. But I use a paid version. Its called “Vibroscope”. It gives a Lissajous graph of two of the axes and a number output. I simply run my motor or motor with prop, write down the numbers and then try to balance until those numbers minimize. Seeing the Lissajous helps me figure out if I’m going in the right direction with my counter weight (masking tape) or not.

  2. Well, the best “engineering” apps in my phone are used to convert different units of measurement to something I can understand and work with, and there is that one App that gives a nice overview of all the sensors present in my phone and the readings they currently give out and allows to log that data. (Light Sensor, Step counter, Proximity Sensor, Hall Sensor, 3-Axis Accelerometer, 3-Axis Magnetometer,…)

  3. I work in audio, but the only apps on my iphone related to that are a guitar tuner and an SPL meter. Both are “good enough” but neither is mission critical. The only spectrum analyzer I tried was complete crap. Electronic Toolbox Pro (paid) has tons of useful data, calculators, and even a decent signal generator.

  4. There are a number of diagnostic tests where just having a waveform and period would be very useful. Some things I can see doing with that include:

    – Basic “is this thing on?” checks that aren’t practical to do with a volt meter, such as variable reluctor transducers

    – Checking for brush arcing on a DC motor

    – Low speed serial bus testing (OK, 20 kHz sampling would be VERY low speed serial data, but some things out there still operate at 9600 kbps…)

  5. There is a very nice electronic circuit simulator for Android that works pretty damn well considering, It actually worked better than high dollar spice programs, which could not simulate the way our product worked.
    I’ve used basic gerber viewers for android….
    I tried getting into Labview for android, it works, but as usual, it was something that was thrown together with poor documentation, like, “hey, these new handheld computers that sometimes are used as phones are going somewhere, we need to come up with something in our spare time to get into that market, get that new Indian intern to throw something together.”
    It doesn’t really do anything by itself, it’s needs a labview program to link to….
    I could monitor my labview program via my tablet, that’s about it….Maybe they’ve come up with something better by now, I wasn’t impressed.

    Cadence come out with a a few apps for their line of Orcad products several years ago, and was trying to charge several hundred dollars for them. That didnt go far, hell, if someone is paying thousands a year for software license, I felt those few little useless additions should have been included for free instead of $795 for a viewer…..

  6. The phones have bluetooth. I’ve always thought of them as luxurious console systems. Brilliant screen. Great battery life. User UI and programmable OS (Android anyway). AND they have bluetooth. The instruments will always reside outside the phone, but they can certainly interact through it.

  7. There is a huge difference though between trying to run a `scope through the audio port, and generating functions out of one.

    Logic analyzer? Sure, for low speed, and you can just divide the voltage because it is regulated. Signal generator? Sure. Scope? Meh.

    The big problem with the scope case is that logic level voltage may (or may not) burn out the audio inputs because actual audio is much lower voltage than the logic levels people commonly are using, for example on a breadboard. To make it safe you need some sort of external protection circuit, and that minimizes the time savings vs using a microcontroller ADC and sending the output to the phone for display. And if the voltage is regulated, you probably don’t need a scope anyways.

    As a signal generator you can just use it with a generic buffer IC, which most people have around for breadboard stuff.

    That said, an ESP8266 makes a better signal generator IMO, and is easily controlled over wifi.

  8. OTG is the way to go it seems. One of those cheap skype phone adapters is far better to burn up than a smartphone’s guts. I have seen a source of audio (walkman radio) get fried when driving Carver amplifiers’ inputs that when bad had massive ultrasonic voltage at the input.

  9. 3 things spring to mind here, thing 1, oh I didn’t know the rest of the world doesn’t do Christmas crackers.
    Thing 2, is that why I cant find a Christmas cracker app?
    thing 3 how do I make phone calls on my oscilloscope?

  10. There’s an open source hardware idea. A USB OTG meter/scope/generator that uses the phone for visual output and control. Design it so clips to securely mount it to phones can be 3D printed. Give it its own storage space so the app can be stored in the device, ready to install when it’s connected to a phone. Won’t have to depend on an app store, and when there’s an update the app should save itself to the device.

  11. You didn’t even mention the most useful tools:
    – Sigrok, and it’s graphical Interface Pulseview
    – Receiver software for rtlsdr sticks

    The rtlsdr spectrum analyzers are actually very handy on a tablet, when, as an example, you want to check on what frequency your home automation gadget is actually transmitting, or find the the bad power supply that is causing that annoying noise on FM.

  12. I never really understood why the dso nano / quad has an lcd screen. Especially without touch.
    It would be cheaper & a better product if it could use the phone screen over WiFi.
    And with the touch screen you can make a decent user interface instead of the silly unintuitive buttons (But that seems tho have improved the last few years).

  13. A sound level meter might not be a part of your standard bench-top devices but this paper by Kardous et al. (http://scitation.aip.org/content/asa/journal/jasa/135/4/10.1121/1.4865269) demonstrates that some apps can produce surprisingly accurate results. “SPLnFFT” – which ranked as one of the top applications – has proven very useful to me and saved me from spending 2K on a device which I need only two or three times a year (but when I need it, I need reliable results)…

  14. I once used a spectrum analyzer app to figure out something really important:
    What frequency is the toiletpaper holder at the mens toilet at work resonant at?
    It had a really pure tone.
    The frequency was 4415Hz.

    It also made me wonder how the audio ADC sample frequency is derivied inside the device.
    If it is based on the main refeence oscillator (26MHz or 30.72MHz), then it might be REALLY stable.
    As the RF side of things synch the osc in the phone to the basesatation and those have either their own rubidiums, OCXO locked to ref fed from something central or ocxo locked to GPS.
    So if I’m lucky I determined that frequency with atomic clock precision. :P

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s