> I am running the PIC on 5V power supply (using the LM7805 regulator). I > want to be able to detect the input voltage of the LM7805 when it falls down > to around 6V. I don't have any ADC port left on the microcontroller. All I > have is a digital input. My goal is to build the simpliest and cheapest > circuit possible. Maybe with one transistor and few resistors. Do you have > any idea? Thank you in advance! Small npn transistor. Emitter to ground R1 from Vin to base. R2 from base to ground. Collector to PIC pin. Pullup resistor (say 100k) from pin to Vdd or internal pullup on. When voltage in is such that Vin x R2/(R1+R2) is more than 0.6 volts or so the transistor will be on and its collector will be pulled low. eg for R2 = 10 and R1 = 100k the transistor will be turned on for Vin > ABOUT 6.6 volts Vary R1 and or R2 to suit. RM -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body