Analog input voltage

Thread Starter

ecaits

Joined Jan 6, 2014
56
Dear Friends,

I have two-three silly question in my mind...

1. If I give more than 5V, say 10V to analog pin of ADC then what happen???

2. If I give negative voltage to analog pin of ADC then what will happen???

3. If I have 4-20mA output of sensor, can I use it as analog input??? OR First I need to convert 4-20mA to equivalent 0-5V??? If yes, How can I covert the same???

I am using PIC16F877.

Thank you in advance,
 
Last edited:

hexreader

Joined Apr 16, 2011
619
You forgot to give any information on exactly which ADC you are using.

Some ADCs will happily accept +10 volts and negative volts, others will not.
 

Papabravo

Joined Feb 24, 2006
22,111
A resistor of 249 Ohms 1% will convert currents as follows:

.004 A * 249 Ohms = .996 Volts
.010 A * 249 Ohms = 2.49 Volts
.020 A * 249 Ohms = 4.98 Volts

You can use an opamp configured a a voltage follower to avoid having the ADC input load the current loop.
 

shteii01

Joined Feb 19, 2010
4,644
There are voltage ADC, you will need to convert your current to voltage.

There are current ADC, you feed current to the ADC.
 

ErnieM

Joined Apr 24, 2011
8,415
Generally you make any analog device very unhappy when you apply a voltage at any terminal greater then the positive supply, or less than ground (or the negative supply).

Most input pins these days have "ESD" diodes to conduct energy to the power rails in case of a sttic zap. Often you can use these to keep your device safe from occasional short term overvoltages, but you need to insert a resistor in series with the input line.
 

MrChips

Joined Oct 2, 2009
35,167
Putting voltages greater than Vcc (Vdd) or lower than GND (Vss) isn't going to sit well with integrated circuits.

In a worst case scenario, a CMOS circuit will latch-up, i.e. go into a SCR parasitic short circuit state that literally fries the chip.

As Ernie points out, you need to put a resistor in series to limit the current plus voltage clamping diodes if the chip does not already have input protection diodes.
 

wmodavis

Joined Oct 23, 2010
739
Dear Friends,

I have two-three silly question in my mind...

1. If I give more than 5V, say 10V to analog pin of ADC then what happen??? What is the allowable range of the ADC your asking about? Data sheets provide that information.

2. If I give negative voltage to analog pin of ADC then what will happen??? What does the Data sheet say about that?

3. If I have 4-20mA output of sensor, can I use it as analog input??? OR First I need to convert 4-20mA to equivalent 0-5V??? If yes, How can I covert the same??? No need to be 'covert' about it. 4-20 mA loops ARE analog signals. Does your ADC accept a current input? What does the Data sheet say about that? Most if not all ADCs read voltage. If yours is such then you need to convert (or is it covert?). PapaBravo is right on.

Thank you in advance,
See answers above.
 

ErnieM

Joined Apr 24, 2011
8,415
I am using PIC16F877.
My comments still stand:

Generally you make any analog device very unhappy when you apply a voltage at any terminal greater then the positive supply, or less than ground (or the negative supply).

Most input pins these days have "ESD" diodes to conduct energy to the power rails in case of a static zap. Often you can use these to keep your device safe from occasional short term overvoltages, but you need to insert a resistor in series with the input line.
PIC16F877 Data Sheet said:
The maximum recommended impedance
for analog sources is 10 kΩ.
Also, max current into or out of a pin is 20mA max (it's listed as "Clamp Current" in Table 15.0). So a series 5K resistor keeps the ESD diode happy but provides a low imedance for the A2D.

If the voltage goes to 10V the A2D reads 1023, if it goes below ground it reads 0. I would use a resistor below what Papabravo suggests so you can read a difference between a legit 20mA input and an open sensor (which could give you that 10V).
 
Top