At 10:59 AM 10/1/2006, Matthew Miller wrote: >On Mon, Oct 02, 2006 at 12:19:41AM +0800, genome wrote: > > Hello.. > > What happens if a PIC pin configured as a 10bit a\d receives negative > > voltage... I'm interfacing an lm35c temperature sensor to a pic > and it says > > on the datasheet that lm35 will produce a negative output voltage when > > measuring less than 0 degrees celsius... > >You can do a few things: don't use the full-range application shown in >figure 2 of the datasheet or using a summing op-amp to add a constant >voltage to the lm35 output. I'm sure there are other solutions. Note that the LM35 cannot produce that negative output voltage without a pull-down resistor to a negative rail. The easiest way to deal with this is to use a 1.2V shunt regulator in series with the bottom end of the LM35. Add a 10K pull-down resistor to ground. This gives the situation where 0 degrees C is the value of the shunt regulator (1.2V). Temperatures below 0c are less than 1.2V, temperatures higher than 0c are above 1.2V. Easy to work with. dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 22 years of Engineering Innovation (1984 - 2006) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist