opamp to increase signal from LONG cable

Thread Starter

mxabeles

Joined Apr 25, 2009
266
hey there
i have a distance sensor hooked up to 25' cable, 3 conducters - gnd, 5v+ and analog output. There is some added noise and a weaker signal than when I plug the sensor directly into the microcontroller (arduino). Can I use an opamp (single sided preferably, i just bought an LM324) to cancel noise/bump signal?
Thanks, I know this INSANELY basic.
Best,
M
PS does opamp circuit go between sensor and cable or between cable and microcontroller?
 

Bychon

Joined Mar 12, 2010
469
There are "rail to rail" op-amps that can work in a 5 volt envelope. It must be placed at the sensor end. After the cable has gone 25 feet, the damage is done. No sense amplifying the noisy signal at the wrong end of the cable.
 

SgtWookie

Joined Jul 17, 2007
22,230
Show us the circuitry on your sensor end, particularly all bypass capacitors that you are using.

What is the cable that you are using? Wire gauge? Is it (hopefully) coaxial cable?

Once noise gets on an analog signal, you will have a dickens of a time trying to get rid of it.

Much better if you can prevent it from getting in there from the start.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
bypass cap 47uf electrolytic btwn power ground. didnt seem to have much of an effect on the signal itself.
OK so i will try with op amp. I found some schematics online that should work, but if anyone wants to post some schematics I'm not gonna cry about it ::))).
 

SgtWookie

Joined Jul 17, 2007
22,230
The 47uF electrolytic is a start. Also use a 0.1uF metal poly or ceramic cap; at least one for each IC.

An LM324's common mode range goes to ground, but not Vcc; limit is Vcc-1.5v. Out range is roughly 20mV to Vcc-1.5v.

If you try running it from a single 5v supply, don't plan on seeing anything higher than 3.5v or lower than 20mV out from it.

You'll also add a 3mV to 7mV offset when wired as a voltage follower/buffer.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
to be honest, the signal is not any weaker with long cable, its just alot noisier. I tried hooking up an impedence buffer circuit with opamp (analog out from sensor to +, - tied to output) but nothing better in terms of signal stability. Is this the best type of opamp circuit to be using in this situation?
Thanks,
M
 

Audioguru

Joined Dec 20, 2007
11,248
Since you are talking of using an old LM324 quad opamp that has very poor performance at audio frequencies then your signal must be low frequencies or DC. 25' of cable is nothing. 1000' of cable might cause your problems.
Maybe the receiving end of the cable has a resistance that is much too low? What is the sensor and what is the receiver? What level?
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
the sensor is an sharp IR distance sensor with bypass cap btwn power and ground. It outputs apx 0.2 - 2.7 Volts DC based on distance. It the analog output is being fed into a arduino microcontroller to control audio data in max/msp.
 

Bychon

Joined Mar 12, 2010
469
I've done this with a j-fet and it worked fabulously, except the DC offset of the j-fet was not a consideration...and it won't work in this application. Still, using a current buffer should work. I suggest that a terminating resistance be added at the Arduino end. That will lower the impedance of the line. I used 1500 ohms to terminate my application and the 324 will handle that load.

If this not work, the noise is coming in at the sensor...before the buffer amp, not in the wire acting as an antenna. Whole 'nuther problem.
 

retched

Joined Dec 5, 2009
5,207
Using coax or properly shielded cable will offer you a better signal to noise ratio IF the cable you are using is the problem. Actually it can only help.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
thanks guys!
To answer a couple of questions:
The noise is not coming from sensor, ive test run this with very short jumper cables from sensor to microcontroller and it performs A-ok.
Second, the cable could be an issue. What I have is a three conductor cable. The three conducters are each in plastic covering and there is a metal foil wrapped around all three.
There IS a "drain" i think, a bare metal solid wire that is touching the foil. Should I be using that as ground? That way it is kind of like a coaxial cable, i think. Right now of course I am using the plastic insulated wires.
I would just go ahead and try this myself but it would require de-soldering my op amp circuit so I thought I might ask ahead of time.
Thanks M
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
bychon: can u please explain in layman terms how to hook up the terminating resistor?
Thanks.......ie. what is the resistor between, 5v, gnd, sensor output, something in the opamp circuit?????? your talkin to an artist here :)))
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
yes retched, I was thinking as ground! Do u think using the aforementioned wire would be better than an insulated wire??? tnx
 

Audioguru

Joined Dec 20, 2007
11,248
Of course the drain wire should be connected to ground. The drain wire should be used instead of the ordinary wire that you now use as the ground wire and it should be connected to the sensor if it needs a ground connection. Then the foil becomes the shield.
 

retched

Joined Dec 5, 2009
5,207
Better an artist than a politician. Just to give a try, do you have 25 feet of standard stranded wire? I would do a test, even with a 25' extension cord to see if that clears it up. I really think the problem lies in the cabling.

[ed]
Audioguru, just saw your post.
He is correct....as usual... :)
[/ed]
 
Last edited:

Bychon

Joined Mar 12, 2010
469
The terminating resistor goes at the computer end of the cable between the signal wire and the 0 volt insulated wire. In that position, it requires the amplifier to send current (.001 amps) through the signal wire to the 0 volt wire. Stray noise leaking into the signal wire also has to drive that resistor, and since the noise is so much weaker than the amplifier signal, it gets squashed.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
266
by 0 volt insulated wire do you mean ground? cause by the way I tried using the "drain" wire as ground and it didn't really alleviate the problem :((
 
Top