Monitor Ambient Light Using WizFi360-EVB-Pico
Monitor system of ambient lighting in real-time with ThingSpeak IoT
Software Apps and online services
ThingSpeak IoT - ThingView - ThingSpeak viewer
x 1
INTRODUCTION
A light meter is a device used to measure the amount of light. In photography, a light meter is often used to determine the proper exposure for a photograph. Typically a light meter will include either digital or analog electronic circuit, which allows the photographer to determine which shutter speed and f-number should be selected for an optimum exposure, given a certain lighting situation and film speed. The modern light meter works according to the principle of a cell (cell) C.C.D. or photovoltaic; an integrated circuit receives a certain amount of light (photons) and transforms it into an analog electrical signal.
Light meters or light detectors are also used in illumination. Their purpose is to measure the illumination level in the interior and to switch off or reduce the output level of luminaries. This can greatly reduce the energy burden of the building by significantly increasing the efficiency of its lighting system. It is therefore recommended to use light meters in lighting systems, especially in rooms where one cannot expect users to pay attention to manually switching off the lights. Examples include hallways, stairs, and big halls.
Lux
The lux (symbol: lx) is the SI derived unit of illuminance and luminous emittance, measuring luminous flux per unit area. It´s equal to one lumen per square meter. In photometry, this is used as a measure of the intensity, as perceived by the human eye, of light that hits or passes through a surface. It is analogous to the radiometric unit watt per square meter, but with the power at each wave length weighted according to the luminosity function, a standardized model of human visual brightnessperception. One lux is equal to one lumen per square meter:
1 lx = 1 lm/m2 = 1 cd·sr/m2.
HARDWARE
The pinout of this board is shown below:
The BH1750 is a 16-bit ambient light sensor that is centered around the visible spectrum, designed to communicate via the I2C protocol. The BH1750 can be used in security applications ranging from camera shutter control, brightness control in dark/lit rooms, and general monitoring of light in the visible spectrum.
Main features:
- I2C bus Interface
- Spectral responsibility is approximately human eye response
- Illuminance to Digital Converter
- Wide range and High resolution. (1 - 65535 lx)
- Low Current by power down function
- 50Hz / 60Hz Light noise reject-function
- 1.8V Logic input interface
- Adjustable measurement result for influence of optical window (It's possible to detect min. 0.11 lx, max. 100000 lx)
- Small measurement variation (+/- 20%)
- The influence of infrared is very small.
Below I show you the schematic diagram that will be used in this project:
After making the electrical connections it would look like this:
GETTING STARTED:
- If you consider that it is necessary to update the firmware of your WizFi360 board, then the following link shows you three methods to achieve it: https://wizfi.github.io/Document/docs/basic_guides/firmware_upgrade
- We will use 'WizFi360_arduino_library' provided by WIZnet: https://github.com/Wiznet/WizFi360_arduino_library
Run Arduino IDE, open File->Preferences, and add next url boards manager:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
Install the Raspberry Pi Pico/RP2040 boards as shown below:
SIMPLE TEST WITH THE BH1750 SENSOR
It's necessary to do a previous test with the BH1750 sensor, since you have to make a configuration to the code to use it on this WizFi360 board, and verify that everything is fine. You can get the BH1750 sensor library here: https://github.com/claws/BH1750
The test code is shown below:
BH1750test.ino
#include <BH1750.h>
#include <Wire.h>
BH1750 lightMeter;
void setup() {
Serial.begin(9600);
// Initialize the I2C bus
Wire.setSDA(0);
Wire.setSCL(1);
Wire.begin();
lightMeter.begin();
Serial.println(F("BH1750 Test begin"));
}
void loop() {
float lux = lightMeter.readLightLevel();
Serial.print("Light: ");
Serial.print(lux);
Serial.println(" lx");
delay(1000);
}
Wire.setSDA(0);
Wire.setSCL(1);
Wire.begin();
What is obtained by the serial port is shown below:
CONCLUSION:
-
monitoring-ambient-light
Github project codes
-
BH1750test.ino
-
Thingspeak.ino
-
Schematic diagram