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.

PIC16F690 A/D Input

Status
Not open for further replies.
Hi,

What resistor value, the internal switch resistance or some external resistance?
 
20V is easy, as long as the 0V on your 20V supply is tied to Vss on the PIC. In order to compute the required resistive divider, I would need to know EXACTLY what voltage the Vdd pin of the PIC is tied to. Don't just say 3.3V or 5V. I need to know it to at least three significant figures, i.e. 4.96V.

Current measurement is harder. In order to suggest something, I would need to see the schematic of what you are trying to instrument.
 
Hello,

The formula is this:

R1=(Vin-Vad)*R2/Vad

where
R1 is the upper resistive voltage divider resistor, and
R2 is the lower resistive voltage divider resistor, and
Vin is your input voltage (20v in this case), and
Vad is the max supply voltage for the PIC assuming you are using that as the AD reference also (5v in this case), and
R2 is a resistor picked according to the input resistance requirements of the PIC ADC, where 10k is a decent choice.

Given the above, your lower resistor would be 10k and your upper resistor would be 30k.

You might also note that depending on the accuracy and drift requirements you may want to go with a better regulator than the 7805 type.
 
Last edited:
My point, which was obviously missed above, is that no LM7805 puts out exactly 5.00V. The AD reading is ratiometric with respect to whatever the Vdd voltage actually is.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top