On my circuit I have a voltage detected (TC54) to detect when the level of the battery gets low. The output of this ic is high when there is enough battery, but it will be at battery voltage (12 or 15 volts). I am using a LM7805 to supply power for the microcontroller. Will feeding this high voltage level into the microcontroller cause damage? ( I would say yes to that). How can I read the signal out from the TC54? Would putting a large resistor in series with it solve the problem (1-5Meg)? Here is the schematic for the design. The RB0 goes to the microcontroller. J2 is the input terminal on the board. Circuit Schematic

  • \$\begingroup\$ Why use the TC54 if you have a PIC? Just use the PIC's ADC with a voltage divider. \$\endgroup\$ Mar 15, 2017 at 8:23
  • \$\begingroup\$ Just use a voltage divider? \$\endgroup\$
    – C K
    Mar 15, 2017 at 9:09
  • 1
    \$\begingroup\$ Suggest that you use the TC54VN variant that provides an open-collector output. The output will be high-impedance unless driven low by the TC54. You can then connect it to a 4.7K resistor to the PIC's Vcc. This will directly drive RB0. \$\endgroup\$
    – DoxyLover
    Mar 15, 2017 at 9:48

2 Answers 2


Use Voltage Divider Circuit to read the battery level

  1. Firstly convert 12V to 5V (or 3.3V depending on the micro controller)
  2. Use ADC to read the input voltage level.

If your PIC ADC support 3.3V then circuit will look like this one enter image description here

If support 5V then use this enter image description here

Note: If you want high accuracy choose right resistors for circuit, resistance value should be small as possible but same time it should not draw enough current that will effect battery. For more detail see this Link

  • \$\begingroup\$ This solution draws a constant ~2 mA from the battery. \$\endgroup\$
    – pipe
    Mar 15, 2017 at 11:15
  • \$\begingroup\$ if current is problem he need to replace resistance with high value \$\endgroup\$ Mar 15, 2017 at 11:18
  • 1
    \$\begingroup\$ And if you do that, you might not get an accurate reading for the ADC, and then you need to buffer the signal, etc. \$\endgroup\$
    – pipe
    Mar 15, 2017 at 11:25
  • \$\begingroup\$ Resistance should be as small as possible so that it will not impact on load (ADC) but same time do not draw current as well. \$\endgroup\$ Mar 15, 2017 at 11:59

How to read a high voltage logic signal with pic microcontroller

Will feeding this high voltage level into the microcontroller cause damage?

those are two totally different questions. to read a HV analog signal, you can divided it down with a resistive divider (generally). to read a HV logic signal, the same can be employed or a high value resistor is all needed, depending on your application.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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