Photo Resistor Module (KY-018) [S002]
https://www.youtube.com/watch?v=EKLfcRSVAVc
*GitHub : https://github.com/rdiot/rdiot-s002.git
* Specs
Photoresistors are semiconductor photosensitive devices,
in addition to having high sensitivity, fast response, consistent with the spectral characteristics and value of good features, but at a high temperature, and humidity in harsh environments, but also to maintain
a high degree of stability and reliability, wide pan used cameras, solar garden lights, lawn, detectors, clock, music, cups, gift boxes, mini-Night light, light voice switches, lights automatically switch toys and a variety of light control, light control lighting, lamps and other light automatic opening OFF control field
* Contents
- Connect
S - A1
middle - 5V
- GND
- Key Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // LCD2004
int sensorPin1 = A0;
int sensorPin2 = A1; //S002
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("start LCD2004");
}
void loop()
{
int rate1 = analogRead(sensorPin1);
int rate2 = analogRead(sensorPin2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("[1]CDS05MM=" + (String)rate1);
lcd.setCursor(0,1);
lcd.print("[2]KY-018=" + (String)rate2);
delay(200);
}
'2) Sensor > CDS_Photocell' 카테고리의 다른 글
Load CDS sensor type values into DB by calling server API [P001] (0) | 2016.09.08 |
---|---|
Auto On Off Photo Switch (AS-10-220) [S157] (0) | 2016.09.08 |
BH1750 Digital Light intensity Sensor Module (GY-302) [S085] (0) | 2016.09.08 |
Mini Photocell (FIT0180) [S001] (0) | 2016.09.08 |
CDS5MM~CDS20MM Value [S003~S006] (0) | 2016.09.08 |