I am trying to use an LM335z temperature sensor (pretty much the same as an LM335) but for some reason it only displays 1022 on the serial monitor when I read it with an analog pin, I would expect it to display 200 or 500 or something but the whole day it's been stuck on 1022. It would also be helpful if you could tell me the calculation necessary to convert the voltage to temperature.
For the schematic style thing, I have used the image below as reference. In the output pin, I have taken 5V (from the rails on my breadboard which I think might possibly interfere a bit) and another wire leading to the analog output, and for the ground pin I have taken the wire across to ground; I saw all this in a few tutorials and diagrams.
Phoenix,
I realise you are new to electronics and micro-controllers but I cannot believe you are not familiar with the pointy things we call 'pencil' and the flat white stuff we call 'paper'. The idea of a schematic is you push the pointy end of the pencil around on the paper and make some kind of representation of how you have things wired up. Doesn't have to be neat, just has to accurately show where the wires go. When you have done that take a photo and upload so we can see.
You don't have to provide the information we ask for of course, equally we don't have to help you.
Note the part about:
"The following code reads the temperature from the LM35 sensor and displays the readings in the Serial Monitor. This code is also compatible with LM335 and LM34 – you just need to uncomment some lines in the code to use the right sensor".
PerryBebbington:
Phoenix,
I realise you are new to electronics and micro-controllers but I cannot believe you are not familiar with the pointy things we call 'pencil' and the flat white stuff we call 'paper'. The idea of a schematic is you push the pointy end of the pencil around on the paper and make some kind of representation of how you have things wired up. Doesn't have to be neat, just has to accurately show where the wires go. When you have done that take a photo and upload so we can see.
You don't have to provide the information we ask for of course, equally we don't have to help you.
All wonderful things begin with a pencil and paper but over the years I learned a big eraser can also be important.
@Ron_Blain.
The code you linked to in post#7 is written by someone who didn't understand.
It's potentially unstable (VCC as Aref) and has a low temp resolution (~1/5 of the A/D used).
Should not use that sketch as an example.
Better LM335/TMP36 code uses the internal 1.1volt Aref.
That turns the Arduino in an absolute/voltage A/D (not ratiometric), more suited for these voltage output sensor.
And in increases resolution 5x, so you can actually use one decimal place that makes sense.
Leo..
I wasn't able to take a photo because my phone is broken, and I find it interesting that you assumed that I don't know what paper and pencils are, I thought you said you aren't telepathic.
Wawa: @Ron_Blain.
The code you linked to in post#7 is written by someone who didn't understand.
It's potentially unstable (VCC as Aref) and has a low temp resolution (~1/5 of the A/D used).
Should not use that sketch as an example.
Better LM335/TMP36 code uses the internal 1.1volt Aref.
That turns the Arduino in an absolute/voltage A/D (not ratiometric), more suited for these voltage output sensor.
And in increases resolution 5x, so you can actually use one decimal place that makes sense.
Leo..
Wawa: @Ron_Blain.
The code you linked to in post#7 is written by someone who didn't understand.
It's potentially unstable (VCC as Aref) and has a low temp resolution (~1/5 of the A/D used).
Should not use that sketch as an example.
Better LM335/TMP36 code uses the internal 1.1volt Aref.
That turns the Arduino in an absolute/voltage A/D (not ratiometric), more suited for these voltage output sensor.
And in increases resolution 5x, so you can actually use one decimal place that makes sense.
Leo..
Very true and no, not the best example. However, I wanted to just give the original poster something that should display something other than his/her problem. Thanks for poing that fact out though.