Arduino PAR and LUX Meters

Discuss garden automation systems and software here, including commercial products or Raspberry Pi and Arduino DIY setups.
PeteR_1
LED Tinker
LED Tinker
Reactions:
Posts: 368
Joined: Sun Jul 05, 2020 1:10 am

Image
TCS34725 PAR Sensor, Arduino Nano in enclosure and two remote sensor, USB connected to (old) notebook PC running Windows XP and Hyperterminal.

This is a Simple I2C PAR Sensor the ubiquitous TCS34725 Color Sensor for Arduino type micro-controllers or RPi.

The materials required are;
PAR Sensor: TCS34725, PVC Coupling, Acrylic Lens(es), 4-conductor shielded cable.
PAR Meter: Arduino type micro-controller, USB cable and or a Display Module.

The following are required to duplicate the sensor for accurate, reliable and repeatable measurements;
a. White Acrylic Diffuser Lens(es) with at most 15% Transparency for 0 - 2225 umol/m2/s (PPFD) range.
b. Remote sensor housings are 3/4" PVC slip coupling (Electrical) with hole sized for the 4 - conductor cable (repurposed Keyboard cable)
c. Wiring per standard TCS34725 wiring to Arduino type controllers, using 5V / Vin (for remote sensor cable lengths).
d. Parameters for Lens, Lux and PPFD (PAR) coefficient factors and Bench "Calibration" with Lux meter (or PAR meter if available).
e. Setup using "Fixed" non-adjusted Parameters... 1x - Gain, 700 ms - ATime, 2.4 ms WTIME for all sensors, no exception.

Notes;
1. The TCS34725 support documents show that Lux readings can be calibrated to 0.1% accuracy, PAR is directly related to Lux.
2. Any fixed Spectrum Grow Light with a known Lumens to PAR conversion factor (Lm/PPF_Cf) can be measured with a Lux Meter.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
edited by PeteR_1, edited 4 times in total.


Image

Original MultispeQ Beta PAR sensor
Original MultispeQ Beta PAR sensor
The "PAR" Sensor and Arduino were calibrated with a LI-COR model LI-190R Quantum Sensor. The "Multispeq Beta" PAR sensor is also able to measure RGB (Red : Green : Blue) and LUX Values!
Par Meter Build and Test... https://www.scirp.org/journal/paperinfo ... erid=88576
Testing in Multispeq Tool... https://royalsocietypublishing.org/doi/ ... sos.160592
Production Multispeq Tool... https://prl.natsci.msu.edu/people/facul ... -m-kramer/

Arduino, TCS34725 and LCD1602 display module wiring
Arduino, TCS34725 and LCD1602 display module wiring
The MultispeQ V2 mentions an additional integral part to the PAR sensor, a "Hot Mirror" / IR Cut Filter 400 - 700nm along with the TCS34715. A readily available Light Color Sensor Model TCS34725 (costs under $8.00) has an installed IR cut Filter of 400nm to 650nm. Just received the TSC34715FN Chips which will be swapped onto the TCS34725 PCB modules, still awaiting the 400-700nm Hot Mirror IR Cut Filters which have been delayed due to Covid-19 shutdowns.
TCS34725 PCB module... https://www.aliexpress.com/item/4000454 ... 4c4dRR16vo
TSC34715 Chip... https://www.digikey.com/product-detail/ ... ND/3821076

Arduino, BH1750 LUX Sensor and LCD1602 display module
Arduino, BH1750 LUX Sensor and LCD1602 display module
I'm a novice at Arduino programming, have only been working with it for a few months, have lots of inexpensive spare parts from a failed attempt at an over engineered MIT MVP OpenAg "Brain Controller", was easily able to implement an Arduino Lux to PPF meter with "a Data logging" function (Com Port Reader). Uses a BH1750FV (Silicon IC chip, cost $3.00) reads relatively accurate, "calibrated" with a Benetech Lux Meter and has an appropriate PPFD conversion factor for my application, 0.015 (PPF/Lm).
BH1750... https://www.aliexpress.com/item/3301179 ... 4c4d1K5MYJ
White LED Grow Lights... https://www.biorxiv.org/content/biorxiv ... 5.full.pdf
LED Lux to PPFD Factor... https://www.biorxiv.org/content/biorxiv ... 0.full.pdf
Last edited by PeteR_1 on Tue Feb 16, 2021 1:56 pm, edited 4 times in total.
FP2020
LED-Curious
LED-Curious
Reactions:
Posts: 1
Joined: Wed Dec 30, 2020 12:11 pm

Dear PeteR_1,

I have been experimenting with light sensors for PAR readings for a while. Your setup sounds really interesting!

