Overview
Communicating with sensors and external components is a very common task performed by microcontrollers. The Inter-Integrated Circuit (I2C) bus is a popular protocol used to communicate with external components. In this lesson, we will go over the basics of I2C and learn how to use the I2C driver in nRF Connect SDK to interface with an external sensor.
The exercise is divided into two parts:
- Exercise 1—Use the X-NUCLEO-IKS01A3 expansion board on top of a DK to communicate with the STTS751 temperature sensor, or connected using jumper wires if the DK does not have an Arduino connector(nRF54 DKs).
- Exercise 2 – Using a Thingy:91 or Thingy:53 to connect to the BH1749 color sensor on the board.
The exercises both cover how to use the I2C driver, so it is sufficient to only do one of them.
Objectives
- Learn how to use the I2C driver in nRF Connect SDK
- Practice using the I2C driver APIs through a hands-on exercise
- Communicate with an external sensor using the I2C bus
Special hardware requirements
- An X-NUCLEO-IKS01A3 expansion board or a Thingy prototyping platform (Thingy:91 or Thingy:53)
- 4x Jumper wires (socket to socket) if you are using the nRF54L15 DK