/* ----------------------------------------------------------------
 * Arduino I2C Scanner
 * 
 * This sketch tests the standard 7-bit addresses
 *  Pls, note that devices with higher bit address might not be seen properly.
 * ----------------------------------------------------------------
 * /

and the following to complete:

Protected Area

This content is password-protected. Please verify with a password to unlock the content.

The simplest method on how to scan the address of an i2c supported Sensor and how to connect multiple i2c supported sensors with Arduino without using the Sensors addresses. There are situations when we need to use multiple sensors with the Arduino Uno, but due to the limited number of the I/O pins we are not able to connect many sensors, but thanks to the i2c supported Sensors, now we can connect multiple i2c sensors using only two wires.

Protected Area

This content is password-protected. Please verify with a password to unlock the content.

I2C communication Bus has become very popular and now commonly used by thousands of electronics devices because of its easy implementation. By the easy implementation I mean that such devices need only 2 wires. This way we can connect so many devices with for example Arduino using only two wires. Using I2C communication bus we can connect many devices at the same time using only two wires as each device has its own unique address. In Arduino Uno the i2c bus is available on pins A4 and A5.

Arduino i2c Scanner Program:

While the i2c supported Sensor is connected with the Arduino, the following program can be used to find the i2c address of any i2c supported sensor.

Protected Area

This content is password-protected. Please verify with a password to unlock the content.

The HMC5883L i2c supported Sensor

The module includes a state-of-the-art, High-Resolution HMC118x series magneto-resistive sensor, Plus an ASIC containing amplification, Automatic degaussing strap Drivers, Offset cancellation, and a 12-bit ADC that enables 1 to 2 degree compass heading accuracy. The I2C serial bus allows for easy interface.

Features:

  • The Honeywell HMC5883L is a surface mount, multi-chip module designed for low-field magnetic sensing with a digital interface for applications such as low cost compassing and magnetometry.
  • The 12-Bit ADC coupled with low noise AMR sensors
  • Low voltage operations and low power consumption, supports built in self test.
  • Built in strap drive circuits, wide magnetic field range,I2C digital interface
  • Working voltage 3.3v to 5v.

HMC5883L Connection to Arduino:

  • Arduino GND -> HMC5883L GND
  • Arduino 3.3V -> HMC5883L VCC
  • Arduino A4 (SDA) -> HMC5883L SDA
  • Arduino A5 (SCL) -> HMC5883L SCL

[/arduino]

/*
* HMC5883L_Example.pde – Example sketch for integration with an HMC5883L triple axis * magnetomerwe.
*

*/
[/arduino]

End Of Post