I2C communication
Inter-Integrated Circuit (I2C) communication is a type of serial communication that allows interfacing multiple sensors to the computer. I2C communication consists of two wires of a clock and a data line. The Raspberry Pi Zero's clock and data pins for I2C communication are GPIO 3 (SCL) and GPIO 2 (SDA), respectively. In order to communicate with multiple sensors over the same bus, sensors/actuators that communicate via I2C protocol are usually addressed by their 7-bit address. It is possible to have two or more Raspberry Pi boards talking to the same sensor on the same I2C bus. This enables building a sensor network around the Raspberry Pi.
The I2C communication lines are open drain lines; hence, they are pulled up using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access