i2c-it IR sensor interfacing help

I am trying to interface a i2c-it IR distance sensor from HWV: http://www.hvwtech.com/products_view.asp?ProductID=665v

I am using their sample code for Arduino from here: http://www.hvwtech.com/products_resources.asp?CatID=0&SubCatID=0&SubSubCatID=0&ProductID=665

I have it wired with two 2.2k resistors acting as pull-up resistors, I can't see to get the raw data by using Serial.print(dist);

Any suggestions?


Code you post a picture of your setup?


I certainly do not want to hijack this thread, but I would like to contribute as I am having the same problem with the same device. If you want me to start my own thread, just say so and I will.

The wiring for the I2C-IT is done for the sensor to the I2C chip by the manufacturer and is not visible. The user is left to attach the I2C interface to the ARDUINO. Pin1 of the device goes to ground and Pin4 goes to +5. Pin2 is the SCL line which goes to Analog 4 of the ARDUINO and Pin3 is the SDA line which goes to Analog 5 of the ARDUINO.

Pull Up resistors are supposed to already be in place on the Arduino Board.

In my case, all I ever see in the serial port window is the number 1 which would seem to indicate an invalid reading. There are no details provided from the manufacturer on selecting different the modes which are raw data, inches, or centimeters.

I have tried without success to find some code that would just query the device and return the device address as a means of testing for communication. If someone could post some code to do that it would be a big help.


TimVukman Again, please say something if you feel I am hijacking this and I will start another thread.

Hi roedward:

I have been all over the internet and back looking for a solution and not too far away from writing my own C code (or trying to) to see if I could get this going.

Try editing the line in the code that says "dist = i2c_eeprom_read_byte ( 0x20 );"

and changing the 0x20 to 0x22.

I did not solder the jumpers and so my address should have been 0x20 according to the instructions. It turns out that my address is 0x22.

My sensor is reading now. I need to do some measuring to see what scale it is in, but at least it is working.

I really hope this helps you