Analog pin of ADC in PIC16F877

Status
Not open for further replies.

ecaits

Member level 4
Joined
Jan 16, 2014
Messages
76
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
579
Hello Friends,

I am working on PIC16F877 controller based project where I am using ADC module and read the value of connected sensor's output. I am using different types of pressure sensor. I am using LCD to display the value of ADC. Pressure sensor is giving output 0 to 5VDC.

Case 1:
Now I want to detect the sensor in four different conditions.... given below...

1. When Sensor is Open, I want to display "Sensor is Open" on LCD.
2. When Sensor is short, I want to display "Sensor is Short" on LCD.
3. Due to sensor defect, if sensor gives reverse voltage to Analog pin then I want to display "Sensor Fail" on LCD.
4. Due to sensor defect, if sensor gives over voltage to Analog pin then I want to display "Sensor Fail" on LCD.

How can I sense the sensor's failure condition given above???

Case 2:
Some sensor is giving 4-20 mA output which I need to convert it to 0-5V output. How Can I convert I2V??
Plz provide me any circuit which helpful to me.

Thank you in advance.....

Nirav
 

Hi,

To recognize all options you need more input than the adc voltage.

With only the adc voltage you have three, max four areas to decode.

0..5V is always the reliable area.

Unfortunately a shorted sensor will give 0V also, so it is hard to recognize.

A sensor connected the wrong way will give -5 ..0V adc reading. Here you need a threshold at the 0V area. Use -0.1 to -5V reading to detect this case.

To detect a not connected sensor you may use a pullup to 6V. With an adc reading of more than 5.2V you may suggest it to be not connected. This unfortunately is the same as overvoltage.

Klaus
 

If you use 4-20mA or 1-5V output sensors, the sensor itself will normally tell you any faults it recognize itself.
This is done either by putting out less than 4mA/1V or more than 20mA/5V.

An unconnected sensor will be 0mA/0V.
A short circuited sensor will be less clear, either a high current or 0V. If the high current is possible in your system you should protect against it, or it will blow your sense resistor.

A reversed sensor should be possible to detect with an extra detection circuit, on a digital input. You will anyway need some conditional circuit before the ADC for the mA input.
 


Which extra detection circuit, I should use??? If accidentaly -15 V apply to analog pin then How can I protect the Controller and detect that reverse voltage is apply to analog pin???

- - - Updated - - -


If sensor connected the wrong way OR say -15V is applied to analog pin then how can I protect the controller and how can I detect that reverse voltage is applied to analog pin???
 

Hi,

to protect against damage you may need current limiting resistors, voltage divider, protecting diodes (zener, schottky, standard...)
You may also need OPAMPs to adjust for input volzage range.

It all depends on your needs, how your circuit looks now, how much effort you want to put in....and what protection level you want to achieve.

You have to specify all this.

If you further need help, we need to know your specifications and your circuit.

Klaus

Added:
If sensor connected the wrong way OR say -15V is applied to analog pin
or say 230V AC or an 5000V ESD pulse....
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…