I 2 C Communication with an Arduino

Similar documents
The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Hardware Connections between Arduino and IMU Nori Wilkins Apr. 5, 2013

Adafruit SHT31-D Temperature & Humidity Sensor Breakout

PN532 NFC RFID Module User Guide

KTA-223 Arduino Compatible Relay Controller

MCP4725 Digital to Analog Converter Hookup Guide

Android Application Development and Bluetooth Technology

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

HDMM01 V1.0. Dual-axis Magnetic Sensor Module With I 2 C Interface FEATURES. Signal Path X

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

Designing VM2 Application Boards

Accessing I2C devices with Digi Embedded Linux 5.2 example on Digi Connect ME 9210

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

Integration of Arduino as a slave system to LonWorks based System using I2C Interface

Theory and Practice of Tangible User Interfaces. Thursday Week 2: Digital Input and Output. week. Digital Input and Output. RGB LEDs fade with PWM

Raspberry Pi. Hans- Petter Halvorsen, M.Sc.

DS1307 Real Time Clock Breakout Board Kit

USB / Data-Acquisition Module NOW LEAD-FREE

USING I2C WITH PICAXE

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

Using Xbee in Serial Communication

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

LCD I 2 C/Serial RX Backpack. Data Sheet. LCD to I2C/Serial RX Backpack I2C or Serial RX communication with Standard 16 Pin LCD modules

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Introduction to Arduino

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Testing Data Radio Modem with Serial Port Tool V1.20

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

Lab Experiment 1: The LPC 2148 Education Board

Surveillance System Using Wireless Sensor Networks

Tutorial. replace them with cell-phone operated module. The advantages of a cell-phone operated bot are:-

Selecting and Implementing H-Bridges in DC Motor Control. Daniel Phan A

Electronics 5: Arduino, PWM, Mosfetts and Motors

Quick Installation. A Series of Intelligent Bar Code Reader with NeuroFuzzy Decoding. Quick Installation

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

3.2 inch QVGA TFT Color LCD User s Guide Version 1 & 2

Electronic Brick of Current Sensor

IR Communication a learn.sparkfun.com tutorial

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

User Manual. AS-Interface Programmer

BUILDING INSTRUCTIONS

Bi-directional level shifter for I²C-bus and other systems.

DS1307ZN. 64 x 8 Serial Real-Time Clock

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

Green House Monitoring and Controlling Using Android Mobile Application

CAN-Bus Shield Hookup Guide

AN2680 Application note

NHD C0220BiZ FSW FBW 3V3M

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

MAX5417L Evaluation Kit/Evaluation System

Arduino Lesson 0. Getting Started

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

MMC314xMR. Ultra Small 3-axis Magnetic Sensor, With I 2 C Interface. Signal Path X. Signal Path Y. Signal Path Z FEATURES

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Definitions and Documents

Building a Basic Communication Network using XBee DigiMesh. Keywords: XBee, Networking, Zigbee, Digimesh, Mesh, Python, Smart Home

Smart Thermostat page 1

Real Time Clock USB Evaluation Board V3.0

Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol

Application Note IMU Visualization Software

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

TSL2561 Luminosity Sensor

EEL 4924 Electrical Engineering Design (Senior Design) Final Report. 19 April Name: Brandon Kalarovich

A-307. Mobile Data Terminal. Android OS Platform Datasheet

AXE033 SERIAL/I2C LCD

DS1621 Digital Thermometer and Thermostat

TEECES DOME LIGHTING SYSTEMS

Arduino Shield Manual

[PROJECT PLAN: IPOD BARCODE SCANNER]

Serial port interface for microcontroller embedded into integrated power meter

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

AN : Using Wago CANOpen IO

Arduino DUE + DAC MCP4922 (SPI)

DS1621 Digital Thermometer and Thermostat

Chapter 5 Real time clock by John Leung

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Options for ABB drives, converters and inverters. User s manual FDPI-02 diagnostics and panel interface

CryptoAuth Xplained Pro

Sensor Technology Interface

Description of High Accuracy Digital Pressure Gauge Design

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

Arduino Lesson 14. Servo Motors

CMOS OV7660 Camera Module 1/5-Inch 0.3-Megapixel Module Datasheet

SSD1298. Advance Information. 240 RGB x 320 TFT LCD Controller Driver integrated Power Circuit, Gate and Source Driver with built-in RAM

Adding a Real Time Clock to Raspberry Pi

A Digital Timer Implementation using 7 Segment Displays

1602 LCD adopts standard 14 pins(no backlight) or 16pins(with backlight) interface, Instruction of each pin interface is as follows:

1.5" & 2.1" Monochrome 128x64 OLED Display Module

Arduino Lesson 16. Stepper Motors

Transcription:

