MAX44009 Ambient Light Sensor

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
mcauser
Posts: 490
Joined: Mon Jun 15, 2015 8:03 am

MAX44009 Ambient Light Sensor

Post by mcauser » Wed Sep 23, 2020 8:34 am

Working on a driver for the Maxim MAX44009 Ambient Light Sensor - used on the GY-49 module:
https://github.com/mcauser/micropython-max44009

User avatar
rcolistete
Posts: 334
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: MAX44009 Ambient Light Sensor

Post by rcolistete » Wed Sep 23, 2020 5:25 pm

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
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

User avatar
mcauser
Posts: 490
Joined: Mon Jun 15, 2015 8:03 am

Re: MAX44009 Ambient Light Sensor

Post by mcauser » Wed Sep 23, 2020 11:17 pm

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?

User avatar
rcolistete
Posts: 334
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: MAX44009 Ambient Light Sensor

Post by rcolistete » Fri Oct 09, 2020 8:03 pm

Have you tested using which MicroPython board ? With hard or soft I2C ?
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

Post Reply