Feedback
Feedback

If you are having issues with the exercises, please create a ticket on DevZone: devzone.nordicsemi.com
Click or drag files to this area to upload. You can upload up to 2 files.

Lesson 6 – Serial communication (I2C)

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 peripheral driver in nRF Connect SDK to interface with an external sensor. Typically, in nRF Connect SDK/Zephyr, a sensor driver is developed as a separate module “device driver”. However, in this lesson, we are focusing on learning the I2C APIs, so we will interact directly with the sensor from the application using these APIs.

This lesson has two exercises, depending on which board you are using:

  • Exercise 1—Using BME280 sensor board with I2C and SPI interface connector. The SPI connector will be required for another exercise on the DevAcademy (not supported by Thingy’s).
  • Exercise 2 – Using a Thingy:91 or Thingy:53 to connect to the BH1749 color sensor on the board.

The exercises both demonstrate how to use the I2C driver, so it is sufficient to complete only 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

For exercise 1:

Important

Exercise 1 can also be completed using the X-NUCLEO-IKS01A3; however, it is not recommended for new designs (Deprecated Hardware). If you are interested in completing the exercise with the X-NUCLEO-IKS01A3, please follow the instructions for SDK versions v2.0.0 to v2.6.2.

For exercise 2:

  • Thingy prototyping platform (Thingy:91 or Thingy:53)
Register an account
Already have an account? Log in
(All fields are required unless specified optional)

  • 8 or more characters
  • Upper and lower case letters
  • At least one number or special character

Forgot your password?
Enter the email associated with your account, and we will send you a link to reset your password.