Giovanni Gentile
Published © CC BY

Arduino + Cayenne = Light Quality Monitoring

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

IntermediateWork in progress2 hours4,755
Arduino + Cayenne = Light Quality Monitoring

Things used in this project

Hardware components

Arduino Yun
Arduino Yun
×1
Photo resistor
Photo resistor
×3
USB-A to B Cable
USB-A to B Cable
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Cayenne
myDevices Cayenne
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

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.

Code

Arduino YUN Cayenne code

Arduino
Use this sketch to upload the data to Cayenne dashboard.
Open last Arduino IDE. Connect your Arduino YUN to computer, and upload this code.
IMPORTANT !
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.

Steps:
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()
{
	Serial.begin(9600);
	Cayenne.begin(token);
}

void loop()
{
	Cayenne.run();
}

Credits

Giovanni Gentile

Giovanni Gentile

36 projects • 98 followers
Graduated in Psychology Artificial Intelligence department. Expert in electronics, automation and IoT. Now working on VR-AR experiences.

Comments