Instructables

A Preamplifier for Smartphone Oscilloscopes

Featured
Picture of 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.
 
Remove these adsRemove these ads by Signing Up
achand82 months ago

Thanks for the cool instructable. I am new to opamps so please answer my qns. If I give a 10 v input sine wave will the oscillator app show it as 10v itself? Doesn't the potential divider scales the input? I am gonna use TL072 and It can have up to +-15v at the input, so can I leave the potential divider for voltages below 15v so I can measure the voltage also in the app?

chipstein (author)  achand82 months ago
achand8, The most important limit on voltage is not the TL072 but the headset input on your device, which will certainly blow out if 15 volts ever gets into it! To avoid any such risk, you don't want to have more than ±4.5V anywhere in your circuit, the input potentiometer and scale switch form another layer of protection, and additional voltage protection on the output is included as well. Don't leave out any of those things. The TL072 will not actually accept more volts on the input that it receives from its power supply, so that rating is not really relevant. Despite the input scaling/protection, there should be no trouble calibrating the scope software to the correct values.
chipstein (author) 5 months ago
ronin_101, it may work with a polarized capacitor because the output voltages are so low. However, they do swing both ways so non-polarized would be better. The value of 4.7 uF in combination with the bias resistor of 1.5K forms a high pass filter of about 22 Hz, which is actually conservative compared to the very poor low-frequency response of most smartphones and iPads. So 3.3 uF NP or 2.2 uF NP would probably be fine.
Ok got it. Thanks a lot for your answer.
Drillbert5 months ago
Nice design. Can you provide a complete wiring diagram?
chipstein (author)  Drillbert5 months ago
I'm not sure what you mean, other than the schematics and photos in steps 3, 4, and 6. It would be fine if somebody wants to provide a pcb layout or SPICE file, but that was not my goal in this Instructable.
ronin_1015 months ago
I went ahead and built the circuit with a polarized capacitor. It seems to work when checking test signals generated by audacity. I didn't test it in real conditions yet.
ronin_1015 months ago
Hoping that someone still follows this thread one year later I have a question about this circuit.

