Saturday, August 13, 2011

iPad Oscilloscope Adventure

My aim of writing this is the hope that it might help someone in a similar circumstance :)


Recently I had the need to investigate a problem with my audio amplifier. The digital volume control was acting up and I wanted to 'see' what was going on in the circuit - something my multimeter is not quite capable of - it's hardly a Fluke ScopeMeter!


Not owning a real oscilloscope, I decided to investigate what options there were for my iPad. Turns out there were a few, and I found one that suited my budget.


Many moons ago I constructed an electronic kit link (from Jaycar - a local electronics retailer) that essentially turns a computer's audio input jack into the signal source for a software oscilloscope program. 2 channels actually, using the left audio channel for one scope channel and right for the other.


I could have used my laptop along with this kit to have a snoop into the circuit ... but I really wanted to see if I could do that same with the iPad.
I find technical challenges like this fun :)


Anyway, it turned out I also had all the other ingredients needed to pull this little job together:


Ingredients:
- 2 scope probes
- 1 signal scaling kit
- 1 usb audio device (that works with the iPad)
- 1 iPad camera connection kit
- 1 oscilloscope iPad software app (in my case 'Oscilloscope' by ONYX Apps (link) which was AU$16 at the time)
- various electrical connections, or croc clips :)


not to mention ... 1 circuit requiring investigation


The app developer's site has some very useful info on connecting external signals into the iPad.
I was lucky enough to already be using the Behringer UCA-202 (usb audio device) in my home audio solution, so I had one around to play with.


So, basic signal path setup:


scope probe/s --> signal scaling unit --> audio usb device --> camera connection kit --> iPad --> scope software






... and I was surprised how well it worked !


Note that in the pic above, the signal to the UCA-202 is just represented by the plug lying there - I used croc clips to connect when I actually did it as I didn't have the exact cable for the job.


The biggest downside was the lack of DC input to the scope. Because this signal path is, for the most part, effectively an audio signal, it is electrically decoupled from DC with the use of capacitors in the internal circuitry of the usb audio device (and in my case the signal scaling unit too I believe), with the end result that only AC signals make it all the way to the scope.
This is a bit of a problem for digital signals, because the change of state from a high to a low (or vice versa) is seen but then immediately starts decaying to zero (as expected). The result is that you don't see nice square waves, but rather odd looking waveforms, as follows:








However, if the digital signal of interest is changing fast enough, it doesn't become too much of an issue. Knowing this expected behaviour, I was able to let my best tool (my brain) compensate for this, and interpret what I was seeing on the scope :)


Example of faster signal, where decay is less obvious:
(These 2 traces were from the digital volume control of my amplifier, where you can see the 2 pulse trains out of sync with each other when the volume is adjusted.)




Another example:




In the process of measuring the issue I was having, it cleared up in front of my eyes, and is still ok. Quite odd really. 
Unfortunately I didn't get any screen shots showing the noise problem that was causing the issue.


All things considered, it was a very interesting little adventure.


Hope this helps somebody out there :)