Author Topic: Humidity sensor command mode  (Read 4100 times)

0 Members and 1 Guest are viewing this topic.

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Humidity sensor command mode
« on: April 04, 2014, 09:53:17 pm »
I picked up a couple Honeywell HIH-8120 SIP humidity sensors to use with an Arduino Uno. The sensors communicate via I2C. All sensors ship with a default I2C address of 0x27. So I need to modify the address of one of the sensors so I can differentiate between the two over I2C.

The problem is that in order to change any settings on the sensor you have to put it into command mode first. From the time the sensor is first powered on you have a 3ms window to send the command mode instruction to the sensor, otherwise you can't get in and the sensor remains in "normal" mode.

I've tried to get into command mode but I don't believe I've been successful. The data I get back is all random garbage. My hypothesis is that I'm missing the 3ms window and then sending command mode instructions while the sensor is in normal mode causing it to return garbage data.

When the arduino is powered, it supplies power to it's rails almost immediately, before the boot sequence is complete. So I'm wondering if the sensor is being powered concurrently with the arduino but by the time the command entry code is sent to the sensor more than 3ms has elapsed since power on.

Anybody run into anything like this before?

Datasheet: https://dl.dropboxusercontent.com/u/91808950/Honeywell%20HIH8000%20HumidIcon%20Sensor%20Datasheet.pdf
I2C Communications Technical Note: https://dl.dropboxusercontent.com/u/91808950/Honeywell%20HumidIcon%20I2C%20Comms.pdf
Command Mode Technical Note: https://dl.dropboxusercontent.com/u/91808950/Honeywell%20HumidIcon%20Command%20Mode.pdf
« Last Edit: April 04, 2014, 10:58:35 pm by Legion »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Humidity sensor command mode
« Reply #1 on: April 04, 2014, 10:53:25 pm »
Care to point to the actual datasheet your using, (better to attach it) I've tried opening it from various suppliers but every time it fails to load,
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Humidity sensor command mode
« Reply #2 on: April 04, 2014, 10:59:09 pm »
Care to point to the actual datasheet your using, (better to attach it) I've tried opening it from various suppliers but every time it fails to load,

My bad, meant to link those in. Too big for attachments. I put them in my public dropbox folder. Links are in the original post.
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Humidity sensor command mode
« Reply #3 on: April 04, 2014, 11:05:30 pm »
I think I solved it. My instincts were right, it was a timing problem. I wasn't sending the command mode instruction within the 3ms. The problem is the arduino takes too long to boot up. I was able to get around that problem by powering the sensor off of one of the PWM digital output pins. I set the pin to a 100% duty cycle so it outputs a flat 5V. Unlike the 5V rail I can "turn on" the output pin at the program start. This way the sensor isn't turned on until the arduino has already started running the program. My com window now displays good data from the sensor EEPROM.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Humidity sensor command mode
« Reply #4 on: April 04, 2014, 11:09:59 pm »
Equally you should only need to program them once if Ive read the datasheet, so good luck :)
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Humidity sensor command mode
« Reply #5 on: April 05, 2014, 02:53:24 am »
Yeah. Just changed the address for one of them. I was able to get them both hooked up to the microcontroller and poll them for data. Everything seems to be working.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf