Problems with my Temperature sensor

Hi all not sure what’s happening here - I have an LM335A temperature sensor and when I run this snippet of code it reads the surrounding temperature (although it seems to read high) but when I put it near a heat source (like a lamp) the temperature reading goes down.

I tried it with an LM35DZ (and different code) and it works fine.

The code is below and any help would be greatly appreciated:

//TMP36 Pin Variables
int sensorPin = A0; 
 * setup() - this function runs once when you turn your Arduino on
 * We initialize the serial connection with the computer
void setup()
  Serial.begin(9600);  //Start the serial connection with the computer
                       //to view the result open the serial monitor 
void loop()                     // run over and over again
 //getting the voltage reading from the temperature sensor
 int reading = analogRead(sensorPin);  

  int KelvinC=273;
  float _sensorValue;
  float _Kelvin;
  float _Celsius;
  float _Fahrenheit;
  _sensorValue = analogRead(sensorPin);
  _Kelvin = (((_sensorValue / 1023) * 5) * 100); // convert 
  Serial.print(_Celsius); Serial.println(" degrees C");

 delay(1000);                                     //waiting a second

How have you got it wired?

Here's my setup - I also tried using a resistor (which had a nominal effect on bringing down the base temperature) but it had no effect the direction of the temperature change

(note: ignore the LED wiring as it's not used in the test code - I've obviously isolated the temp sensor code here)

You should post a circuit diagram, not a photo.