Hi mimmmis,
Welcome to the forum.
If I read your question correctly, you want the PIC16F876’s A/D input to read a 24 V battery. You are not concerned with the battery’s high end voltage. You want to monitor the low end voltage. Say from 0 to 5 Volts. To make sure it does not drop below three Volts.
Looking at the PIC data sheet:
PIC16F87X Data Sheet
15.0 ELECTRICAL CHARACTERISTICS
Absolute Maximum Ratings
Voltage on any pin with respect to VSS -0.3 V to (VDD + 0.3 V)
(except VDD, MCLR. and RA4)
Voltage on VDD with respect to Vss -0.3 to +7.5 V
Voltage on RA4 with respect to Vss 0 to +8.5 V
That Voltage [ 24 volts or more ] may be just a little too high for the PIC to handle directly.
You could make a simple voltage divider but the “low end” voltage resolution would suffer.
As long as the A/D is just measuring slow changing battery voltage, you could use a low voltage Zener Diode to protect the input.
Note: any voltage above the Zener voltage would be clamped and not show up as an increase on the PIC A/D pin.
Bookmarks