Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Konfiguration I2C Bus with 4 1Wire Pi Slaves

594 Views - Created 31/10/2022

31/10/2022

Posted by:
ma.huber@web.de

ma.huber@web.de Avatar

I want to setup a Raspberry Pi2 Model B Rev 1.1 with 4 1Wire Pi Slaves.

On every Slave are 3 to 6 1wire Temperature sensors, 13 Sensors in total.

I use I2C-SDA on GPIO Pin 3 and I2C-SCL on GPIO Pin 5.

- Do I need Pullup Resistors between 5V and SDA and SCL Line?

- How is the correct entry at /etc/rc.local? Are the following lines correct?

modprobe ds2482

sh - c "echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device"

sh - c "echo ds2482 0x1a > /sys/bus/i2c/devices/i2c-2/new_device"

sh - c "echo ds2482 0x1b > /sys/bus/i2c/devices/i2c-3/new_device"

sh - c "echo ds2482 0x19 > /sys/bus/i2c/devices/i2c-4/new_device"

modprobe wire



Best regards,

Martin

31/10/2022

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hello Martin

You do not need pull-up resistors on the I2C pins. The 1 Wire Pi includes 10K pull-up resistors on the SDA and SCL pins.

All of the 1 Wire Pi boards will be connected to the i2c-1 device on the Raspberry Pi so you will need to use that address for each board. The following lines should work to initialise the 1 Wire Pi boards.


modprobe ds2482

sh - c "echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device"

sh - c "echo ds2482 0x1a > /sys/bus/i2c/devices/i2c-1/new_device"

sh - c "echo ds2482 0x1b > /sys/bus/i2c/devices/i2c-1/new_device"

sh - c "echo ds2482 0x19 > /sys/bus/i2c/devices/i2c-1/new_device"

modprobe wire

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.