Wiznet makers

guillengap

Published August 23, 2022 © Creative Commons Attribution-NonCommercial CC BY-NC version 4.0 or later (CC BY-NC4+)

0 UCC

0 VAR

1 Contests

0 Followers

0 Following

Monitor Ambient Light Using WizFi360-EVB-Pico

Monitor system of ambient lighting in real-time with ThingSpeak IoT

COMPONENTS Hardware components

WIZnet - WizFi360-EVB-Pico

x 1


Adafruit - Adafruit BH1750 Ambient Light Sensor

x 1

Software Apps and online services

Arduino - Arduino IDE

x 1


WIZnet - WIZnet WizFi Library

x 1


x 1


PROJECT DESCRIPTION

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:

  1. I2C bus Interface
  2. Spectral responsibility is approximately human eye response  
  3. Illuminance to Digital Converter 
  4. Wide range and High resolution. (1 - 65535 lx)  
  5. Low Current by power down function  
  6. 50Hz / 60Hz Light noise reject-function  
  7. 1.8V Logic input interface  
  8. Adjustable measurement result for influence of optical window (It's possible to detect min. 0.11 lx, max. 100000 lx)  
  9. Small measurement variation (+/- 20%)  
  10. 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:

  1. 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
  2. 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:

  Wire.setSDA(0);
  Wire.setSCL(1);
  Wire.begin();

What is obtained by the serial port is shown below:

Documents
  • monitoring-ambient-light

    Github project codes

  • BH1750test.ino

  • Thingspeak.ino

  • Schematic diagram

Comments Write