Need help//DIY Voltage Detector//Measuring Device

Im trying to figure out a way to connect my Arduino to a device that creates a voltage drop when an event happens (switch closing). I need to measure this voltage (5volts) and corresponding .5 volt voltage drop (from 5 volts to +/- 4.5 volts) with precision and report it to the arduino via the analog input as a number between 0 and 1023. Would love to make my own device. The simpler the better. Any ideas? Im scratching a deep trench in my scalp over this one. Help would be greatly appreciated.

For example, this seems very accurate -- is there a DIY // instructable // bit of information on building one yourself?

http://cgi.ebay.com/Arduino-Voltage-Divider-Detection-Sensor-Module-cable-/150452258468?cmd=ViewItem&pt=LH_DefaultDomain_0&hash=item2307a746a4

The issue I`m having is a difficulty in understanding how the arduino works...with respect to this other voltage coming into the analog port. If the arduino is running its functions from a separate 5 volts...say the USB cable or an adapter...then the incoming voltage to the analog pin is from a different power source. So far, my attempts at simply running a wire from a point in the appliance i want to detect a voltage drop from and putting that wire in an analog input, wiring a resistor as well and a diode protection to ground from this wire -- have proven rather erratic and yield rather unsavory and nonstable results when the serialprint is looked at.

ie- with a voltmeter at the point in the appliance I read 4.5 at the drop. in the arduino serialprint it is showing 256 then 486 then 843 then 115 then -- whatever.

any ideas for this circuit or perhaps some way to decouple?

did you run a ground from the second devices power source to the arduino ground? otherwise its not a complete circuit

You may already know this, and it isn't quite what you were asking, but....

Are you SURE that the "top" voltage fed into your divider won't be above 5v by very much at all? (Someone with more expertise please jump in with the absolute upper limit?)

If the power required by (i.e., indirectly, the current to flow through) your voltage divider circuit isn't large, I'd power it from the Arudino's Vcc, and then you can be sure that the Arduino isn't exposed to too high voltages.

did you run a ground from the second devices power source to the arduino ground

This is a diagram of what you are doing if the grounds are not common.

http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

thanks wierdo557, tkbyd, and Grumpy_Mike,
it seems like everytime i put the arduino down, im learning from scratch again when i pick it up. i appreciate your help with the common ground suggestions and the note to be sure to "try but dont fry".

Ive stabilized the input and am getting(more or less) sensible input from the voltage sensor (a wire, go figure --- cheapest voltage sensor on earth)...but there is about a 5 milivolt swing in volts that seems to happen rather randomly. its in the range of 5 volts....anyone have a suggestion on how to decouple that 5 milivolt swing? i am tempted to put a mica capacitor between the 5 volt and the ground of the arduino or perhaps between my wire-voltage "sensor" and the ground of the appliance. does that have any possibility of working? i would love to have NASA clean input as it is for something even more important that our quest to discover in outer space. it`s for an art project.
:smiley:

Yes decoupling with capacitors helps a lot:-

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

If you let us have a look at the schematic perhaps we could offer some more stability suggestions. It sounds like you should be getting more of a voltage swing than you are getting.

I "get" this much....

You have a bit of wire which changes its resistance, which you want, in response to... something.

You're getting "noise"... i.e. the 5mV "wobble" arising when the "something" isn't changing.

I don't "get"....

What is the something you are sensing?

It may be that there are better sensors out there for what you want to do... sensors less susceptible to noise.

===
You may also want to filter the noise out in your software... ANYTHING (well... almost) CAN be solved either with hardware changes or with software changes... but often one or the other is The Right Way To Go to solve a particular problem.

Grumpy_Mike,
As much as I`d love to show you a schematic, I usually wait til the project is finished before making one. I am basically illiterate at SPICE and have a working copy of a schematic maker/tester but am certainly not a master of drawing the circuits.

Basic schematic could be looked at as follows -- a 7805 voltage transistor in a circuit from plus to earth. arduino wire connected to say a (7805) plus 5 volt circuit. a switch is closed which introduces a diode in the circuit....as the appliance draws current from the source, the voltage drops through the diode. the arduino then has a wire from an analog port to this 5 volt supply. the arduino ground is grounded to the appliance ground (thanks to everyones suggestions...i wasn`t sure)

the current drop (.5v) lasts about a tenth of a second. i need to pick up that voltage drop and then have an event triggered through a digital output going to HIGH, then back to LOW. i have posted my code recently in another topic...as the arduino seems to be unable thus far to pick up all the voltage drops.

i`m thinking it perhaps needs decoupling or perhaps better code...

tkbyd...just posted my code..under Hardware<Interfacing...
perhaps you can take a look and give me some suggestions

code posted here....any useful help would be greatly appreciated.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1277212987

gawd i hate the smileys
:o

You used the term "voltage drop" in an interesting context.

Do you mean by it that if you were watching the voltage between two points in the circuit over time, i.e. for a little while, you would see the voltage dip for a moment, and then come back to "normal"?

If so, you need to know that many people who spend a lit of time working with electronics would mean something very different by the term. "Transient voltage decrease" might be less confusing to them.

Also, you seem to be doing something that makes a big drop at point "A", resulting in a tiny... almost unmeasureable drop at point "B". Why not just "watch" the switch by more conventional means??

You want 1023 resolution over a 0.5... or is it 5mV (0.005V) range?? Even if you meant 0.5 v when you said that, you want a resolution of about 0.0005v? Better not breath within 5 m of the circuit, the EMF from your muscles moving will induce that in the circuit.

I usually wait til the project is finished before making one.

That is totally stupid. You can't make anything if you don't have a schematic.

The description sounds like you are making a tone of errors. Without a schematic we can't see what other wrong assumptions you have made.
It doesn't have to be in spice or anything fancy. Just draw it on paper and photograph it.