negative voltage detection

how to detect negative voltage in arduino?
i have to drive -10 volt to 0 and 0 to +10 volt in an arduino .
how to do it ? pls guide me

Detect or measure.
If detect, what should the switch points be.

In general, a voltage divider connected to ground is used for positive voltages.
And a voltage divider connected to VCC can be used for negative voltages.
Leo..

Opto isolator.

Hi,

What is the application.

A language problem here, do you have to get an arduino to detect/measure a -10V to 0V and a 10V to 0V voltage?

Tom..... :slight_smile:

Sounds like a dual-rail supply has to be monitored.

If grounds can be shared, four resistors could do the job.
10k between +5volt and a digtal pin, and ~27k from the digital pin to -10volt will produce switch points of ~1volt and ~3.6volt. Far enough apart for a digital pin to detect two states.
10k to ground and 12k to +10volt could work for the positive voltage.
Same could be used for two analogue pins to measure voltage.
Leo..

OK, this is called the "XY problem".

You are asking for information on what you think to be the way to approach your problem, The problem is, this is not necessarily the proper way to approach it, and solutions to the question you first posed may not be a useful or efficient way to actually address your real need.

So you need to explain why you think you want to do this. It may be easier than you think, it may even not be necessary, and in particular, the answers you have otherwise received may even be quite inappropriate.

In general you can scale, level shift and invert with an opamp circuit called a differential amplifier,
so this might be one way if it turns out you are talking about analog rather than digital signals.

For detecting presence/absense there are many ways. Optoisolators for one.