HIH-6130/6131 Series

Does anybody have an experience of using 3 or more of such sensors in an Arduino project?

Provided with the right library, I can assign this sensor a unique slave address.

http://playground.arduino.cc/Main/HoneywellHumidIconTMDigitalHumidity-TemperatureSensors

If I have three such sensors on my I2C, how do I know what sensor received what address?

I want 3 sensors with individual addresses.

According to the datasheet, those sensors can run on 5.5 volts (max). Do I really need 3.3V supply?

Thank you.

You can set any I2C address by connecting just one sensor (one after the other) to the Arduino, power it with a digital I/O (the power up delay the Arduino is waiting for a new sketch upload is to long to set the device to command mode) and send it the necessary I2C commands to change the address. After that change the device listens to the newly configured slave address.
The I2C address is configured in register 0x1C in bits 0 to 6.

After having done this configuration you can use the sensor just as any other I2C device with the individually configured bus address.

Just out of curiosity: Why do you want to connect 3 of these sensors to one Arduino? Do you have 3 areas of different humidity all in the 50cm range of a single I2C bus?

Thank you.
I bough this product off ebay:
http://www.ebay.com/itm/401208048939?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

There is an instruction from Arduino Playground on how to program the sensor IC with arduino.
http://playground.arduino.cc/Main/HoneywellHumidIconTMDigitalHumidity-TemperatureSensors

The problem that I have is that the wiring diagrams are not very readable on the page. They cannot be magnified.

I would like to apply this instruction to my Arduino Micro Pro and the HIH6130 sensor that is soldered onto a PCB with some components (capacitors that are on the diagram are probably already there)

The device is programmed through the power pin?
This is why they suggest the use of a voltage regulator. What kind of voltage regulator would not interfere with the programming process? Would LM2950-3.3 or LM3940 work? Can I get away with LM317 and an appropriate voltage divider for the voltage setting?

Would this 100mA voltage regulator work?

The device is programmed through the power pin?

NO. The chip is OK with 5V

The device is programmed through the power pin?

Not, but to enter the command mode you have to send some I2C messages in a short window after powering the chip. Because the Arduino waits for some time to receive a new sketch after powering it up, you cannot connect the chip to the same power as the Arduino but you must power the chip using a digital I/O of the Arduino. Because the HIH-6130 consumes less than 1mA that's no problem.

This is why they suggest the use of a voltage regulator.

As knut_ny already wrote, a voltage regulator is not necessary, the chip is fine with the 5V of the Arduino.

So connect it to you Micro Pro this way:

Arduino HIH-6130

D2 SDA
D3 SCL
D4 VDD
GND GND

If connected this way the constructor of the library has to be called like this:

HIH61XXCommander hih(0x27, 4);

I uploaded the library: https://github.com/dhhagan/HIH6130

Got the result from the sensor tester
35.95 -38.66
Humidity and temperature?
I still have the protective sticker on the sensor, why temperature is negative?

3 sensors that I bought give the same temperature output when I plugged them into the circuit.
(Currently they have the same address. The goal is to give them 3 different addresses and to use them simultaneously.)

/*
 Example showing how to use the HIH6130 library for Arduino
 Tested on the Arduino Uno R3 with Arduino v1.0.6 installed

 Written by David Hagan, December 2, 2014
*/

#include <Wire.h>
#include <HIH6130.h>

// Define the address used by the HIH6130
byte address = 0x27;

HIH6130 rht(address);

void setup(){

 Serial.begin(9600);
 rht.begin();
 Serial.println("RH (%)\tT (C)");

}

void loop(){

 // Read data
 rht.readRHT();

 // Print the data
 Serial.print(rht.humidity); Serial.print("\t");
 Serial.println(rht.temperature);

 delay(2000);
}

Then I tried this example, found here: https://forum.arduino.cc/index.php?topic=78667.0

I get all sorts of complaints about

HIH6130 hih_normal; // runtime instance, read values
HIH6130_CMDMODE hih_cmdmode; // programming mode instance, change i2c address

After I commented that code, I got complaints from the compiler about this:
hih_normal.begin(address);

