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?
✗ Incorrect
I2C uses SDA (data) and SCL (clock) lines for communication.
What command helps you find I2C devices connected to Raspberry Pi?
✗ Incorrect
The 'sudo i2cdetect -y 1' command scans the I2C bus for connected devices.
Which Python library is best for I2C communication on Raspberry Pi?
✗ Incorrect
'smbus2' is designed for I2C communication on Raspberry Pi.
What does the SCL line do in I2C?
✗ Incorrect
SCL is the clock line that synchronizes data transfer.
What is the first step to read sensor data over I2C in Python?
✗ Incorrect
You start by importing the smbus2 library to access I2C functions.
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.
