LM34 Issues
Cyber
Posts: 2
I don't know where to start with my LM34 Sensor, and anything I have found on forums, the powerpoint, or on other websites does not seem to assist with my issues.
We are in BASIC Editor using BS2, and we have the language to 2.5.
I do have a code that I thought might work that ended up not helping:
// LM34 temp sensor connected to analog pin A0
const int tempSensor = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(tempSensor), DEC);
delay(300);
}
We are in BASIC Editor using BS2, and we have the language to 2.5.
I do have a code that I thought might work that ended up not helping:
// LM34 temp sensor connected to analog pin A0
const int tempSensor = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(tempSensor), DEC);
delay(300);
}
Comments
1. You can use an ADC and read the voltage the LM34 is producing.
2. You can turn the LM34 into a current source and use RCTIME. Here are pointers to a couple of threads: Look at the comments from Tracy Allen.
https://google.com/url?q=forums.parallax.com/discussion/152187/lm34-and-the-basic-stamp-2-5&sa=U&ved=0ahUKEwjI2JWxvYzMAhUJ4mMKHZkYA0sQFggRMAQ&client=internal-uds-cse&usg=AFQjCNHDbR1F54dnP2dKhmALXBYtJuiqNQ
https://google.com/url?q=forums.parallax.com/discussion/97807/the-lm34-and-bs2&sa=U&ved=0ahUKEwjI2JWxvYzMAhUJ4mMKHZkYA0sQFggOMAM&client=internal-uds-cse&usg=AFQjCNFYe_XPgnQEPfErKs28uzsSha1JAQ
In addition to the thread Tom pointed out, there's a more involved discussion here, which includes calibrating the unit:
http://www.phanderson.com/stamp/tutorial_7.html
but note it is pre-PBASIC 2.5. It should still work for you, though.