Bird
0
0
Raspberry Piprogramming~5 mins

Reading sensor data over I2C in Raspberry Pi - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is I2C and why is it used in sensor communication?
I2C (Inter-Integrated Circuit) is a simple communication protocol that allows multiple devices to talk to each other using just two wires: one for data and one for clock. It is used in sensors because it is efficient and requires few pins.
Click to reveal answer
beginner
Which Python library is commonly used on Raspberry Pi to read data from I2C sensors?
The 'smbus2' library is commonly used to communicate with I2C devices on Raspberry Pi. It provides easy functions to read and write data over I2C.
Click to reveal answer
beginner
What are the two main lines used in I2C communication?
The two main lines are SDA (Serial Data Line) for sending data and SCL (Serial Clock Line) for timing the data transfer.
Click to reveal answer
beginner
How do you find the I2C address of a sensor connected to Raspberry Pi?
You can use the command 'sudo i2cdetect -y 1' in the terminal. It scans the I2C bus and shows the addresses of connected devices.
Click to reveal answer
intermediate
What is the typical process to read sensor data over I2C in Python?
1. Import the smbus2 library. 2. Open the I2C bus. 3. Specify the sensor's I2C address. 4. Read bytes or words from sensor registers. 5. Convert raw data to meaningful values.
Click to reveal answer
Which two wires are used in I2C communication?
ASDA and SCL
BTX and RX
CMOSI and MISO
DVCC and GND
What command helps you find I2C devices connected to Raspberry Pi?
Agpio readall
Blsusb
Cifconfig
Dsudo i2cdetect -y 1
Which Python library is best for I2C communication on Raspberry Pi?
Arequests
Bsmbus2
Cnumpy
Dmatplotlib
What does the SCL line do in I2C?
ASupplies power
BCarries data signals
CCarries clock signals
DGrounds the circuit
What is the first step to read sensor data over I2C in Python?
AImport the smbus2 library
BWrite data to the sensor
CConvert data to string
DClose the I2C bus
Explain the steps to read data from an I2C sensor on Raspberry Pi using Python.
Think about how you start communication, get data, and make it useful.
You got /5 concepts.
    Describe the role of SDA and SCL lines in I2C communication.
    One line sends data, the other controls timing.
    You got /4 concepts.