0
\$\begingroup\$

This question already has an answer here:

I have planned to build a circuit to display voltage and time value using PIC16F877A micro controller.To do this i tested the circuit using Proteus software as i attached here. It can display up to 5V.

my question is can i read up to 300V using this micro controller?(I planned to use LR8N3G voltage regulator to give input voltage to PIC).will it damage the PIC? If so how can I read high voltage from this?

\$\endgroup\$

marked as duplicate by dim, JRE, pipe, Elliot Alderson, Warren Hill Feb 7 at 10:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \$\begingroup\$ What's the lower limit of the voltage to be read? If it's too low (e.g. 1V) then a simple voltage divider may not work. I mean, you may need to build a "smart" divider (i.e. activates/deactivates divider networks based on the input voltage). It also depends on whether the voltage is AC or DC. \$\endgroup\$ – Rohat Kılıç Feb 5 at 4:46
1
\$\begingroup\$

No, you usually can't read a voltage higher than the supply voltage of your microcontroller. To know exactly the maximum voltage that your microcontroller can read you need to look in the datasheet. You can use a voltage divider made of two resistors so that your microcontroller can safely read the voltage.

Here are its design equations:

$$ \begin{split} &\frac{V_\mathrm{in}} {Z1 + Z2} \cdot Z_2 = V_\mathrm{out}\\ \\ &\frac{(V_\mathrm{in} - V_\mathrm{out})^2}{Z_1} =\text{ Power dissipated by }Z_1 \end{split} $$

I suggest choosing \$Z_1\$ first.

enter image description here

enter image description here

If it's AC you'll need something else.

Be careful with high voltage. If you're not sure what you're doing, don't do it.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.