I really want to try to make this setup, only I am not sure how to attach the tiny TCS34715FN chip to the TCS34725. I assume you carefully pull the reddish part, next to the yellow block, out of the sensor? Only, how do you then attach the TCS34715FN in the correct way?

Thank you for your amazing project!
PeteR_1
LED Tinker
LED Tinker
Reactions:
Posts: 368
Joined: Sun Jul 05, 2020 1:10 am

FP2020 wrote:
Wed Dec 30, 2020 12:19 pm
I really want to try to make this setup, only I am not sure how to attach the tiny TCS34715FN chip to the TCS34725. I assume you carefully pull the reddish part, next to the yellow block, out of the sensor? Only, how do you then attach the TCS34715FN in the correct way?

Thank you for your amazing project!
You’re welcome.

You have to carefully de-solder and remove the TCS34725 IC Chip and LED (“Yellow Block”) from the Breakout Board and solder on the TCS34715 IC Chip in the same position on the Solder Pads, they have the same orientation and leads. You could also fabricate a custom PCB for the TCS34715 chip with the required resistors and capacitors. BTW, I just use side wire cutters to remove / cut away the LED on the breakout boards.
EasyEDA 24 mm diameter PCB 3D Gerber layout
EasyEDA 24 mm diameter PCB 3D Gerber layout


Code: Select all

//TCS34715 with UV/IR Cut Filter and 50% light transmittance Cosine Correction Dome or 1/8" Acrylite #2447 diffuser / cosine correction
// Serial Print Only. No Local Display

#include <Wire.h>

#define Addr 0x29

void setup()
{
  Wire.begin();
  Serial.begin(9600);

  Wire.beginTransmission(Addr);
  Wire.write(0x83);
  Wire.write(0xFF);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x81);
  Wire.write(0x00);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x8F);
  Wire.write(0x00);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x80);
  Wire.write(0x03);
  Wire.endTransmission();
  delay(800);
}

void loop()
{
  unsigned int data[8];

  Wire.beginTransmission(Addr);
  Wire.write(0x94);
  Wire.endTransmission();
  Wire.requestFrom(Addr, 8);

  if (Wire.available() == 8)
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
    data[2] = Wire.read();
    data[3] = Wire.read();
    data[4] = Wire.read();
    data[5] = Wire.read();
    data[6] = Wire.read();
    data[7] = Wire.read();
  }

  float cData = (data[1] * 256.0) + data[0];
  float red = (data[3] * 256.0) + data[2];
  float green = (data[5] * 256.0) + data[4];
  float blue = (data[7] * 256.0) + data[6];

  // float luminance = (-0.32466 * red) + (1.57837 * green) + (-0.73191 * blue);
  float par = (0.65847 * cData) + (1.60537 * red) + (2.30216 * green) + (0.50019 * blue);
  
  Serial.print("PPFD : ");
  Serial.print(par);
  Serial.println(" umol/s-m2");
  delay(2000);
}

Note;
The TCS34725 breakout board can be used as is by just removing the LED, it needs to be calibrated for Lux (and/or with a PAR Meter), and it already has the UV/IR cut Filter installed.
TCS34725 Breakout Board, LED Removed, mounted in 3/4&quot; PVC conduit Adapter (Slip x MPT).
TCS34725 Breakout Board, LED Removed, mounted in 3/4" PVC conduit Adapter (Slip x MPT).

Code: Select all

//TCS34725 with 50% light transmittance Cosine Correction Dome or 1/8" Acrylite #2447 diffuser / cosine correction
// Serial Print Only. No Local Display

#include <Wire.h>

#define Addr 0x29      

void setup()
{
  Wire.begin();
  Serial.begin(9600);

  Wire.beginTransmission(Addr);
  Wire.write(0x83);
  Wire.write(0xFF);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x81);
  Wire.write(0x00);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x8F);
  Wire.write(0x00);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x80);
  Wire.write(0x03);
  Wire.endTransmission();
  delay(800);
}

void loop()
{
  unsigned int data[8];

  Wire.beginTransmission(Addr);
  Wire.write(0x94);
  Wire.endTransmission();
  Wire.requestFrom(Addr, 8);

  if (Wire.available() == 8)
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
    data[2] = Wire.read();
    data[3] = Wire.read();
    data[4] = Wire.read();
    data[5] = Wire.read();
    data[6] = Wire.read();
    data[7] = Wire.read();
  }

  float cData = (data[1] * 256.0) + data[0];
  float red = (data[3] * 256.0) + data[2];
  float green = (data[5] * 256.0) + data[4];
  float blue = (data[7] * 256.0) + data[6];
  
  float cf_lux = 2.0;
  float cf_par = 0.015;
 
  float luminance = (-0.32466 * red) + (1.57837 * green) + (-0.73191 * blue);
 // float par2 = (0.65847 * cData) + (1.60537 * red) + (2.30216 * green) + (0.50019 * blue);
  float lux = luminance * cf_lux;
  float par = lux * cf_par;
  float cct = 3810 * (blue / red) + 1319;
  
  float cl = red + green + blue;
  float rd = (red / cl) * 100;
  float gr = (green / cl) * 100;
  float bl = (blue / cl) * 100;

  
  Serial.print("Red  : ");
  Serial.print(rd, 0);
  Serial.println(" %");
  Serial.print("Green: ");
  Serial.print(gr, 0);
  Serial.println(" %");
  Serial.print("Blue : ");
  Serial.print(bl, 0);
  Serial.println(" %");
  Serial.print("Clear: ");
  Serial.print(cData, 0);
  Serial.println(" Lux");
  Serial.print("Lux : ");
  Serial.print(lux, 0);
  Serial.println(" Lm/m2");
  Serial.print("PPFD : ");
  Serial.print(par, 0);
  Serial.println(" umol/s-m2");
  //Serial.print("PPFD : ");
  //Serial.print(par2, 0);
  //Serial.println(" umol/s-m2");
  Serial.print("CCT  : ");
  Serial.print(cct, 0);
  Serial.println(" Kelvin");
  delay(2000);

}
Image


The BH1750FVI Breakout Board works quite well as is and is a much simpler project. It also needs to be calibrated for Lux (2.0 factor) and the Lumens to PPF (0.015 factor) of the measured light source. The BH1750FVI breakout board is also supplied with a/the 50% Transparent Cosine correction diffusion dome (the 2.0 factor) and Modular Termination Cable.

Code: Select all

//BH1750FVI with 50% light transmittance Cosine Correction Dome
// Serial Print Only. No Local Display

#include <Wire.h>

#define Addr 0x23         

void setup()
{
  Wire.begin();
  Serial.begin(9600);

  Wire.beginTransmission(Addr);
  Wire.write(0x01);
  Wire.endTransmission();

  Wire.beginTransmission(Addr);
  Wire.write(0x10);
  Wire.endTransmission();
  delay(300);
}

void loop() 
{
  unsigned int data[2];
  Wire.requestFrom(Addr, 2);

  if(Wire.available() == 2) 
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
  }
    delay(300);
  
  float luminance = ((data[0] * 256) + data[1]) / 1.20;

  float cf_lux = 2.0;
  float cf_par = 0.015;

  float lux = luminance * cf_lux;
  float par = lux * cf_par;
  
  Serial.print("LUX  :");
  Serial.print(lux);
  Serial.println(" Lm/m2"); 

  Serial.print("PPFD   :");
  Serial.print(par);
  Serial.println(" umol/s-m2");   
  delay(1000);
    
}
Image

BTW, after further web surfing / researching have found several other inexpensive photo diodes that can be used for PAR Sensors, e.g. , TSL2561 Breakout Boards with an added UV/IR Filter, has almost the “Ideal” PAR response chart, but doesn’t provide the added percentage Blue-Green-Red (% B-G-R) of the TCS347xx boards / sensors.
TSL2561 datasheet... https://ams.com/documents/20143/36005/T ... a544c0a98b

Image
Licor LI190R Quantum Sensor... https://www.licor.com/env/products/light/quantum.html
00schteven
LED-Curious
LED-Curious
Reactions:
Posts: 23
Joined: Thu Dec 31, 2020 10:39 pm

I have also been tinkering with a tcs4721 to use as a par meter. I am curious as to the gain and integration time settings. Also these integration domes, I have also considered just a piece of white acrylic. I really do not know, I have been struggling just to get consistent readings with mine. I am also not sure what to do with the data it produces. It was my hope that I would be able to produce a primitive spectrograph on the home assistant dash board in the long run.

edit: tcs34725
Last edited by 00schteven on Mon Jan 18, 2021 5:07 am, edited 1 time in total.
@stevetheganjafarmer
PeteR_1
LED Tinker
LED Tinker
Reactions:
Posts: 368
Joined: Sun Jul 05, 2020 1:10 am

00schteven wrote:
Sun Jan 17, 2021 8:39 pm
I have also been tinkering with a tcs4721 to use as a par meter. I am curious as to the gain and integration time settings. Also these integration domes, I have also considered just a piece of white acrylic. I really do not know, I have been struggling just to get consistent readings with mine. I am also not sure what to do with the data it produces. It was my hope that I would be able to produce a primitive spectrograph on the home assistant dash board in the long run.
The TCS34725 are ubiquitous Digital Color Sensors with eight (8) Datapoints (Data0 - Data7), have internal "Factory Settings", only require "Calibration Factors" or "Offsets" to compensate for Sensor Enclosures with Filters, Lenses etc. or to "Calculate" the required outputs; CCT, PPFD, LUX, %Blue, %Green, %Red, %FarRed, etc. Lots of programing info available on the internet for communicating to automation systems and once commissioned the measurements, CCT, RGB, Lux, etc. have been very reliable and repeatable.

