Weird LM35 voltage problem

Status
Not open for further replies.

Wond3rboy

Member
Hi i just connected the output of my lm35 sensor (.227v) to the input pin of my PIC 18LF4620 and it increases to 1.05V. I have heard about a voltage drooping but cant see why this is happening.Can any one tell why and how to correct this.
 
The pin wouldn't happen to be configured as an output?
The pin wouldn't happen to have the internal pullups enabled? (Unlikely because the pullups can't source much current)
 
Last edited:
What is the resistance of the pull-up resistor on the LM35 before you connect it to the PIC? What voltage are you supplying to the top end of the pullup resistor? Post a circuit.
 
Got it working.
@ Kchriste,
The pin is configured as an analog input but God knows what the heck was wrong with it!

@Mike,

There is no pull up resistor its just simple as given in the data sheet.

Also i wanted to ask 2 questions.

A pull up resistor of 470 ohms is ok for a DS12887 IRQ input?

Can a circuit behave differently on a PCB?or i am going of my rocker and need aspirin?
 
Last edited:
Sorry, you are right. The LM35 is a three terminal device. I got it confused with a two terminal temp sensor I recently used. I'm assuming you are powering it on 5V?
 
Yeah.I dont know why was it not giving correct output on the PIC pin.Now its working fine.The PICs a low power one operating from 3.3v. About my other question...I think a 470 ohm pull resistor for DS12887 IRQ is fine right?
 
...About my other question...I think a 470 ohm pull resistor for DS12887 IRQ is fine right?

How much the current can the IRQ pin of the DS12887 sink? What is the top end of the 470Ω connected to?
 
@Mike, the only parameter on IRQ pin that i got in the datasheet is its capacitance which is 7pf.No current sinking values have been given(specifically for this).The input sink current is given as(for all pins) 1-500na.

@Kchriste, i have connected it to AN0 with an external reference of 2.56 V.
 
Last edited:
The data sheet says that IRQ is an open-drain active-low output capable of sinking 4mA. You are running the clock on 5V, even though the PIC runs on 3.5V?

I would return the pull-up to 3.5V, and let I = 1mA, so R = 3.5/1m = 3.5K, call it 3.3K.
 
Hi Mike,
Yes, the RTC's voltage levels are -0.3 to 0.8 for low and high is 2.2 to Vcc+0.3. The pic is a 18LF4620 which can withstand 5v levels.

i have the RTC on a PCB which has a VCC of 5V.so i think i will go with one of 4.7k giving me 1.06milli amps. The datasheet which i have doesnt have any values.I am uploading it.OR can you please link up the datasheet that you got.

Are you considering IOL?

Thanks.
 

Attachments

  • DS12885-DS12C887A.pdf
    234.3 KB · Views: 245
Last edited:
@Kchriste, i have connected it to AN0 with an external reference of 2.56 V.
I see. The only thing that could cause that pin to source current, short of a hardware fault, would be if it was set as an output and set high.
Posting a schematic of the entire circuit would help at this point.
 
Same one I looked at. IOL is the current being sinked (sunk?) when the IRQ pin output voltage is 0.4V. The PIC input pin draws ~+-1ua just due to leakage. All of the current sunk by the IRQ pin is coming through the pull-up.
 
Thanks Mike, my bad, didnt look at it that clearly.

@ Kchriste here is the schematic.
 

Attachments

  • Pforforum.JPG
    70.7 KB · Views: 172
Syed,
Why are you running the PIC on 3.3V and everything else on 5V?
R2 in your diagram doesn't make sense to me.
Is MCLR enabled in software? If so, you need a pullup resistor on it too.
CS & MOT on the DS12887 should both be tied to ground. The way you've done it will work due to the built in pulldown on MOT, but tying both to ground would be more conventional.
As mentioned by Mike, if you intend to operate the PIC of 3.3V and the DS12887 from 5V, then R1 should be pulling up to 3.3V and not 5V.
 
Last edited:

Hi,

About the schematic, i uploaded an incorrect one(sorry) R2 is not present. The PIC is running on 3.3V so that my project can be upgraded. Will heed to your and Mikes advice on the 3.3V pullup. Both MOT and CS are tied to ground.
Thanks both for your replies.
 
The PIC is running on 3.3V so that my project can be upgraded.
The problem with doing that is that a 5V part driving a 3.3V powered PIC could cause the internal diodes (from the IO pin to Vdd) of the PIC to conduct, leading to all sorts of strange behavior.
 
The problem with doing that is that a 5V part driving a 3.3V powered PIC could cause the internal diodes (from the IO pin to Vdd) of the PIC to conduct, leading to all sorts of strange behavior.

But if i do the 3.3V pull up thing then can i avoid it?
 
Both the MAX3232 and the DS12887 will output over 3.3V on their IO pins at some point in time. This extra voltage will be clamped by the intrinsic diode to Vdd on the PIC's IO pins (PORTD). Sometimes this will be a problem.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…