# MAX44009 Light Sensor With OLED

938

9

2

## Introduction: MAX44009 Light Sensor With OLED

Hello mates!

Yesterday i decided to post another simple gadget that i made for my friend of mine. He asked me to make a simple light meter to control a fan and a relay in his green house at daytime. Unfortunately i can't post pictures of that project, because i only programmed a nano for him and don't know what he made of it since. But i post my version of it.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: So What Is This?

This is a light(lux) meter that uses an arduino,a light sensor, an oled display and a few leds. The reason why i choosen the oled display is that it is easy to connect with arduino. This way i could save time and material to put it all together.

Let us begin!

## Step 2: The Light Sensor

The MAX44009 ambient light sensor is a great, easy to use and very cheap sensor. But most importantly it has a wide measuring range: 0.045 Lux to 188,000 Lux ; very low operating current. The library i use support the WPM(watt per square meter) calculation. Is this good enough??? YES!

I only advise to use it with 3.3 volts when connected to arduino.

https://www.maximintegrated.com/en/products/sensor...

https://hu.mouser.com/new/maxim-integrated/maximma...

What is WPM?

As it is written in the library h.file:bla bla................. This allows for a low cost, small scale, sensor which is able to aproximate the energy which is hitting the earth (in W/m^2)

at any given time. I think it is straight forward.

## Step 3: Materials

The parts needed for this project is:

- Arduino Uno (Atmega328 and up)

- 0.96" I2C oled display

- MAX44009 light sensor

- A few jumper wires

- Some leds or a 10 segment led bar

But of course you can use any other display as well if you wish.

## Step 4: Connections

Pls understand: I don't have fritzing or any other stuff like that. I don't like it and don't have time and nerve to bother with it.

The connections are very simple:

The display and sensor uses the I2C lines of arduino.

Display:

VCC - 3.3 or 5 volts

GND - Ground

SCL - Analog 5

SDA - Analog 4

MAX44009:

VCC - 3.3 volt (only!!)

GND - Ground

SCL - Analog 5
SDA - Analog 4

The 10 leds i used on breadboard uses Digital pin 2 to 11.

## Step 5: Software

I am giving the libraries and sketch i used.

Copy and paste, compile and upload to arduino.

## Step 6: Lightmeter in Work

After upload the arduino is measuring and displaying the Lux, wpm value. The readings are updated on every 300ms.

The sketch consists of two parts. The first part is without the leds, the second parts is with the leds.

Since the sensor can measure up to 188006 lux i decided that each led will indicate 18,000 lux. But you can adjust the values to your needs. I have ordered a 10 segment led bar for my final version of this light meter, but did not received yet. It is the only part missing, but when i receive it, i will fabricate it in a waterproof enclosure.

## Step 7: Done

You are done. Use it as you like.

A hope you will find it useful.

Have a nice day!

158 11K
92 8.9K
202 14K

## 2 Discussions

Thanks for the example! I tried it and my OLED screen was displaying everything about twice as big so it didn't all fit on the screen. I fixed that problem by changing the way the SSD1306 library is initialized at the beginning:

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)