A Preamplifier for Smartphone Oscilloscopes

219,159

397

112

Intro: A Preamplifier for Smartphone Oscilloscopes

I am a certified oscilloscope nut, who owns more of them than he needs and is always looking for another one. So when I learned that cheap scope and frequency analysis programs are available for smartphones I was smitten.  Unfortunately, the practical utility of the software by itself is limited. A pair of alligator clips connected to the audio jack will handle only a small range of low-voltage and low-impedance signals, could inject voltage from the phone into the external circuit, and might carry a risk of frying the phone.

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

Mouser part numbers are listed because Mouser carries the special 4-contact audio plug that smartphones require. I advise that you not waste too much time soldering components together and drilling lots of holes in the box.  Leave the components permanently on the solderless protoboard/breadboard.  This saves a lot of effort and grief correcting mistakes and modifying the circuit, and can last for years. A see-through plastic box lets you leave the LEDs right on the breadboard as well.

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
-9V battery
-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.

#soldering iron
#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

Almost all smartphones expect the mike and common leads on connectors 3 and 4.  Most follow the leader—the iPhone—and put common on ring 2 (connector 3) and the mike on ring 3 (connector 4.)  There are reports that Droids reverse that.  I’m not sure it makes a big difference, since we’re not going to connect the stereo outputs anyway.  However, the shield of the audio cable is probably better off  on “common.”

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

We’ll begin by sketching the simplest possible circuit and then add improvements.  This may help in building confidence if you are new to the analog world (or, like me, hate using more parts than absolutely necessary);  and also  in understanding what the different components do. If you have electronics experience, just skip through.

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

A blinking LED reminds you the circuit is on and doubles as a battery meter.  (Blinking gets more attention while using less power.)  For an extra 5 cents, the 6 V zener will dim the LED as the battery voltage drops below 8V, and turn it off entirely below 7.5 V. The stripe on the zener should connect to the positive supply voltage.

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

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

ADDENDUM:   If you haven't ever used a breadboard, the new photo may be more helpful, with the purple blobs added to show which holes the wires plug into.  Round blobs indicate where the visible wires go. Square holes show where the leads go that are covered by components, i.e., the input capacitor and the potentiometer.  In each vertical column of 5, the holes are already connected internally.  So are the rows of ten at the top and bottom, which connect to the + and - battery leads. The holes are not connected across the middle gap where the op amp and LEDs are plugged in.

Troubleshooting

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 Macbook Pro. The new headset jack seems to be the same as that on the iPad, which works with this circuit. Apple has also dropped the high-pass filter from iOS 6 onward, enabling frequencies down close to 0. However, only the higher-priced SignalScope seems to take advantage of this.

Now go out and measure something!

5 People Made This Project!

Recommendations

  • Audio Contest 2018

    Audio Contest 2018
  • Electronics Tips & Tricks Challenge

    Electronics Tips & Tricks Challenge
  • Plastics Contest

    Plastics Contest

112 Discussions

0
None
JoseL295

2 months ago

Hi!

Congratulations on your project, it's very interesting, for a project at the university I'm trying to follow your indications, but I have some doubts with the circuit. Could you please help me? Could I consult you through your email?

0
None
scrat2k2

9 months ago

Might it be possible to remove 9V battery and both 22k resistors and power the OP directly by the USB-port of a tablet that is running the oscilloscope app?

2 replies
0
None
chipsteinscrat2k2

Reply 8 months ago

Nice idea that would not quite work out of the box. The op amp would probably be OK with 5V from the USB port, but not directly on a single supply. Either that 5V still needs to be split by the voltage divider, or you need to make some other provision for the fact that the input voltage is going to swing both positive and negative relative to the common connection. The circuit could be redesigned for single supply operation. Have a look at https://www.ti.com/lit/an/sloa030a/sloa030a.pdf

0
None
chipsteinscrat2k2

Reply 8 months ago

Nice idea that would not quite work out of the box. The op amp would probably be OK with 5V from the USB port, but not directly on a single supply. Either that 5V still needs to be split by the voltage divider, or you need to make some other provision for the fact that the input voltage is going to swing both positive and negative relative to the common connection. The circuit could be redesigned for single supply operation. Have a look at https://www.ti.com/lit/an/sloa030a/sloa030a.pdf

0
None
rrkkllmm

2 years ago

what other component can I used in replace with op amp tlc 272? thank you

8 replies
0
None
chipsteinrrkkllmm

Reply 2 years ago

Rather than me trying to guess what your problem might be with the TLC 272, and then generating a list of possible alternatives, it might be more efficient for you to explain why that chip won't work and list what alternatives are available to you.

0
None
doski90zchipstein

Reply 2 years ago

Great instructable is should say :)

In my country I couldn't fine this chip , but i found 4558d JRC dual op amp.

1- Is it ok to use it? what are the possible effects.

2- Also, I couldn't find a 1M pot but I do have a 500K pot and many resistors, can I use a 500K resistor in series with the 500K pot to create a 1M resistance in total?

0
None
chipsteindoski90z

Reply 2 years ago

The 4558d is a very old chip that is listed to to need a minimum ±5 V power, so it might be marginal here. But my guess is it will be OK. The 500K pot by itself should be OK too. Good luck.

0
None
doski90zchipstein

Reply 2 years ago

so I built the minimal circuit using the 4558d and i used a 9v battery with the same schematics but the problem is that the chip gets hot and i dont know if thats normal or not, also i replaced the 9v battery with an 11v from an adjustable ATX power source which made the chip very very hot!!

Whats going on??

Also, I noticed that the battery gives more cleaner signal than the atx ( connected to mains)

0
None
chipsteindoski90z

Reply 2 years ago

The chip should not get hot. Something is very wrong with your circuit.

0
None
doski90zchipstein

Reply 2 years ago

Ok, lets diagnose the problem.

What i have done was

1) I replaced the ceramic capacitor (4.7uf) with a polarized one where the posative terminal connects to the led (two parrallel leds inversed in polarities) and its negative terminal connects to the 1.5k resistor then the resistor to the negative of the battery (ground)

2) I couldn't find a bipolar led so i used to normal leds in parallel each with inversed polariy meaning if enough voltage were passing one of them should be lit depending on the direction of current i guess

The rest to the circuit is the same as the full circuit without the zener Diodes and the power indicator led.

+ve of battery directly connects to pin8

-ve of battery is connected to the ground os the circuit

One Oscope testing probe is connected to the ground

The other probe connects to the pot thrugh a 0.1 uf cap

Ground of the trrs connects to ground of circuit(negative of battery)

Mic line connects to the negative side of the polarized 4.7uf cap (before the resistor 1.5k)

What did i do wrong and Any suggestions to fix it is appreciated

0
None
craeckedoski90z

Reply 1 year ago

About that capacitor replacement: you can't do that. The purpose of that capacitor is to remove any DC offset from what should be an AC signal (To be honest, I don't see why it's necessary, because I don't know where a DC offset might come from in this circuit. I'm still learning, myself). It's known as "AC coupling." The reason why you need a non-polarized capacitor is you don't know ahead of time if the DC offset you're filtering out is going to be positive or negative. If it's the wrong way relative to your polarized electrolytic capacitor, the cap could blow.

The reason you don't know the polarity of the DC offset is related to the other mistake it seems you're making: ground is not the negative terminal of the battery in this particular circuit, though it probably is in just about every other circuit you've become familiar with. Op amp B is establishing what's called a virtual ground with a voltage halfway between the terminals of the battery. In most circuits, you've probably thought of the positive battery terminal as being at 9 Volts and the negative terminal at 0 Volts. In this circuit, the positive terminal is at 4.5 Volts, the negative terminal is -4.5 Volts, and op amp B is generating a ground reference at 0 Volts. So anything that attaches to ground in the diagram needs to attach to the output of op amp B, not to the negative battery terminal.

0
None
doski90zchipstein

Reply 2 years ago

Thank you chipstein,

I found a 1m ohm pot today. I will start building the circuit soon and I'll update you with the results (hopefully the chip will work)

0
None
kschmidt2

1 year ago

All I have in double OP amps is a TDA 2822 and a TDA 2822M, would they work? I plan on adapting this for an arduino so I can make a scope capable of higher than 5volt measure. I could incorporate the High/low switch with the software with a DPDT and when a pin goes Low it multiplies the voltage value displayed.

0
None
mhijazi007

1 year ago

Thanks for the detailed instructable! I was going to buy an oscilloscope but knowing I can make a portable one with my smartphone is much better.

I have a beginner question regarding the power source. Looking at the datasheet of the OP Amp it has pins for ground and +Vsource. But we have used "B" to create a +V and a -V. In the simplified circuit, I don't see this connected anywhere.

0
None
AdamGadut

1 year ago

is the LM386 op amp ok to use for this project?

0
None
RamiK7

2 years ago

why you are used zener diod??

0
None
Serdalp

2 years ago

now make a module for the lg g5 :)

0
None
pavelpick

2 years ago

Hello, really thanks for this simple and useful project.
My question: the circuit works it shows waves correctly but after some time (and sometime almost immediately) it starts dialing the last phone number. It happens so often that I can not use it. Sometime it´s necessary to restart the phone, because it tends to dial the number even after the preamp is disconnected.

I have HTC 601 phone. Does anybody have such problem? Any idea what to do?

But anyway, thank you a lot, if even it will not work perfectly I got a lot of important knowledges.