Project in progress
Arduino + Cayenne = Light Quality Monitoring

Arduino + Cayenne = Light Quality Monitoring © CC BY

I've used an Arduino YUN and the new IoT platform Cayenne for monitoring the quantity and the quality of light.

  • 11 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project


I've a friend that grows up chiles. He talk me about the importance of temperature, light and soil Ph. An important aspect of cultivation is the quality of light. The quality, like the composition of colors waves.

I've created an IoT app that analyse the component of light. This project analyse the singles colours of light. One sensor for RED, one for GREEN and one for BLUE. That sensor print the value on the cluod, and my friend can read this values with her smartphone anytime, and anywhere. This is possible by using Cayenne IoT. Cayenne is a awesome platform that allows the creation of IoT projects like this. See the official site on

The Photoresistors

You can use three photoresistors. One for the red, one for the green and other for blue. This photoresistors change the value of resistance by variation of light.

Now you can add the filter to the photoresitors. When the light hits the sensor with the red filter, only the red light cross the filter. When the light hit the sensor, the value of resistence change. Arduino YUN read this value, and send this value to the Cayenne dashboard.


Sign Up on Cayenne app

You can create a Cayenne account for free. Go to and sign up.

Download the app or go to Cayenne Dashboard on your computer

On your smartphone download the Cayenne app.

Download the Cayenne library

Go to on and download the Arduino library. Follow the instructions and add the library to Arduino IDE. Like in this link:

Upload the sketch on Arduino YUN

After that you have to download the sketch and upload this on your Arduino YUN. Connect to Cayenne dashboard. Choose Arduino YUN like platform, and download the sketch. Pay ATTENTION Upload the sketch with your personal token.

Create a new dashboard

Sign In on the Cayenne app, and create a new dashboard.

When you open a dashboard you can add the widget to it. Select photoresistor, and like device select Arduino YUN.

After select A0, A1 and A2 like input.

Add three gauche on you dashboard, or add three charts. Select ANALOG for data source, and A0 for red, A1 for green, and A2 for blue.

You can view the dashboard by using smartphone, iPad or computer.

This is a photo of iPhone with three gauche. You can see the three values. The RED, the GREEN and the BLUE.


Arduino YUN Cayenne codeArduino
Use this sketch to upload the data to Cayenne dashboard.
Open last Arduino IDE. Connect your Arduino YUN to computer, and upload this code.
Modify the char token[] = "xxxxxxxxxxx"; with your char token.
Cayenne Yun Example

This sketch connects to the Cayenne server using an Arduino Yun
and runs the main communication loop.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

1. Set the token variable to match the Arduino token from the Dashboard.
2. Compile and upload this sketch.

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.

#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneYun.h>
#include <YunClient.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "xxxxxxxxxxx";

void setup()

void loop()


Cayenne Arduino YUN RGB photoresistors
Connect the resistors to Arduino YUN. You can use R G B filters.
Cayenne Arduino YUN file
This is a Fritzing scheme.


Similar projects you might like

Cayenne and SparkFun IoT 433 Mhz Sockets

Project tutorial by Giovanni Gentile

  • 13 respects

Water Quality Monitoring Using MKR1000 and ARTIK Cloud

Project tutorial by Team Animo!

  • 42 respects

Arduino Based Security Project Using Cayenne

Project tutorial by ScottC

  • 22 respects

Indoor Air Quality and Garbage Monitoring System

Project tutorial by Guillermo Perez Guillen

  • 30 respects

IoT Smart Socket Arduino And Cayenne

Project tutorial by Giovanni Gentile

  • 5 respects

Indoor Air Quality Monitoring System

Project tutorial by Team East West University

  • 84 respects
Add projectSign up / Login