I 2 C Communication with an Arduino Alex Lange ECE 480 Design Team 3 November 13, 2015 Executive Summary: Arduino is an open-source microcontroller perfect for prototyping or hobbyists. They are easy to use, have a multitude of optional Arduinocompatible boards such as GPS and Ethernet, and have a vast user base that can help support any project. For these reasons, as well as the ability to use I 2 C, Arduino microcontrollers are a quality option for any project. Keywords: Arduino, IIC, I2C

Objective: This application note will serve as a basis for using I 2 C to communicate with many different devices, including but not limited to LCDs, sensors, digital-to-analog converters. This application note will focus on using I 2 C to display information on multiple LCDs. This application note also assumes a basic understanding of programming as well some familiarity with Arduino. Introduction: When using an Arduino for any project, one of the main areas of concern is the limited inputs and outputs (I/O). For the Arduino used in this application note, there are 13 digital I/O and 6 analog I/O. When connecting one LCD using normal communication methods, the LCD requires 6 digital pins, leaving only 7 for other desired functions. Using I 2 C, it is possible to use multiple LCDs, digital-to-analog converters, and a multitude of sensors with only two total digital pins. Basics of I 2 C Communication: I 2 C is a multi-master, multi-slave, serial bus invented by Philips Semiconductor. The benefits of I 2 C are that it only requires two lines per bus; one clock and one data for all the connected devices. The downside of I 2 C compared to other communication methods is that it has a slower communication speed. In terms of LCDs, this slower communication speed will have no effect. Figure 1 illustrates the layout of I 2 C with a master microcontroller that can send signals to the three slave nodes. The Arduino has its own internal pull-up resistors, so Rp in Figure 1 is not needed when using an Arduino. SDA is serial data line, while SCL is the serial clock line. Figure 1: Example I 2 C Schematic

Interfacing with External Hardware: The most common form of LCD used for Arduinos is a 1602 LCD, which is a 16 character by 2 line display. There are a variety of text and background colors that can be selected. The typical setup for connecting one of these LCDs to an Arduino without I 2 C can be seen in Figure 2. This demonstrates the complexity associated with standard communication systems. Figure 2: Standard LCD Connection In order to make the LCD I 2 C compatible, an I 2 C hardware module is simply soldered to the 16 pins on the LCD. The module selected is very important as there are a vast number of I 2 C modules for 1602 LCDs. It is important to get modules with different addresses. If the LCDs have the same address, there is no way for the Arduino to distinguish the two of them. The I 2 C module in Figure 3 has the option to change the address. The pads A0, A1, and A2 act as a binary counter. For example, shorting the pads of A0 gives it a value of 1, while leaving it open gives it a 0. Using this logic, there are 2 3, or 8, possible addresses. Ultimately this means that only 8 LCDs can be displayed if only this model is utilized.

Figure 3: I 2 C Module for 1602 LCD After the I 2 C modules are soldered to the LCDs, the pins from the modules can be connected to those on the Arduino. There are corresponding GND, VCC, SDA, and SCL pins on the Arduino. Software: I 2 C communication can be illustrated by the following analogy. The microcontroller acts as a professor in a classroom talking to students. The classroom is the data bus, where any information on it can be heard by any of the devices, or students. The students act as the devices, only responding when the professor addresses them by their name. The first step to using the I 2 C devices is to identify the addressable values of each device. These addresses are how the Arduino can communicate with each device individually. This can be done simply by running the following I 2 C scanner, Figure 4, where the address of each device will be displayed in the Arduino integrated development environment (IDE) serial monitor.

Figure 4: I 2 C Scanner

After the addresses are returned, the devices can now be addressed individually. In order to use I 2 C with the LCDs, the correct library must be included: After including the library, the final step is to initialize the LCDs. Although there are now only two wires going to each LCD, the I 2 C module still needs to know which pins on the LCD require what data. The first part names each LCD so they can be more easily addressed later. After this, the address of each LCD is entered as well as the pins the I 2 C module needs to send information to. The final part is telling the I 2 C module to turn the LCD backlight on. The LCDs can now easily be written to using the following command, where lcd2 can be changed to any of the assigned LCD names: Conclusion: I 2 C can be extremely useful when there is a desire to use a lot of different devices. It allows for future expansion as it saves on the number of I/O that are used. An example of its usefulness is using I 2 C to address 4 different LCDs, Figure 5, to display 3-phase power information, the remaining I/O are then used for sampling buttons as well as exterior controls, like turning on a capacitor bank if the power factor drops too low.

References: https://www.arduino.cc/en/tutorial/helloworld https://en.wikipedia.org/wiki/i%c2%b2c http://www.egr.msu.edu/classes/ece480/capstone/fall15/group03/index.html