Code: Select all

// Gain and Timing are INCLUDED in the "Void Setup" for the TCS34725 (No Library required)
void setup()
{
  Wire.begin();				// Initialize I2C communication as MASTER
  Serial.begin(9600);			// Initialize Serial Communication, set baud rate = 9600
  
  Wire.beginTransmission(Addr);		// Start I2C Transmission
  Wire.write(0x83);			// Select Wait Time register
  Wire.write(0xFF);			// Set wait time = 2.4 ms
  Wire.endTransmission();		// Stop I2C Transmission

  Wire.beginTransmission(Addr);		// Start I2C Transmission
  Wire.write(0x81);			// Select Atime register
  Wire.write(0x00);			// Atime = 700 ms, max count = 65536  
  Wire.endTransmission();		// Stop I2C Transmission on the device

  Wire.beginTransmission(Addr);		// Start I2C Transmission
  Wire.write(0x8F);			// Select control register
  Wire.write(0x00);			// AGAIN = 1x
  Wire.endTransmission();		// Stop I2C Transmission

  Wire.beginTransmission(Addr);		// Start I2C Transmission
  Wire.write(0x80);			// Select enable register
  Wire.write(0x03);			// Power ON, RGBC enable, wait time disable
  Wire.endTransmission();		// Stop I2C Transmission
  delay(800);  
}
TCS34725 Control Everything Github... https://github.com/ControlEverythingCommunity/TCS34725
00schteven
LED-Curious
LED-Curious
Reactions:
Posts: 23
Joined: Thu Dec 31, 2020 10:39 pm

Currently I am using ESPHome to integrate the sensor in my Home Assistant:

Code: Select all


  - platform: tcs34725
    red_channel:
      name: "flower_red"
    green_channel:
      name: "flower_green"
    blue_channel:
      name: "flower_blue"
    clear_channel:
      name: "flower_clear"
    illuminance:
      name: "flower_illuminance"
    color_temperature:
      name: "flower_color_temperature"
    gain: 4x
    integration_time: 154ms
    address: 0x29
    update_interval: 600s
    
I have been trying different values for the integration_time and gain. My readings are all over the place.
@stevetheganjafarmer
00schteven
LED-Curious
LED-Curious
Reactions:
Posts: 23
Joined: Thu Dec 31, 2020 10:39 pm

Using the formula from the first link in the first post:
PAR=(White×0.65847)+(Red×1.60537)+(Green×2.30216)+(Blue×0.50019)
I put together this templet:

Code: Select all

      par:
        friendly_name: 'flower_PAR'
        value_template: >-
          {% set C = (states('sensor.flower_clear') | float) %}
          {% set R = (states('sensor.flower_red') | float) %}
          {% set G = (states('sensor.flower_green') | float) %}
          {% set B = (states('sensor.flower_blue') | float) %}
          {% set PAR = ((C * 0.65847)+(R * 1.60537)+(G * 2.30216)+(B * 0.50019)) %}
          {{-PAR | round(2) -}}
        unit_of_measurement: 'μmol photons m−2 s−1'
@stevetheganjafarmer
User avatar
Salmonetin
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 51
Joined: Wed Jul 15, 2020 5:13 pm

Thanks...
Last edited by Salmonetin on Tue Jan 19, 2021 9:11 am, edited 1 time in total.
PeteR_1
LED Tinker
LED Tinker
Reactions:
Posts: 368
Joined: Sun Jul 05, 2020 1:10 am

Salmonetin wrote:
Mon Jan 18, 2021 5:18 pm
erased...dont like nobody...sorry
The Spectrometer sensor that you posted (then deleted) was interesting but expensive, costing more than an Apogee Quantum Meter.

Standard Silicon Photodiodes (< $1.00 each) or TSL2561 Breakout Boards (< $4.00 each ) with Filters are more than adequate for measuring Total PAR or PBAR, but they have to be calibrated. The TCS34725 Breakout Boards (< $3.00 each) with Filters / Lenses can provide PAR, RGB Percentages (% Wavelength Distribution), CCT and even LUX which is more than adequate for LED Grow lights and is equivalent to the Data required for DLC Listed Horticultural Lights...
User avatar
Salmonetin
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 51
Joined: Wed Jul 15, 2020 5:13 pm

...Thanks...
Post Reply