Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

External Circuit attached with PIC16F877

Status
Not open for further replies.

ecaits

New Member
Dear Friends,

I am working on PIC16F877 project. I am using ADC and taking the signal from sensor and giving it to analog pin.
I am preparing the circuit in which I am considering the four point given below.

1. When sensor is short, at that time I am getting 0mV and I can declare that Sensor is fail in program.
2. When sensor is open, at that time I will get some noise from atmosphere and I will reduce it to 0mV by resistor so that I can declare it as sensor is fail.
3. When accidentally, I will get over voltage (any voltage > +5) at analog pin, I will reduce it to approx 5 V by using the zener diode connected to pin and ground and by sensing the +5V at pin I can declare that sensor giving over voltage.
4.When accidentally, I will get reverse voltage (any voltage < 0 or any negative voltage) at analog pin, I will reduce it to zero voltage through zener diode and Controller will sense 0 voltage so at that case I can declare in my program that sensor is fail.

When sensor is working normally, at that time I will get voltage 0-5V and I want to give it to analog pin without any voltage drop or minimum voltage drop.

I have prepared a circuit, attached in file but it is not working properly.

Please suggest me that how can I solve it.

Thank you,
 

Attachments

  • 20140827_142449.jpg
    20140827_142449.jpg
    38.1 KB · Views: 169
Are you not aware that almost all PIC pins have protection diodes?, so you don't require the zener - merely a series current limiting resistor (value dependent on potential input voltages, and required source impedance).
 
You cannot do this unless you give up some of the dynamic range of your ADC, and make the circuit much more complicated. Suppose you put a circuit between the sensor and the ADC so that the gain is 5/6 and it has a 0.5V offset. Now the a real sensor 0V is mapped to
0.5V, and sensor's 5.0V is mapped to 5*5/6+0.5 = 4.6666V.

Now you can use that the ADC reading is <0.5V to signal one fault, and if it is > 4.7V to signal the other. If the reading is between, then everything is normal.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top