Reading random numbers from the configuration register of the ambient light sensor SEN0390?

userHead Jakob.Sartori 2024-06-14 21:04:01 167 Views0 Replies

Hello, I have a little problem with configuration register of ambient light sensor SEN0390. I tried to set the sensor to manual mode with CDR bit set to 0 and with TIM bits set to 011. But the setting was not secesfull. I tried to use WireScan code to check if i am using wrong device address but device is found on address 0x4A which i was already using. I added pullup resistors to SDA and SCL but it was not helpful. Also i checked the power supplay and it is stable to 3.3v. The funny thing is that sensor light registers are working finne. I am able to read its values and when i calculated the ambient light value in lux I get very similar value to value outputed from MAX44009 which I already programd and calibrated. I also tried to use library made by DFROBOT and I used the example inside library to set the sensor to manual mode but when i read the sensor mode still it is outputed as 0 so autoatic. I will paste the picture of just very simple code with which i tried to set configuration register value and than read the value of it. And i will paste the picture of serial monitor so you guys will se what “random” values i am getting out of configuration register. I will also post picture of code that reads all registers from 0x00 to 0x0F and you will se that register on address 0x05 has a value inside it but as datasheet specifies it shouldnt have any value inside because it is reserved register. I hope someone will help me fix the issue. Thanks