1

I've got one GY-80 IC and one ms5803 pressure sensor, interfaced to a Pi. Both are working fine. Then I connected the SDA and SCL pins of the sensors and then to Pi. All of the devices are displayed using the command:

pi@raspberrypi:~ $ i2cdetect -y 1
 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --
70: -- -- -- -- -- -- 76 77

But when I tried to read pressure sensor whose I2C address is id 0x76, it gives the error:

File "/home/pi/workspace/src/gy_80/Psensor_node.py", line 50, in main
bus.write_byte(0x76, 0x58)
IOError: [Errno 5] Input/output error 

bus.write_byte(0x76,0x1E), which is reset command, works perfectly while any other command generates error. The error generating code section is:

import smbus 
import time 

bus = smbus.SMBus(1) 
#0x1E(30) Reset command 
bus.write_byte(0x76, 0x1E) 
time.sleep(0.5) 

def main() 
    #0x40(64) Pressure conversion(OSR = 256) 
    command bus.write_byte(0x76, 0x50) ### THIS LINE CAUSES ERROR 

Any help will really be appreciated.

2
  • 1
    You'll need to post your code.. Mar 30 '17 at 9:03
  • I'm posting error generating part here.Irony is that bus.write_byte(0x76,0x1E) ,which is reset command works perfectly while any other command generates error. import smbus import time bus = smbus.SMBus(1) #0x1E(30) Reset command bus.write_byte(0x76, 0x1E) time.sleep(0.5) def main() #0x40(64) Pressure conversion(OSR = 256) command bus.write_byte(0x76, 0x50) ### THIS LINE CAUSES ERROR Mar 30 '17 at 9:19
1

For connecting multiple slaves with exact same address you will need I2C multiplexer.

Like one mentioned here

1
  • I'd like to see this verified, but from the i2cdetect output it looks like one device is at 0x76 and the other at 0x77. That should be legal.
    – NomadMaker
    Jun 7 '18 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.