Can I replace the 4.7 uF input capacitor by a polarized one ? (I guess no since it's AC input) Or can I put another non polarized value and if yes in what range ? The shop where I got the parts did not have 4.7 uF non polarized left.
arthujt6 months ago
I could use some help.I have been using a huntron(octopus circuit)for over 40+ years.It is a tracer type of circuit that uses a transformer three resistors, and some wiring to use image comparison to trouble shoot circuits to find the bad device(s) to pinpoint the problem. Its a lifesaver for most techs. It would be a boon in the feild.
My idea... If you generate the 60hz signal with pwm,shoot it out the sound port, then return thru the mic in, you dont need an outside source for the signal and can do it with one input if compared against an internal (virtual)60hz instead of the timeframing?anybody wanna help?Please?
chipstein (author)  Josehf Murchison9 months ago
Good to hear from another 'scope fan. This one looks promising as a different, freestanding approach.
SuperTrooper11 months ago
Would you consider modifying the Preamplifier so that it acts as an preamplifier that provides high gain to the output of a low noise electret condenser microphone while supplying it with a 5V bias voltage.

The microphone has a sensitivity of 38mV/Pa so at the low end of the sounds it can detect its output will be in the order of microvolts, it would require a gain of about 80-120dB to raise the signal above the 100mV threshold that 3.5mm audio jack inputs generally require. (You might need to cascade a pair of Op Amps) and an AGC circuit to ensure that microphone outputs for louder sounds do not overload the input of the smartphone/tablet after amplification.

Input and output interfaces would be 3.5mm audio. (Target Phone HTC Amaze 4G form factor. The phone runs of a 3.7v supply but would need to have the preamp supply 5V or as close as possible to 5V supply to the low noise microphone so that the noise floor is not raised.
chipstein (author)  SuperTrooper11 months ago
That would be a cool application for the smartphone. It would also be sufficiently different that you would be better off starting from scratch with one of the many electret mike preamps that are described on the web. However, the special phone plug connections here might be useful.
Babarnc1 year ago
Hi,
Thanks for this great project and instructions. I am newbie in electronic so I just want to make sure:
->the ground here is never connected to the -V of the batterry but instead to the phone ground.
-> I haven't found any bipolar LED in my region so I took 2 diodes, that should do the trick I suppose?
And thanks again for the instructions.
chipstein (author)  Babarnc1 year ago
Correct. The negative terminal of the battery does NOT go to the ground, which is also labelled "common." All the downward arrows connect together at the phone ground. Two LEDs connected with opposite polarity should do fine.
chipstein (author)  Babarnc1 year ago
Correct. The negative terminal of the battery does NOT go to the ground, which is also labelled "common." All the downward arrows connect together at the phone ground. Two LEDs connected with opposite polarity should do fine.
naught1011 year ago
What would need to change in the circuit if I wanted to run this off 5v? usb power is something that's readily accessible these days, and I'd rather not use throw away batteries..

Also, why is there a V+, V-, and GND in the circuit diagram? Is V- == GND? Do both of the V+ in the breakout section connect directly to the range switch/op amp leg 5?
chipstein (author)  naught1011 year ago
The V+, V-, and GND connections are there because op amps generally need both positive and negative voltage sources to run properly. The + on the range switch/op amp leg 5 is NOT a power connection at all but the positive input terminal. Google "op amp tutorial" for background on how these circuits work.

You could directly substitute the 5V from USB for the 9V battery connections, and just leave out all the zener diodes and the bipolar LED. If you are using the preamp with a laptop, that could provide the USB power. But it might be clumsy with a smartphone. One 9V battery should be good for 50-100 hours of operation—around a nickel an hour. I recommend you splurge.
eslighton1 year ago
If I add a switch to optionally bypass the input capacitor, would it work o.k. for low voltage D.C. measurement?
chipstein (author)  eslighton1 year ago
The preamp could work for DC, but the smartphone would not. No smartphone, tablet, or laptop that I know of can handle DC signals on the analog input.
As you mention, most phones and other devices are AC coupled, which is a problem if you want to use the onboard ADC to measure DC. Think how useful it would be to have a phone O'scope like this that could also be used to measure DC voltages and resistance values (using the onboard voltage source). I can see at least three ways to accomplish this.

First, one could use a chopper circuit (like this: http://lea.hamradio.si/~s57uuu/scdsp/CheapChop/cheapchop.htm) to move the DC to AC, then use this circuit to allow DC measurement (again, see the like above). It may even be possible to use the audio output to the headphones as a replacement for the 74HC4066 that is used to generate the 5kHz oscillator.

Secondly, you could use circuit based on capacitor charge time to chirp into the O'scope, and by measuring times between chirps, determine the voltage.

Lastly, a larger project might be to measure the voltage in a circuit and pass the information to phone software via DTMF tones or other signals. The integrated chips that are available, or even a microcontroller, make this doable, even in a small package.

Of course, regardless of hardware, a complete solution would also require software that had a mode that converted the signal to a calibrated display of voltage.

Is anyone interested in this type of pocket o'scope / DMM project? Does anyone know of an instructable or website that illustrates this sort of approach?
Ahmed13371 year ago
Hm, I guess I get your reasoning, but I don't share the view -- although it's pretty basic, most newbies will take quite a while to reach a stage of knowledge at which they'll understand how changes affect this circuit.
Until then I guess most would want to build this on a more permanent platform.

Anyway, figuring out how to move from a breadboard to throughole is something every newbie has to do at some point, so I guess this makes a good exercise.

Another thing: have you considered changing the 1M pot to a 0.5M resistor and 0.5M pot? That should be even more newbie friendly -- one can change the impedance without having to worry about measuring the resistance.
chipstein (author)  Ahmed13371 year ago
Good suggestion- that would prevent the resistance from ever getting too low.

Probably different people learn things in different ways. My own dim recollections of being a newbie are that I made mistakes, and found unsoldering them difficult; and that I wanted the absolutely lowest possible parts count!
Kavey1 year ago
Yes that should help.I need to buy a solderless breadboard.. never tried one before so I dont think I had a full grasp of how it works. I am not new to electronics or solder or anything.. just new at reading this style of schematic. Im a very well trained automotive electrical troubleshooter and if you give me a wiring diagram for a car I know it inside and out. HObby electronics are the next one for me to learn. I got a few things I want to make that are going to require me to have that skill. Not to count my lab scope broke and I dont have 1500 for a new one and tired of borrowing them all the time which is what brought me here to begin with.
A couple of other questions here while I got your time.
Would you possibly be willing to sketch up how this would all be interconnected with no breadboard.. just soldering the resistors, transformers etc all to each other? That will help me better understand it.
Second I cannot find a 1Mohm trimmer. Is there anything I can substitute that is easily found at radio shack?
And finally I have an inductive probe that came off of my old tester that had a oscilloscope. Is there any way to incorporate that into this design? Or any other DIY solutions for the android platform that have an inductive pickup. I really need the inductive option on several things I use a scope for.
Please let me know. If you have a for sure idea on how to make it inductive I would even be happy to pay you for your time to work with me to make one. I got a car right now waiting to be diagnosed and need to get this going so I am going to wait on your answers to the and gather materials and buy an actual breadboard and see if I cant get a scope.
I sure do appreciate your help and you taking the time to reply to this old post. Keep up the good work. Thank you.
chipstein (author)  Kavey1 year ago
Kavey, you need a professional scope. This instructable is meant for portability, not for professional applications like yours. Google "Siglent SDS1052DL 50MHz Digital Oscilloscope" for $250.
Kavey1 year ago
Any chance you could post a picture of the back of this so noobs like myself can get a better understanding of how its wired?
chipstein (author)  Kavey1 year ago
There is nothing on the back of a breadboard. All connections are internal or are made by plugging in wires and components on the front. To show better where they go, the last page now has an addendum plus another photo with purple circles and rectangles at every hole that something is plugged into. Hope this helps.
Ahmed13371 year ago
Nicely done, one thing though:
a breadboard is not a permanent solution and can cause a lot of problems down the line (connectivity) and it's also quite expensive compared to a small throughole PCB from ebay.
To make this things "advanced newbie" friendly, a throughole layout and complete schematic would be really, really neat.
chipstein (author)  Ahmed13371 year ago
This is basically a difference in philosophy and time management. For me, circuits like this are not immortal masterpieces but works in flux. On the breadboard they can be modified almost instantly; on a PCB any change is tedious and frustrating. (I'm going through that annoying process right now, with a circuit that needs more fiddling than anticipated.) I have left many circuits on breadboards where they worked fine for years. The most common connectivity problem is with wires coming off the board, so I hold those down semi-permanently with hot melt glue. A breadboard allows readers to begin with the minimal circuit and add or subtract the various options if that seems better. Or they might use it as a springboard to try out their own ideas. I hope that some of them will, that any who wish to make their creation permanent on a PCB will be pleasantly surprised at how easy that process is, and that they will feel free to post the layout here.
poland1 year ago
TO NIE DZIAŁA
rawrdino1 year ago
First of all the project is really awesome. Second of all i don't know if you still check if there is comments but please answer if this would be possible on a samsung galaxy Y? Thanks very much.
chipstein (author)  rawrdino1 year ago
The galaxy Y appears to use the same kind of hybrid 4-pin plug, so it should work. I don't have access to one I could test myself. It never hurts to download the scope software and immediately check it with the built-in mike during the refund window--before going any further. Hope it works for you.
I tried calibrating the oscilloscope with a 1KHz sine wave but got a weird looking output wave. I tried on two different devices: a Galaxy Nexus phone and a Galaxy Note tablet and got different results which makes me think maybe its not the circuit but sampling that is the problem? I'm new to oscilloscopes and not sure how to proceed.
GalaxyNoteTablet.pngGalaxyNexusPhone.png
chipstein (author)  number8wire1 year ago
number8wire, congratulations on getting this far, and having your phone pick up the signal. I'm glad you sent the pictures. In the top one, the signal hitting your phone input looks huge: about 8 volts peak-to-peak. You don't want it that big. The first thing is to try a much smaller input signal, or adjust the potentiometer to make the output much smaller. Maybe you have already done that in the second picture, where the signal is smaller but the top portion of the signal is clipping. This probably means that the voltage on "common" is not where it belongs. A connection in the circuit is probably bad. Go back and make sure that the voltage on “common” is halfway between the positive and negative connections (4.5-4.8V) at all the points indicated by the down-pointing arrows--including the TRRR connector. It's NOT likely that your phone sampling or sine wave signal is bad, but you can check the latter easily just by listening to it. If it's good you will hear a pleasant pure tone; otherwise there will be harsh components.
chipstein (author)  chipstein1 year ago
Hmm. The system has invented a new form of punctuation. Those should be quote marks around “commonâ.
I got it to work and learned a lot in the process! You were right about the dodgy connection. Thanks.
andresfrr1 year ago
Hi, Could you write here the code?
chipstein (author)  andresfrr1 year ago
There is no code. The circuit is purely analog, and interfaces with the cheap/free scope and frequency analysis programs that are widely available for smartphones and tablets.
Would it be possible to upload a larger view of the final schematic. It's rather small, and I am having a hard time reading it.
chipstein (author)  binaryhellstorm1 year ago
Click on the little "i" in the upper left corner of the Figure to get full-size downloads. This feature could probably be labelled better.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!