Determining direction of current on wires

Hello,
I am working on a project where I am trying to determine the current and voltage on 4 wires (2 pairs - power and sensor) running to a sensor. I need it to work where I do not have access to anything but the wires so all the information I need will need to come from the wires.
I am currently able to get the voltage and current readings and match up the two pairs (power and sensor), but what I need help with is determining which direction the current is flowing.
I have tried running the same source to two different analog inputs (A0 and A1) and putting in diodes so it will only run to one of the two inputs. My thinking is that the diode will allow the positive reading through and block the negative. Then if I got input in A0, I would know that it is running in one direction and if I get it on A1, I know it is running the opposite direction. That idea isn't working though - it gives me a signal on both inputs no matter what. I'm not sure if I have wired it up incorrectly or if the idea just doesn't work.
Does anyone have any ideas on how I can tell which of the inputs is positive and which is negative and therefore determine the direction of the current.
Not sure I explained this well or if it will make no sense to anyone reading it.
Thanks for your help!

gfunx:
Does anyone have any ideas on how I can tell which of the inputs is positive and which is negative and therefore determine the direction of the current.

Multimeter.

Don't do trial and error on your Arduino - too expensive.

...R

Do you at least know which pair is the power supply? If so it should be easy to work out which of these is the GND. Simply put a multimeter across them and look at the output. If your first guess is wrong and you put the +ve supply on the -ve of your multimeter, you'll get a minus sign on your display.

Once you've done this, you can then connect your GND to the -ve of your multimeter and one at a time measure the sensor wires. The one that gives the highest value is the +ve side of the signal. Although this may not work.

Do you have details of exactly what "sensor" you have. I'm sure there must be a datasheet available.

Thanks for the replies so far guys, but I probably didn't do a good job of explaining myself. I am basically trying to get the arduino to function as the multimeter for this part of my project. I am therefore trying to figure out which wire is the positive and negative using just the arguing (no multimeter). That is a requirement for the project to work.

Obviously I can't have the negative running in to the arduino inputs so what I had been trying to do is have two inputs for each wire. One would block the negative current, the other would allow the positive. By doing this, I thought that I should be able to determine which direction the current was coming from. If it goes to the first input (that input is positive), it is coming from one way - if it goes to the second input then the current is coming from the other way.

I do not have one specific sensor in particular, I need it to work for a variety of sensors.

Don't know if that clarifies things any better.

OK For the power connectors.

Wire A to the cathode of a diode. The anode of this diode goes to GND on the arduino
Wire A also goes to the anode of another diode. The cathode of this goes to an input pin.

treat wire B exactly the same except using a different input pin.
You now have two inputs that are relative to Gnd of the arduino.
The highest willl tell you which voltage you have and the pin that it's on will tell you which is +ve.
You may need to do some adjustment to allow for the forward voltage on your chosen diodes.

Assuming your sensor values never go below the negative rail of the power supply of the circuit under investigation. You can now connect them directly to another pair of input pins.

KenF,
That was exactly what I needed. Thanks so much!

Don't forget to subtract the diode drop from the voltage after you determine which is the positive.
You can subtract 0.7V /0.00488 = 143 analog counts (@ 4.8mV/count )(5V/1023=0.004887585532746823069403714565 V) ) (assuming 1n4001 silicon diode)(0.3 for germanium)

raschemmel:
Don't forget to subtract the diode drop from the voltage after you determine which is the positive.
You can subtract 0.7V /0.00488 = 143 analog counts (@ 4.8mV/count )(5V/1023=0.004887585532746823069403714565 V) ) (assuming 1n4001 silicon diode)(0.3 for germanium)

Admit it! you used a calculator for that :wink:

0.2978657483 for germanium :wink:

LarryD:
0.2978657483 for germanium :wink:

That seems awfully low. Are you sure it's not 0.2978657484 ? I'll have to get my multimeter out :slight_smile: