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);
}
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.
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 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:
Determine which channels to enable and do so in the ALS channel enable register and channel 6 enable register
Set the channel gain in the ALS channel gain x registers.
Set the measurement period in the ALS period register.
Set the measurement mode bits, ALS_CONT, in the ALS control register
Start the measurement by setting the ALS_EN bit in the ALS control register
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.
Read the data from the enabled channels and interpret them (exactly how I'm not sure).
Clear the interrupt status bit as described in the datasheet.
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.