This Instructable describes a preamplifier circuit for making smartphone scopes more versatile, more useful, and highly resistant to accidentally transferring lethal voltages into your audio jack. The input impedance is increased from around 2 KΩ to 1 MΩ, the voltage range is 10 mV to 50 V or more, and the safe overload range is equal or higher. The scale is easily calibrated with not much more than a volt-ohm meter (VOM.) No software is included; why reinvent the wheel when good apps are already out there for many platforms at a few bucks—or even free? The same basic circuit can be used, with minor changes, in many other systems including laptops, iPads, and Android tablets.
STANDARD WARNING: the complete circuit and your phone should be safe from accidental overvoltages of reasonable magnitude. But I take no responsibility for any damage that may occur to you, the circuit, or the phone. Nor can I guarantee that your particular brand/model phone will give good results. The frequency range will be limited by the parameters of your device; most should be usable from about 75 to 15,000 Hz (no DC). UNDER NO CIRCUMSTANCES SHOULD THE PREAMP OR YOUR PHONE EVER BE CONNECTED TO THE AC WALL JACK OR POWER LINE.
Step 1: Parts and Tools
Minimal Circuit – $12-15
-Miscellaneous wiring. Old audio cables (the kind with RCA plugs) are good for the input and output leads.
-Small alligator clips (2)
-SPST “on-off” switch
-Solderless breadboard [Mouser 510-EXP-350E, $5.00]
-Resistors, ¼ watt: 1.5 KΩ, 22 KΩ (2)
-1 MΩ linear trimpot [Mouser 652 -3352P -1-105LF, $1.24]
-4.7 uF capacitor [Mouser 810-FK18X5R1A475K, $.17]
- TLC272 dual op amp [Mouser 595-TLC272IP, $.71]
-3.5 mm 4-conductor (TRRR) audio plug [Mouser 171-7435-EX, $2.60]
[-3.5 mm 3-conductor (TRR) stereo audio plug for calibration signals – OPTIONAL]
-9V battery clip
-Small clear plastic box. I used a 2.5 by 3.25 inch “Really Useful Box” from Office Depot, $1.29. This is about as tight as you can get.
#volt-ohm meter (VOM) for calibrating and troubleshooting
Full Circuit – additional parts about $3.00
-bipolar LED [ Mouser 604-WP57YYD, $.46]
-blinking LED [Mouser 696-SSL-LX5093BSRD $.87]
-0.1 uF 100v capacitor [Mouser 594-A104K15X7RH5TAAV, $.50]
-Resistors, ¼ watt: 560 Ω, 330 Ω, 3.3 KΩ, 33 KΩ, 330 KΩ
-6.0 V 1/2 watt zener diode [Mouser 512-1N5233BTR $.05]
[-3.5 V ½ watt zeners (2) [Mouser 771-NZX3V0B,133, $.03 each - OPTIONAL]
-SPDT “range” switch
Step 2: Wiring the TRRR Audio Connector
Begin by soldering a roughly 1’ length of audio cable to the connectors for the middle and bottom ring of the 4-conductor audio plug. The bottom ring (furthest from the tip) goes to the largest connector. If you’re not going to get all fancy with RCA audio jacks and plugs, just tin or solder a short solid wire to the other ends so that they stick more easily into the protoboard. Do the same with a 1-2’ audio cable for the alligator clips and the leads for the switch(es). Be sure that the alligator clip connected to common is identified as such. When ready you can cut down the breadboard to fit in your plastic box, leaving the rest for other projects.
Step 3: The Minimal Circuit
The minimal schematic above shows the core circuit and layout on the breadboard. The two op amps on the TLC272IP have the simplest possible configuration, a unity-gain buffer. “A” samples the signal of interest at high impedance so as not to alter that signal, while providing more juice downstream. “B” splits the battery voltage in half, to provide the dual ±4.5 V needed by “A”. The trimpot sets the input impedance, helps establish protection for the TLC272, and calibrates the whole system. For the smartphone to recognize an external source, there should also be a resistor around 1.5 KΩ between the mike and common lead, and a capacitor (4.7 uF) isolating the mike input from DC on the preamp output. (If you are simply connecting to a high-level input, like a MacBook Pro, you could leave off the last 2 items.)
The first item to put on the breadboard should be the 1 MΩ trimpot. Use a VOM to set the wiper so that the resistance values between points A-B and B-C are approximately those given in cursive on the schematic. Make sure that whatever future adjustments you make, the resistance between points A and B remains at 500 KΩ or higher. The TLC272 has built-in protection against electrostatic discharge, especially after the circuit is complete; but don’t take chances. Use a ground strap or touch your hand and your VOM to ground before working with it. Assemble the rest of the circuit according to the schematic and the photo. Don't overlook the little wire jumpers. Note that all the “common” points come together. Connect a fresh battery and make sure that the voltage on “common” is halfway between the positive and negative connections (4.5-4.8V). Then, if things looks OK, plug it into the phone and check the results using a small input signal (see “Calibration” for where to get the signal). Initially the voltage range on NFK Oscilloscope Pro should be set around “5.”
This limited circuit will work adequately for full scale voltages in the range of 2 to 20 V (±10 V), and the software will let you read down to millivolts. With the power on and the trimpot settings described, the op amp will be very safe from input overvoltages up to at least ±40 V. If you will never go near higher voltages, you might get by with this circuit and nothing more. However, it has several potential limitations: The input range is still rather small, DC on the input might prevent it from working properly, the phone jack might be exposed to transient signals approaching 5V, and you will almost certainly forget to turn it off—thereby running down the battery. So the next circuit adds a higher voltage range, more protection, and a power-indicator LED.
Step 4: The Full Circuit
To give a second, 10X higher voltage range the triplet of [3.3 K + 33 K] in series with 330 K produces a 1:10 attenuation ratio, and needs no additional calibration. An SPDT switch swaps between the low and high ranges. The 0.1 uF capacitor blocks any DC input.
Overvoltage Protection. The 330 Ω resistor and the bipolar LED limit the voltages reaching the phone to about ±1.8 V, and also warn you when signals larger than that are present. (They almost never should be.) If the trimpot is set to give a 10:1 stepdown, as described above, then a ±40 V input signal will be reduced to ±4 V. This is within the “completely safe” input range of the op amp. On the extended range setting, the op amp would be completely protected to ±400 V; except that the input capacitor and trimpot would likely fail long before that! In addition, the ~900 KΩ trimpot resistance will limit input currents to very small values, which should be handled by the op amp’s ESD protection circuitry. After calibrating I tested my own preamp—with the phone connected—at ±50 V on the low range and ±100 V on the extended range. There were no problems. In fact, the voltage reaching the phone jack never exceeded 100 mV. For exactly 6 cents more, the optional 3.5 V zener diodes (gray outline on the schematic) would provide even more rigorous input protection. However, they also produce a bit of noise, so I took them out.
In the new layout, note that some of the components and wire jumpers from the minimal circuit have been moved to make room for the new parts. When everything is installed, turn the power switch on and make sure that the blinking “power” LED is lit and the bipolar LED is not lit. Check out the voltages as described above, then connect to your phone. Once you are sure everything works and is properly calibrated, hot melt glue is an easy way to stabilize larger components and the wires coming on and off the board. If needed, a bit of foam holds the battery in place when the box is closed.
Step 5: Calibrating the Voltage Settings
Some people won’t care whether the voltages are completely accurate; seeing the waveforms and frequency spectra is enough. They can stop here. Otherwise, you will need to fine-tune the trimpot with a source of calibrated low voltage sine waves around 1000 Hz. You can provide this signal with almost any computer or a second smartphone, using the free SourceForge audio program Audacity or the free android app Signal Generator from Radon Soft. Take the signal from the earphone jack using a standard 3.5 mm stereo plug. Ideally, you would have access to another, calibrated scope to match yours against it. Otherwise, as in the picture above, a VOM will get within 5-10 %. First, generate a 1 KHz sine wave tone at high output so you can read it accurately on the lowest AC setting of the VOM. It should be around 0.5 V RMS or somewhat higher. You can then use that signal to carefully adjust the input trimpot on your preamp until your scope value agrees. If you added the extended higher voltage range, calibrate with the SPDT switch connected to the trimpot (lower voltage range), not to the resistance bridge. Remember that an RMS signal of 1.0 volt on the VOM corresponds to a waveform of 2.8 volts peak-to-peak on the scope.
With two voltage scales, a software range setting on the NFX Oscilloscope Pro of “5” is a good compromise; this will provide full-scale ranges of 5 V and 50 V (±25 V), although you could go all the way up to ±100 V. Remember that when using the extended range, 0.1 V on the scope software will correspond to 1.0 V at the alligator clips, 1 V on the scope will correspond to 10 V at the input, etc.
Step 6: Final Notes
1. It doesn’t work: first double-check your wiring!
2. The phone fails to recognize the external input. Try plugging in the preamp before the softward scope app is started. Some phones reportedly may need the 4.7 uF capacitor removed. Some may need a different resistor value. Both of my Droids, my iPad, and my wife’s T-Mobile My Touch work with 1.5 K, but try other values.
3. The bipolar LED is lit. Almost certainly something is wrong. Check that the voltage on “common” is halfway between the battery plus and minus.
4. The preamp doesn’t work right and another scope shows it’s oscillating. Is the 1.5 KΩ output resistor in place? The non-inverting buffer amplifier configuration has a slight propensity to oscillate, and running without any load might set that off.
Using this Circuit With Other Software and Other Gadgets
The audio spectrum/frequency analyzers I tested worked fine, and revealed among other things that both Audacity and Signal Generator produce a much purer sine wave than my old analog signal generator. The photos on the first page come from Audacity, Oscilloscope Pro, and SpecScope.
Smartphones, iPads, and some PC laptops seem to require the audio input connections shown here. Macs and some other laptops need only a standard 3.5 mm stereo plug; for those the 4.7 uF output capacitor and 1.5 K resistor aren’t even necessary. Some PCs seem have automatic gain control (AGC) by default; you can often get around that, and extend the frequency range down to about 5 Hz, by using an audio-USB converter like the Griffin iMic or the Behringer U-control.
ADDENDUM #2: Apple has recently dropped the separate audio high-level line input from the 13" Macbook Pro. The remaining headset jack seems to be the same as that on the iPad, which works with this circuit. So the newer 13" Macbook Pro should also.
Now go out and measure something!