3

(coco) #1

Monitor your solar setup in your browser


TUTORIAL


Use an ESP8266 to let you keep an eye on energy generation from any device


Monitor your solar


setup in your browser


he amazing ESP8266-based boards
include all the hardware to connect
to a WiFi network and it can be
programmed to act as a web
server. Here we set one up to host a
website, which displays the sunshine
measurement on a simple dashboard. Any device,
computer or smartphone, on the same WiFi network
can view the data.
Light measurement is useful for assessing when to
switch on extra light or monitoring the performance of
a solar system. The TSL2561 light-integrated circuit is
a sophisticated device designed for making indoor light
measurements in lux units. Sunshine, or solar irradiance
is usually measured in W/m^2. Proper solar sensors can
be expensive, but this little unit can be modified to give
reasonable performance at a low price.
The integrated circuit contains two sensors: one
which responds to both visible and infrared light, and
another which responds to infrared light only. For
solar measurement, only the first sensor is needed,
especially if the measurements are used to evaluate
a PV system, as it responds to sunlight in a similar
manner to a PV panel.

The TSL2561 communicates using the I^2 C interface,
making it easy to connect to many small computer
boards such as the those using the ESP8266, and
of course the Arduino and Raspberry Pi. Modules
containing this chip and the necessary ancillary
components are widely available.
For this project, a NodeMCU V1.0, is used as the
host computer. The NodeMCU is easy to use as it
plugs into a USB port on the computer running the
Arduino IDE.

HARDWARE
I^2 C is a way of communicating over two data lines
known as SDA and SCL. The sketch assumes that
GPIO 0 (pin D3 on the NodeMCU) is the SDA line, and
GPIO 2 (pin D4) is used for the SCL line. The TSL2561
module also needs GND (0 V) and VCC (+3.3 V)
connections to operate.
To start with, the sensor and the NodeMCU are
mounted on a breadboard and the two connected with
jumper wires.
The maximum length depends on the connecting
cable capacitance, the clock speed, and the pull-up
resistors. In most cases a separation between the

T


Bill Grainger


Bill Grainger is a
physicist and design
engineer who loves
coding and having
computers interact
with the real world. He
works with wind energy
on all scales and enjoys
running, sea kayaking,
and mountaineering.

Above
Light sensor TSL2561


  • back, front, and with
    PTFE filter in place

Free download pdf