Vd6283tx I2C sensor doesn't give the right output

Hi Everyone,

I'm trying to get the vd6283tx sensor from ST working on an Arduino.

At this moment i can't get the right values. When I check the Device ID (0x00) it gives me 112. When i check the red color sensor (0x06) it gives me 0.

All the address that are specified in the documentation will give the same results.

I deleted everything out of the code that's isn't necessary to test the reading function, so it's tiny.

#include <Wire.h>

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

}

void loop() {

  Wire.beginTransmission(0x20);
   Wire.write(0x06);  // Register color Red
   Wire.endTransmission();
   Wire.requestFrom(0x20, 1);
   uint16_t red = Wire.read();

   Serial.print("Value: ");
   Serial.println(red);

  delay(1000);
  }

If i did something completely wrong let me know :slight_smile:

Documentation of the sensor:

Can you post a schematic showing how you have wired it up please.

@Grumpy_Mike

Here is the scheme of the Arduino with the sensor.

Scheme of the sensor:

Sorry but no. A schematic would have pin numbers and names on the pins.

The data sheet shows that you have a maximum input voltage of 3V3 on the I2C lines. As you are feeding it with a Mega that has 10K pull up resistors on the board then it won't work without either removing the board's pull up resistors and connecting external pull up resistors to 3V3. Or having an I2C level converter between this board and the Mega.

The way I read the sensor data sheet/schematic, it looks like it was designed to operate off 5V as well as 3V3. It has the proper level shifters and voltage regulator.

I think if OP supplies 5V to the module, it will work fine.

Yes, it works with both 5V and 3.3V. With both voltages it will return a value in the serial monitor.

Device data sheet says I2C address is 0x40.

When i use I2C address 0X40 it says connection failed...

Sensor documentation:

Clock signal (SCL) generation is performed by the master device. The master device initiates data transfer. The
I2C bus on the VD6283 has a maximum speed of 1 Mbit/s and the device supports a slave address of 0x40 (or
0x20 in 7 bits).

Okay. Does the sensor not need any kind of initialization to begin taking readings? Is there an Arduino driver library available for it? Did you correct the supply voltage to 5V?

I looked in the documentation and i think maybe there is needed a initialzation on pin 6.

image

But i can't find out how...

There is no Arduino driver or lib available. Yes it's correct connected with 5V power supply.

Download this driver and see how to use the chip.
https://www.st.com/content/st_com/en/products/ecosystems/stm32-open-development-environment/stm32cube-expansion-software/stm32-ode-sense-sw/x-cube-als.html

Nowhere can I see a 5V capable I2C input to that board from this schematic.

Can you spot one?

maybe there is needed a initialzation on pin 6

I would expect INTR_ALS_3V3 to be an interrupt pin, not an initialization pin.

There is no Arduino driver or lib available.

It's pretty clear from the datasheet that ST is expecting the sensor to be used within their own ecosystem, which is probably the reason why the datasheet is also somewhat light on functional details.

If I had to guess I think operation would be something like this:

  1. Determine which channels to enable and do so in the ALS channel enable register and channel 6 enable register
  2. Set the channel gain in the ALS channel gain x registers.
  3. Set the measurement period in the ALS period register.
  4. Set the measurement mode bits, ALS_CONT, in the ALS control register
  5. Start the measurement by setting the ALS_EN bit in the ALS control register
  6. Next is to determine when data is ready. That might be possible to do by polling the INTR_ST bit in the interrupt status register.
  7. Read the data from the enabled channels and interpret them (exactly how I'm not sure).
  8. Clear the interrupt status bit as described in the datasheet.
  9. If using continuous mode go back to 6

If you power the board from 5V, the I2C level shifter at the top via VCCA will be powered from 5V.
Correct?

Well it might be, but who knows if the chips involved in that level shifter will take a 5V signal? Also the 1V8 voltage regulator chip being fed with 5V instead of 3V3 might fry the regulator, or exceed the maximum voltage of the regulator chip.

Given that these chips do not have part numbers on them then I would have little confidence in saying that they can be used at 5V.

EDIT
Having said that Figure 1 seems to hint it might work on 5V.

1 Like

This excerpt from the breakout board data sheet certainly implies that 5V is okay.

I totally agree that some part numbers would help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.