torsdag den 17. juni 2021

Reading I2C addresses

Many electronic modules are controlled by the I2C-protocol. I2C builds upon the concept of masters and slaves connected via a 2-wire bus. There are two pull up resistors. Each of them should be higher than 1 kohm. Vdd is 3.3 V DC or 5 V DC. The wiring is shown in figure 1.
Figure 1. Wiring of I2C.

I2C bus speeds range from 100 kbit/s in Standard mode, 400 kbit/s in Fast mode, 1 Mbit/s Fast mode plus, and 3.4 Mbit/s in High Speed mode. Each master and each slave has its own, unique 7-bit address.

The I2C scanner is shown below in figure 2. The scanner software is running on my Arduino UNO R3. There are 4 wires connected to the slave unit.

+5V is connected to Vin on the slave
GND is connected to GND on the slave
A4 is connected to SDA on the slave
A5 is connected to SCL on the slave

The UNO is powered via an USB cable.

Figure 2. I2C scanner with Arduino UNO.

Figure 3. Output from the I2C-scanner

Output from the scanner is displayed in the Arduino IDE. Select Tools > Serial Monitor. An example output is shown in figure 3. 

The Arduino I2C address scanner was created by Arbi Abdul Jabbaar and it is described here:

73 from OZ1BXM Lars
Homepage: oz1bxm.dk

Ingen kommentarer:

Send en kommentar