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
1-40 of 77Next »
omnacron1 month ago

Awosome instructable. i have a few questions one, i have a tlo82cp op amp from the the pin out it is the same as the tlc272Ip so so wiring it just as yours diagram will be fine correct? and my second question my first Oscope was just 2 resistors wired together so i tried to compare the signal through both those and yours but it seems that im still getting alot of distortion the sine wave looks good but the others i get distortion at the rise of the square wave and as it drops it is not straight it slants. do you have any idea as to why this is happening or how to fix it? and one more question sorry....could the distortion im getting be from un sheilded wires? right now everything is bread boarded using bread board wires (not the ridged ones) i will try and get a picture of it posted. and one more thing the resistor you have crossing over the ic from pin 8 to pin 3 what is the rateing on it i am shade blind so reading the colors for the code is very difficult for me, and what purpose does it serve.

chipstein (author)  omnacron25 days ago
Again, sorry about the long delay. A TLO82 should be fine. A picture of the square wave distortion labelled by frequency would be good. Without a picture I'm guessing this is most likely caused by the very poor low-frequency response of smart phones in general. (Probably not from using unshielded wires.) That crossing resistor is 22K, as is the one below it. 1/4 watt is fine.
stuffdone2 months ago

I am a little confused comparing your diagram with the image of your breadboard (full). Re. the power source (9Vbattery) in the diagram the negative lead is only connected to the first resistor in the divider. There is no indication that it ties to common ground. However in the photo I see a jumper on the black power lead?

Where does that jumper go?

chipstein (author)  stuffdone2 months ago

In the schematic I left off the positive and negative connections to the TLC272, which you can find by downloading the specs. However, the jumper you mention in the photo is negative connecting to pin 4, and another jumper connectspositive to pin 8. The common ground is NOT the negative lead from the battery. If this seems confusing, Google op amps and "split power supply."

Thanks....I will later upload a complete diagram. It is Memorial day...going out to shop to finish this !

Here is my modified diagram showing the power rails to the IC.

( Please verfify this is how you powered the circuit )

layout.png
chipstein (author)  paulckruger25 days ago

That looks right. Sorry about the very long delay. I had a lot of things on deadline.

Layout

layout.png
omnacron2 months ago

what can i use to substitue the 1m ohm pot? my funds are very limited. my local radio shack dosnt carry anything more the 50k ohm. i have one of those and a few 10k ohm as a possiable replacement?

chipstein (author)  omnacron2 months ago

Don't try to use a 50K pot, much less 10K. You really do need a large resistance at the input, to ensure a high input impedance and to help protect the rest of the circuit from accidental encounters with excess voltages. However, you only need a pot to precisely adjust the gain. You can try replacing the pot with different combinations of resistors, like 2 X 470K, 1M and 100K, etc, to land in the right ballpark. Just make sure that the larger resistor connects to the input signal.

paulckruger3 months ago

I just ordered parts to build two. Cheap, why not have one in the tool kit?

However the second will likely be built with a PC board. If I design the layout and board and have some make professionally, would anyone here be interested in buying one to offset the cost of making them?

I figure they will probably cost about $3-4 each for 2 side PC boards. Of course it would be a version to support the FULL CIRCUIT.

Not trying to get rich here...but it is far cheaper to make a batch of boards than to mess with just one or two so would like to share the cost.

Let me know a paul@paulkruger.us

Thanks

chipstein (author)  paulckruger3 months ago

paulckruger, I'm flattered and happy for you to do the kit and the boards. (Unfortunately, you're pretty much guaranteed not to get rich from it.)

However. As discussed many months ago, I myself leave small circuits like this on breadboards. It's true that things on breadboards can sometimes come loose, especially if the breadboard, battery, and wiring are not held firmly in the box. However, it's quick and easy to just stick them back in-- provided you have invested 30 seconds in saving a picture. In contrast, it takes a lot longer to solder all the parts in place, and a lot longer to fix errors in soldering. Also a lot longer to make modifications.

A modification in point: the high pass filter (required by the mike-sensing circuitry) is set to about 22 Hz. This was fine for the original circuit because no device I tested would go below 75-100 Hz. However, the latest iPads, when used in conjunction with Signal Scope, are good down to 20 Hz and possibly lower. For this, a 10 uF NP electrolytic, or possibly a 2.7 K resistor, would be better. Testing out such mods takes only a few minutes.

However^2. If you want to make sure one of my circuits is still around in 50 years, I'm not going to argue too hard.

I have no expectation of profiting. Just be happy to break even by sharing the actual cost of the boards. Of course the first is always on a prototype board to get the thing working as expected. Second version is typically on a solder able perf board mounted in a box.

If I really like it then I lay out a good PCB and go from there.

Also....If enough are interested I might also buy the rest of the parts in bulk and just sell a complete kit complete with the enclosure if any interest is expressed.

chipstein (author) 3 months ago

I tend to automatically select op amps like the TLC272 that have very high input impedance, so as not to ever worry about it. However, in this particular circuit the LM358 should be fine.

ggallo3 months ago

Hi! I'm pretty new in electronic and I want to learn some more using your op amp.. But in my store there isn't any TLC272; so, what kind of changes would I have to do in the schematic in order to use the more common LM358?

achand86 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)  achand86 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) 9 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.
Drillbert9 months ago
Nice design. Can you provide a complete wiring diagram?
chipstein (author)  Drillbert9 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_1019 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_1019 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.
arthujt10 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 Murchison1 year ago
Good to hear from another 'scope fan. This one looks promising as a different, freestanding approach.
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)  SuperTrooper1 year 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.
eslighton2 years 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)  eslighton2 years 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.
1-40 of 77Next »