Page 1 of 1

MAX44009 Ambient Light Sensor

Posted: Wed Sep 23, 2020 8:34 am
by mcauser
Working on a driver for the Maxim MAX44009 Ambient Light Sensor - used on the GY-49 module:
https://github.com/mcauser/micropython-max44009

Re: MAX44009 Ambient Light Sensor

Posted: Wed Sep 23, 2020 5:25 pm
by rcolistete
MAX44009 is an excellent light sensor, very low power, good range, etc.

Here is another MicroPython driver, I've developed with 4 versions : normal, low memory usage, BBC Micro:bit, BBC Micro:bit with low memory usage :
https://github.com/rcolistete/MicroPyth ... 009_driver

Re: MAX44009 Ambient Light Sensor

Posted: Wed Sep 23, 2020 11:17 pm
by mcauser
Nice work!

On my GY-49, I was unable to read 2 bytes starting from the lux high byte.
Mine was not auto moving to the next register (lux low byte).

When I readfrom_mem() multiple times on any register, it would just give me the same value repeated again and again.
I couldn't just read the high byte then read the low byte in separate transfers, as the values may belong to different sensor reads.
a START condition pauses the sensor updating the registers and a STOP resumes, so there's a tiny gap between the two transfers.

That's why I had to manually simulate a readfrom_mem(addr, reg, 2) by using multiple writeto() + readfrom_into() as a repeated start transfer.

Could I perhaps I have a clone MAX44009? Or maybe there is a register I can fiddle with to allow reading sequential registers?

Re: MAX44009 Ambient Light Sensor

Posted: Fri Oct 09, 2020 8:03 pm
by rcolistete
Have you tested using which MicroPython board ? With hard or soft I2C ?