Skip to content

Connecting CMJCU-75 board with I2C LM75A to Raspberry PI

Notifications You must be signed in to change notification settings

hpaluch/pi-lm75a

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Connecting LM75A to Raspberry PI

How to connect popular LM75A Temperature sensor to Raspberry PI using I2C.

Raspberry PI and I2C LM75A

Tested HW/SW:

Setup

Connect your Raspberry PI to CJMCU-75 board using this layout

           Rasp. Pi
             1 2
CJMCU-75    +---+       CJMCU-75
NC  --  3.3V|o o|5V  -- VCC
SDA --  SDA |o o|NC
SCL --  SCL |o o|GND -- GND
             ...
            other pins unused

Install these requirements (see https://www.instructables.com/id/Raspberry-Pi-I2C-Python/ for details):

sudo apt-get install i2c-tools python-smbus

Should not be needed: Add your non-privileged user (typically pi) to i2c group to have access to /dev/i2c-1 device:

usermod -G i2c -a pi

If you are already logged as pi issue:

newgrp

To ensure that you are now member of i2c group.

Now you can try to detect LM75A I2C Device:

 i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Looks OK - device found at address 0x48

Now you can run example python program:

./test-lm75a.py 1 0x48

Expecting LM75 to have I2C slave address 0x48 on I2C BUS 1
Current temperature is 26.0 Celsius
Hysteresis temperature is 75.0 Celsius
Shutdown temperature is 80.0 Celsius

Here is I2C communication in Sigrok PulseView:

Getting current temperature (Pointer Register = 0x00):

LM75A Get Temperature PulseView

NOTE 0x001a = 26 (degrees of Celsius)

Getting hysteresis temperature (Pointer Register = 0x02):

LM75A Get Hysteresis PulseView

NOTE: 0x004b = 75 (degrees of Celsius)

Bugs

N/A

About

Connecting CMJCU-75 board with I2C LM75A to Raspberry PI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages