Main Site Documentation

I2C - Honewell HIH-6130/6131 Humidity/Temperature Sensor


#1

Dear All,
I am trying to interfacing with the sensor from ChipworkX development board.
As per sensor protocol document (http://sensing.honeywell.com/index.php?ci_id=142171), the measure request command simply expects a write command with no input data.
I am not sure how to create I2CWriteTransaction with no input data using I2CDevice.CreateWriteTransaction as the function expects byte[] as an argument. I have tried by passing empty buffer as well as null with no success.

Any help would be highly appreciated.

Thanks
Venkat.


#2

This should help http://wiki.tinyclr.com/index.php?title=I2C_-_EEPROM


#3

Thanks Gus for the quick response. I have successfully accessed I2C devices before and all of them require at least one byte message passed to CreateWriteTransaction.

I am stumped on this particular one as the Write transaction doesn’t expect any input data to be passed. My question remains, how can I construct I2CWriteTransaction with no input data?


#4

Maybe

I2CDevice.CreateWriteTransaction(new byte[]);

? But not tested, though :hand:


#5
I2CDevice.CreateWriteTransaction(new byte[]);

would give a compiler error as it is missing array size.
I have tried following though

I2CDevice.CreateWriteTransaction(new byte[]{});

which gives System.InvalidOperationException exception when I execute the transaction and

I2CDevice.CreateWriteTransaction(null);

which throws System.ArgumentNullException exception.


#6

The I2C in NET MF is not too flexible and sometime you may hit a wall… I had a similar issue where i had to send ack to every byte i receive and standard lib only sends stop after enough bytes were received. I solved this using software version of I2C:

http://code.tinyclr.com/project/297/software-i2c-driver/

i suggest you try it to make sure ther sensor and wires are ok


#7

Gralin,
The sensor wires are fine as I can issue Read request and get the data. The issue is with the Write.
I would look at software I2C as you suggested.
Thanks for your response.

This could be a NET FM issue than sensor issue, as per the following link
http://www.phanderson.com/arduino/hih6130.html it is not an issue on Arduino platform.
or may be I am missing something.


#8

Agree, NET MF I2C library is limited. I mentioned the wires as you never know :wink: i suspect the software i2c will do the trick. There is also a software i2c implementation included in GHI SDK but it didn’t solve my issue


#9

Gralin,
I have tried with Software I2C, still no success with this sensor. I am suspecting that it is with clock speed as spec sheet says minimum 100kHZ.
Software I2C worked with some other type of I2C device though.


#10

I know this is dumb, but have you tried this?

I2CDevice.CreateWriteTransaction(new byte[0]);

I don’t have a device with me to test and the emulator isn’t happy with any write size…


#11

Hi Errol,

I have tried this

I2CDevice.CreateWriteTransaction(new byte[]{ });

which is equivalent to yours

I2CDevice.CreateWriteTransaction(new byte[0]); 

Thanks for the suggestion though.

Actually, we have decided to use OneWire based sensors as we need to connect multiple sensors to the same system and I2C based modules require change of default address to function properly.