SOFTWARE
2024-02-08 2506 View

GPIO Tutorial : Part3 - I2C

In the contemporary world of electronics, interfacing with EEPROM, real-time clocks (RTC), displays, sensors, and numerous other devices has been dramatically simplified, making electronic design less intricate, more streamlined, and demanding less hardware space. The credit for this significant advancement goes solely to I2C.

KIWI board offers various interfaces for connecting external devices. The Inter-Integrated Circuit (I2C) is among these interfaces, a widely used serial communication protocol enabling multiple devices to communicate over short distances.

What is I2C?


I2C, or I²C, stands for Inter-Integrated Circuit, a communication protocol developed by Philips Semiconductors. It's a two-wire, synchronous, multi-master protocol enabling communication between multiple devices via a shared bus. 

How does i2c work on KIWI boards?


The I2C facilitates communication between the KIWI boards and connected peripherals operating through a shared bus. This communication protocol utilizes two wires: Serial Data (SDA) and Serial Clock (SCL). As the master device, KIWI boards control communication by generating clock pulses on the SCL line, regulating data transmission timing. Each slave device is assigned a unique address, enabling the master device to select and initiate communication with specific peripherals on the bus. Through this synchronous, multi-master protocol, KIWI boards can seamlessly exchange data with various peripherals, including sensors and integrated circuits, making them versatile platforms for a wide array of applications.

Applications of KIWI boards and I2C


1Internet of Things (IoT)

With I2C, KIWI boards connect easily to sensors for monitoring temperature, humidity, and more, making them a hub for IoT projects. Useful for smart home control or environmental monitoring, great for weather stations or smart home projects.

2. Industrial Monitoring

KIWI boards can monitor machines and collect data, helping with maintenance or inventory management tasks.

3. Science Experiments

KIWI boards can be used in labs for data collection and analysis, aiding research in various fields.

KIWI boards GPIO - I2C


For a simple demonstration, establish a connection between the VEML7700 sensor and the I2C interface of the KIWI boards. This straightforward setup highlights the GPIO I2C functionality of the KIWI boards, demonstrating their ability to communicate with peripherals effectively.

For further details regarding the sensor, please refer to the official documentation.

In order to set up the sample flow for Node-RED, please refer to our earlier publication. For more information, consult KIWI310's middleware documentation, which is available on Github

  • On the Node-RED's GPIO flow for I2C,  use the Set I2C config to enable the function.

  • Use Get I2C config to check the status of the function.

 

  • Use the injection node to input the command for the VEML7700. By default, the sensor has an 8-bit address of 21h for reading the ALS values.

Use the command 0X00:ALS to read the value of the status of the sensor; 0x90 is for disabled, 0x92 is for enabled.

  • Use the command 0x04:  Read data to retrieve the 16-bit data for the luxes measurement.

Why KIWI board Solutions?


When coupled with the I2C communication protocol, KIWI boards can seamlessly interface with various sensors, actuators, and other peripherals. This opens up possibilities for building sophisticated projects, ranging from home automation systems to robotics and IoT devices. Additionally, I2C's simplicity and efficiency make it ideal for connecting multiple devices to the KIWI boards, enabling complex systems to be easily developed. 

About KIWI board


KIWI board is a complete solution provider, supporting all aspects of your project, from hardware to software to system integration, to keep your application running securely, reliably, and at peak performance. KIWI board builds its products for high reliability, performance, security, scalability, and versatility. So, customers can expect a long lifespan, quickly adapt to evolving system requirements, and adopt future technologies as they emerge.

Next steps


Ready to talk about your projects with a KIWI board expert? Contact us

Want to hear more from KIWI board?  for our newsletterSign up

Or request a quotation