PCT2075 Temperature Sensor

The PCT2075 [1] by NXP is a pin-compatible replacement for the LM75, but with 11-bit accuracy compared to the LM75's 9-bits. Additionally, the PCT2075 allows the address pins to work in three states, allowing you to assign 27 different I2C addresses.

Breakout boards are available, or you can mount the chip yourself on an SOIC-8 breakout board:


The default address, with all lines floating, is #x37 or 55.

Reading the temperature

The following routine reads the temperature and returns it as an integer, in 1/8ths of a degree Celsius:

(defun pct2075-temp ()
  (with-i2c (str #x37) 
    (write-byte 0 str)
    (restart-i2c str 2)
    (let* ((hi (read-byte str))
           (lo (read-byte str))
           (tmp (logior (ash hi 3) (ash lo -5))))
      (- (logand tmp #x03FF) (logand tmp #x0400)))))

To return the temperature as an integer number of degrees, or a floating-point number on a 32-bit version of uLisp, do:

(/ (pct2075-temp) 8)

  1. ^ PCT2075 Datasheet on NXP.