Arduino
Using the MAX44009 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the Adafruit_MAX44009 library, and running the provided example code.
Wiring
Wire as shown for a 5V board like an Uno. If you are using a 3V board, like an Adafruit Feather, wire the board's 3V pin to the sensor VIN.
Here is an Adafruit Metro wired up to the sensor using the STEMMA QT connector:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
Here is an Adafruit Metro wired up using a solderless breadboard:
-
Board 5V to breakout VIN (red wire)
-
Board GND to breakout GND (black wire)
-
Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
Library Installation
You can install the Adafruit MAX44009 library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit MAX44009, and select the Adafruit MAX44009 library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
/*
* Simple example for the MAX44009 Ambient Light Sensor
*
* Written by Limor 'ladyada' Fried with assistance from Claude Code for
* Adafruit Industries. MIT license, check license.txt for more information
*
* Reads lux every 100ms in auto-ranging mode. Serial Plotter friendly.
*/
#include <Adafruit_MAX44009.h>
Adafruit_MAX44009 max44009;
void setup() {
Serial.begin(115200);
while (!Serial)
delay(10);
if (!max44009.begin()) {
Serial.println(F("Could not find MAX44009 sensor!"));
while (1)
delay(10);
}
}
void loop() {
float lux = max44009.readLux();
if (!isnan(lux)) {
Serial.print(F("Lux: "));
Serial.println(lux);
}
delay(100);
}
Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You'll see the MAX44009 recognized over I2C. Then, the reading values of different light channels will be printed out to the Serial Monitor.
Page last edited April 15, 2026
Text editor powered by tinymce.