Light Intensity Detection
This project will deal with the use of the Grove light sensor to display the light level in lux in a LCD.
Hardware Used
his will deal with the hardware of the setup. For this project we need the following components. The sensor will be connected with the analog pin A0 while the LCD is reserved for I2C protocol.
- Intel Edison board with the Arduino breakout board.
- Grove light sensor
- Grove RGB LCD display
The above image shows the hardware setup of the sensors and the display unit.
Source Code for Intel Edison
#include
#include "rgb_lcd.h"
rgb_lcd lcd;
void setup() {
lcd.begin(16, 2);
lcd.clear();
lcd.setRGB(100,100,100);
lcd.setCursor(0,0);
lcd.print("SETTING UP . . . ");
lcd.clear();
delay(2000);
}
void loop() {
int a= analogRead(A0);
lcd.setRGB(100,100,100);
lcd.setCursor(0,0);
lcd.print("LIGHT level");
lcd.setCursor(0,10);
lcd.print(a);
delay(100);
}
The above code just reads the data from the light sensor and displays it to the LCD display.
Use Cases
This step will enlighten us with some of the many places where this can be used. Firstly this can be used in robotics and solar tracking facility where the light level will serve as an contributing factor. The images below shows us the image of the LCD during different condition
The above image was recorded when the surroundings lied in a low light environment. Thus it has multiple usage and can be exploited accordingly.