Shop OBEX P1 Docs P2 Docs Learn Events
Using ANALOGIN (SX/B Compiler) To Read A LM34 Temperature Sensor — Parallax Forums

Using ANALOGIN (SX/B Compiler) To Read A LM34 Temperature Sensor

aliniousalinious Posts: 51
edited 2006-12-02 21:50 in General Discussion
I am using the ANALOGIN command from the SX/B compiler to read the analog output from a LM34 temperature sensor. When I warm the temperature sensor, I see the temperature change from approximately 80 degrees Fahrenheit to 87 degrees Fahrenheit on my digital multimeter. If I add the temperature sensor to my circuit, I get an output (being sent via RS-232 to Basic Stamp Debug Terminal) of 109 to 111 by using the ANALOGIN command, but when I warm the sensor, it continues to output 109 to 111 even though the sensor has increased its voltage output.

I initially started by connecting a potentiometer to the circuit and recorded output values of 0 to 239 in order to test my circuit and program. I believe an output of 0 to 239 when using a potentiometer is normal due to the high input impedance of the circuit. Therefore, is it possible that the input impedance to the circuit is not allowing me to see a change in the output (from the SX) when I warm the temperature sensor? What could I change so as to be able to see the output from the SX change as the analog value of the temperature sensor changes?

I have included the schematic as to how the temperature sensor is connected to the SX along with the source code I am using.

Thank-you,

Alan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I learn when I succeed, but I learn more when I fail."

Post Edited (alinious) : 12/2/2006 9:29:59 PM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2006-12-02 21:50
    Alan,
    If the meter shows the voltage going up but the ANALOGIN reading is not, (you do have the both connect at the same time ?) then try using a different value cap (I suspect you need a smaller value, but try a larger one too). Also try increasing the "prime" value from 1 to 4 or 5 and see if that makes a difference.

    What can happen is if you have too small of a cap, the voltage will not become steady and will just keep jumping up and down as the feedback changes. If you have too large of a cap, the voltage takes too long to become steady (a larger prime value helps here).

    I think original circuit was for 4MHz, you are using 20Mhz so the original circuit should work if you make prime = 5 (because you are 5 times faster).

    Let us know if anything helps...

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
Sign In or Register to comment.