Are there two different HIH6130.h libraries or something?

I am compiling for Arduino Micro. Thats what I use. I use pins 2,3 for SDL, SCA and a pin 4 for programming mode.

#define i2c_address  0x19 // This is the address you're changing to
#include "HIH6130.h"

HIH6130       hih_normal;   // runtime instance, read values
HIH6130_CMDMODE   hih_cmdmode;  // programming mode instance, change i2c address


void reset_i2c()
{         // we connected Vdd to Arduino digital PIN 4
    pinMode(4, OUTPUT);
    digitalWrite(4, LOW);    // switch off power -> reset
    delay(666);         // let power capacitors run empty
    digitalWrite(4, HIGH);   // switch power back on, 10ms remaining to enter cmdmode
}


void fetch(byte address)
{
  hih_normal.begin(address);
  Serial.print("data from address 0x");
  Serial.println(address,HEX);

  
    float humidity, temperature;

    hih_normal.fetch_data(&humidity, &temperature);

    Serial.print("Humidity: ");
    Serial.print(humidity);
    Serial.print("%  Temperature: ");
    Serial.print(temperature);
    Serial.println("C");

    delay(500);
  
}


void reconfigure()  // reconfigure I2C address
{

  hih_cmdmode.begin(0x27, &reset_i2c); // first in put is old address
  hih_cmdmode.write_i2c_address(0x19); // input is new I2c address
  hih_cmdmode.end();

  reset_i2c();              // let the config settle



}
void setup(void) {
  {
  Serial.begin(9600);

    reset_i2c();

    Wire.begin();       // start i2c
    delay(500);
}

}

void loop(void) {
 
  fetch(i2c_address);
  reconfigure();


  delay(1000);

}

i use this lib..

Only one sensor and it still doesnt work.

I get this kind of temperature and humidity:

3.13 -17.36
3.16 -17.35
3.34 -17.36

Something is not right. I peeled the protective sticker off. Temperature in the room is 24C.

PROBLEM SOLVED
THERE WAS SOME I2C interference

I STILL DONT UNDERSTAND WHY SO MANY EXAMPLES GIVE ME SYNTAX ERRORS
I FEEL LIKE THERE ARE SEVERAL DIFFERENT LIBRARIES THAT SHARE THE SAME NAME
This is confusing.

hih_normal. doesn't work in this example
how do I program addresses of my sensors?

#define i2c_address  0x19 // This is the address you're changing to
#include <Wire.h>
#include "HIH6130.h"

//HIH6130       hih_normal;   // runtime instance, read values
//HIH6130_CMDMODE   hih_cmdmode;  // programming mode instance, change i2c address
//#define constantName value ??? ??? ???
void reset_i2c()
{         // we connected Vdd to Arduino digital PIN 4
    pinMode(4, OUTPUT);
    digitalWrite(4, LOW);    // switch off power -> reset
    delay(666);         // let power capacitors run empty
    digitalWrite(4, HIGH);   // switch power back on, 10ms remaining to enter cmdmode
}


void fetch(byte address)
{
  hih_normal.begin(address);
  Serial.print("data from address 0x");
  Serial.println(address,HEX);

  
    float humidity, temperature;

    hih_normal.fetch_data(&humidity, &temperature);

    Serial.print("Humidity: ");
    Serial.print(humidity);
    Serial.print("%  Temperature: ");
    Serial.print(temperature);
    Serial.println("C");

    delay(500);
  
}


void reconfigure()  // reconfigure I2C address
{

  hih_cmdmode.begin(0x27, &reset_i2c); // first in put is old address
  hih_cmdmode.write_i2c_address(0x19); // input is new I2c address
  hih_cmdmode.end();

  reset_i2c();              // let the config settle



}
void setup(void) {
  {
  Serial.begin(9600);

    reset_i2c();

    Wire.begin();       // start i2c
    delay(500);
}

}

void loop(void) {
 
  fetch(i2c_address);
  reconfigure();


  delay(1000);

}

I need an example that will change address of the sensor
AND
A library that will work with that example.

Thank you.