Wiring Advice - Analog input reading 0-5v 2 wire control signal - Oscope replace

Hello all.

I fear I'm just overcomplicating this, but wanted to ask before I let any blue smoke out.

I am using an Arduino Uno as an interpreter in the middle of an automotive test control stand. This stand is normally driven by a piece of custom (read: Closed source, no one knows how it works anymore nor has any documentation on it...) hardware that does all the controls work. One of it's current outputs is a position command mapped to 0-5v on a 2 wire BNC. This was normally fed into an Oscilloscope to provide the baseline signal to compare another "actual position" signal to in data logging.

My goal is to take a parallel "copy" of that 0-5v signal and read it into an analog pin of my Uno, do some calcs, and control a stepper motor. I already have the stepper motor control and analogRead() coded, works great with a normal voltage divider/3 wire analog sensor concept. My problem is I have a 0-5v 2 wire signal.

My basic knowledge of Oscilloscopes tells me the two wires of the BNC connector would be connected through a large resistor and the "sense" lead tapped off the + lead (all internally in the Oscope). My assumption in using the arduino is that I need to connect the + lead to A0, and connect the + lead back to the - lead of the BNC cable via a large resistor, thus creating a voltage divider similarly to how the Oscope is setup internally. Is this making any sense? Can I somehow use an internal pullup resistor or something to achieve this? If the 0-5v signal is low enough current, would it be safe to forego the divider and just directly hook the + to A0 and the - side of the BNC cable to GND?

Thanks in advance for any guidance.

Hi Squirrelly

If the 0-5v signal is low enough current, would it be safe to forego the divider and just directly hook the + to A0 and the - side of the BNC cable to GND?

The Arduino analog input is high impedance, like the oscilloscope. The voltage source from your hardware can't force current into the Arduino; the Arduino draws a [u]very[/u] small amount of input current. So current is not an issue here.

So long as you are sure that the signal will not go outside 0 to +5 V, you can connect directly as you describe.



One point to watch is the references against which the 0 to 5V signal is generated and measured.

The default for the Arduino is that the ADC uses the 5V supply on the Arduino board as the reference against which it measures the input voltage on the analog pin. If you power a sensor from the Arduino (or attach a potentiometer), any small variations in the 5V supply are cancelled out and do not affect the value returned by analogRead().

But if you are measuring an external voltage that is not tied to the Arduino 5V supply, then variations in supply voltage on either side can affect the readings you get. Depending on the accuracy you require, this may or may not be a problem.

Does your hardware have a reference voltage output, as well as the signal output?

Excellent, thank you for your advice. I will look into whether the hardware has any reference voltage output. If it does so I'll feed it into the AREF pin and enable that. I thought I was on the right track... overthinking such things can be a problem sometimes :astonished:

So the question still remains. I have an wideband HEGO that has a signal wire (5V) and a ground. Let's assume I don't need to have it perfectly referenced. I would obviously hook the signal wire to an analog input. Where do I put the ground? To the GND pin? Keep in mind I have another analog sensor and a digital sensors that will be connected via 3 wire solutions (5V, GND, input pin). Will hooking into ground for the analog signal be a problem?

Should be no problem to have a shared ground. Normally ground IS your reference.

Awesome. I might even be able to tap into the serial output of the controller, but I think I will start with analog and see if that is "good enough"