Grove Digital Light Sensor + Temperature & Humidity Sensor

Hello,

I connected a Temperature&Humidity Sensor (High-Accuracy & Mini) V1.0 and a Digital Light Sensor V1.0 to a Grove Base Shield V2 which is connected to an Arduino Uno. The sensors are both connected to an I2C port on the base shield.

When I then run the Light sensor Demo (seeedstudio.com/wiki/Grove_- … ght_Sensor), it doesn’t work. Nothing happens, I don’t see anything in the serial monitor. When I run the program without the Temperatue & Humidity sensor connected, it works fine.

I’ve changed the setup() function from this:

void setup()
{
Wire.begin();
Serial.begin(9600);
TSL2561.init();
}

TO:

void setup()
{
Wire.begin();
Serial.begin(9600);
Serial.println(“Initialize”);
TSL2561.init();
Serial.println(“OK”);
}

When I run the altered version of the demo with both the T&H sensor and the digital light sensor connected, I only get this in the serial monitor:

“In”

When I run this demo (seeedstudio.com/wiki/Grove_- … ni%29_v1.0) for the Temperature & Humidity sensor with both the T&H and the Digital Light Sensor connected, the demo works great.

Does anybody know if I’m doing something wrong or if there is a solution to this problem. Thanks in advance.

Dear Customer,

We could reproduce your issue at our end.We will get back to you with a solution.

Thanks for writing to us.

Hello,

As per the TH02 data-sheet (please see attached screen-shot), sensor I2C bus is unavailable for other slave devices when TH02 is connected.

If you would like to use other slave devices when TH02 is connected, please follow the steps below.

1.Connect a jumper wire from INT of Grove-TH02 sensor to a digital pin of the Arduino.
2.Make the value of Digital port pin to 1 in-order to disable the TH02 sensor.
3.Use other I2C slave devices

If Digital port pin value is 0, then TH02 sensor would be enabled.

Thanks and regards,
Kavi

[size=85]Edit:Fix typo[/size]
th02 datasheet screenshot.jpg

Hello Kavi,

Thank you for your reply.
If I understand you correctly I have to connect a cable to the open INT port on the Grove TH02 to a digital pin on the Arduino.
In my program I have to disable the digital pin (set output value 0), read the value of the Digital Light Sensor, then change output value of the digital pin to 1, and read the value of the TH02.

Is that correct?

Regards,

Mathieu

No its the vice versa 0 to enable and read the value of TH02 and 1 to enable and read the value of digital light sensor.

Hello Kavi,

I did that, but now I’m getting false readings from the temp&humid sensor.
Temperature is always -50.00 and humidity -24.00.

The lux values from the light sensor are ok.

Could you please post the code that you have used.

Hello,

1.Use D5 as digital pin.
2.Make sure that you provide 3.3v to the INT pin.
3.Upload the following code.

[code]#include “Arduino.h”
#include <Wire.h>
#include <Digital_Light_TSL2561.h>
#include <TH02_dev.h>

int pin=5;

void setup()
{

pinMode(pin,OUTPUT);

digitalWrite(pin,HIGH);
Wire.begin();
Serial.begin(9600);
Serial.println(“Initialize”);
TSL2561.init();
Serial.println(“OK”);

digitalWrite(pin,LOW);

Serial.println(“TH02_dev demo by seeed studio\n”);
/* Power up,delay 150ms,until voltage is stable /
delay(150);
/
Reset HP20x_dev */
TH02.begin();
delay(100);

/* Determine TH02_dev is available or not */
Serial.println(“TH02_dev is available.\n”);
}

void loop()
{

digitalWrite(pin,HIGH);
Serial.print("The Light value is: ");
Serial.println(TSL2561.readVisibleLux());
delay(1000);

digitalWrite(pin,LOW);
delay(150);
/* Reset HP20x_dev */
TH02.begin();
delay(100);
float temper = TH02.ReadTemperature();
Serial.println("Temperature: ");
Serial.print(temper);
Serial.println(“C\r\n”);

float humidity = TH02.ReadHumidity();
Serial.println(“Humidity: “);
Serial.print(humidity);
Serial.println(”%\r\n”);
delay(1000);
}[/code]

Please let us know if there are any other issues.

Thanks and Regards
Kavi

Hello Kavi,

Thank you very much, it works!

I’ve set the voltage switch on the grove shield to 3.3 volts. When it was on 5 volts, the program wasn’t really stable and stoped working after a couple of measurements.

Now, I would also like to connect the Air Quality sensor to the board, but with the switch set to 3.3 volts, the sensor isn’t working (the blue light doesn’t turn on). With the switch set to 5V, the sensor does work correctly.

Is it possible to have all three sensors working at the same time?

Please note: I also have the WiFi shield connected on top of the Grove board and the INT pin from the TH02 is connected with a jumper cable to digital port 5 on the WiFi Shield (as it is on top).

Hello,

Switch the voltage to 5v so that all the three sensors work together but make a voltage divider connection as shown in the attachment to the INT pin.

Please let us know if it works.

Regards,
Kavi
voltage_Divider.png