รหัสสินค้า | SG40202 |
หมวดหมู่ | วัดสภาพแวดล้อมและแก๊ส Environmental / Gas |
ราคา | 410.00 บาท |
สถานะสินค้า | พร้อมส่ง |
จำนวน | ชิ้น |
I2C Connection Diagram
UART Connection Diagram
I2C Connection Diagram
Pin Connections:
UV Sensor: + (to) Arduino UNO: 5V
UV Sensor: - (to) Arduino UNO: GND
UV Sensor: D (to) Arduino UNO: SDA
UV Sensor: C (to) Arduino UNO: SCL
UART Connection Diagram
Pin Connections:
UV Sensor: + (to) Arduino UNO: 5V
UV Sensor: - (to) Arduino UNO: GND
UV Sensor: T (to) Arduino UNO: 4
UV Sensor: R (to) Arduino UNO: 5
I2C Mode
Ambient Light
#include "DFRobot_LTR390UV.h"
DFRobot_LTR390UV ltr390(/*addr = */LTR390UV_DEVICE_ADDR, /*pWire = */&Wire);
void setup()
{
Serial.begin(115200);
while(ltr390.begin() != 0){
Serial.println(" Sensor initialize failed!!");
delay(1000);
}
Serial.println(" Sensor initialize success!!");
ltr390.setALSOrUVSMeasRate(ltr390.e18bit,ltr390.e100ms);//18-bit data, sampling time of 100ms
ltr390.setALSOrUVSGain(ltr390.eGain3);//Gain of 3
ltr390.setMode(ltr390.eALSMode);//Set ambient light mode
}
void loop()
{
float als = 0;
als = ltr390.readALSTransformData();//Get data converted from ambient light intensity, which can only be used in ambient light mode
Serial.print("ALS:");
Serial.print(als);
Serial.println("Lux");
delay(1000);
}
Result
Serial print ambient light data (in an office with strong light).
Note: Ambient Light Reference Range
Place/Environment | Illuminance |
---|---|
Sunny day | 30000-300000 lux |
Indoors on sunny day | 100-1000 lux |
Cloudy day | 3000-10000 lux |
Outdoors on cloudy day | 50-500 lux |
Indoors on cloudy day | 5-50 lux |
Indoors at dusk | 10 lux |
At sunrise and sunset | 300 lux |
At night | 0.001-0.02 lux |
Moonlit evening | 0.02-0.3 lux |
Lightless office | 30-50 lux |
Exposure to flashlight light | 8000-15000 lux |
UV Light
#include "DFRobot_LTR390UV.h"
DFRobot_LTR390UV ltr390(/*addr = */LTR390UV_DEVICE_ADDR, /*pWire = */&Wire);
void setup()
{
Serial.begin(115200);
while(ltr390.begin() != 0){
Serial.println(" Sensor initialize failed!!");
delay(1000);
}
Serial.println(" Sensor initialize success!!");
ltr390.setALSOrUVSMeasRate(ltr390.e18bit,ltr390.e100ms);//18-bit data, sampling time of 100ms
ltr390.setALSOrUVSGain(ltr390.eGain3);//Gain of 3
ltr390.setMode(ltr390.eUVSMode);//Set UV mode
}
void loop()
{
uint32_t data = 0;
data = ltr390.readOriginalData();//Get UV raw data
Serial.print("data:");
Serial.println(data);
delay(1000);
}
Result
Serial print UV raw data (in the environment without direct sunlight on sunny day).
UART Mode
Ambient Light
#include "DFRobot_LTR390UV.h"
#include <SoftwareSerial.h>
#define UARTMODE //UART mode
SoftwareSerial mySerial(/*rx =*/4, /*tx =*/5);
DFRobot_LTR390UV ltr390(/*addr =*/LTR390UV_DEVICE_ADDR, /*s =*/&mySerial);
void setup()
{
#define UARTMODE
mySerial.begin(9600);
Serial.begin(115200);
while(ltr390.begin() != 0){
Serial.println(" Sensor initialize failed!!");
delay(1000);
}
Serial.println(" Sensor initialize success!!");
ltr390.setALSOrUVSMeasRate(ltr390.e18bit,ltr390.e100ms);//18-bit data, sampling time of 100ms
ltr390.setALSOrUVSGain(ltr390.eGain3);//Gain of 3
ltr390.setMode(ltr390.eALSMode);//Set ambient light mode
}
void loop()
{
float als = 0;
als = ltr390.readALSTransformData();//Get the data converted from ambient light intensity, which can only be used in ambient light mode
Serial.print("ALS:");
Serial.print(als);
Serial.println("Lux");
delay(100);
}
Result
Serial print ambient light data (in an office with strong light).
UV Light
#include "DFRobot_LTR390UV.h"
#include <SoftwareSerial.h>
#define UARTMODE //UART mode
SoftwareSerial mySerial(/*rx =*/4, /*tx =*/5);
DFRobot_LTR390UV ltr390(/*addr =*/LTR390UV_DEVICE_ADDR, /*s =*/&mySerial);
void setup()
{
#define UARTMODE
mySerial.begin(9600);
Serial.begin(115200);
while(ltr390.begin() != 0){
Serial.println(" Sensor initialize failed!!");
delay(1000);
}
Serial.println(" Sensor initialize success!!");
ltr390.setALSOrUVSMeasRate(ltr390.e18bit,ltr390.e100ms);//18-bit data, sampling time of 100ms
ltr390.setALSOrUVSGain(ltr390.eGain3);//Gain of 3
ltr390.setMode(ltr390.eUVSMode);//Set UV mode
}
void loop()
{
uint32_t data = 0;
data = ltr390.readOriginalData();//Get UV raw data
Serial.print("data:");
Serial.println(data);
delay(100);
}
Result
Serial print UV raw data (in the environment without direct sunlight on sunny day).
/**
* @fn begin
* @brief Init SEN0540 device
* @return Return value init status
* @retval 0 Succeed
* @retval -1 Failed
*/
int8_t begin(void);
/**
* @fn setMode
* @brief Set data collecting mode for module
* @param mode select data collecting mode
* @return NONE
*/
void setMode(eModel_t mode);
/**
* @fn setALSOrUVSMeasRate
* @brief Set data bit and sampling time of module, the sampling time must be greater than the time the bit needs
* @n --------------------------------------------------------------------------------------------------------
* @n | bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
* @n ---------------------------------------------------------------------------------------------------------
* @n | Reserved | ALS/UVS Resolution | Reserved | ALS/UVS Measurement Rate |
* @n ---------------------------------------------------------------------------------------------------------
* @n | ALS/UVS Resolution |000|20 Bit, Conversion time = 400ms |
* @n | |001|19 Bit, Conversion time = 200ms |
* @n | |010|18 Bit, Conversion time = 100ms(default) |
* @n | |011|17 Bit, Conversion time = 50ms |
* @n | |100|16 Bit, Conversion time = 25ms |
* @n | |110/111|Reserved |
* @n ---------------------------------------------------------------------------------------------------------
* @n | ALS/UVS Measurement Rate |000|25ms |
* @n | |001|50ms |
* @n | |010|100ms (default) |
* @n | |011|200ms |
* @n | |100|500ms |
* @n | |101|1000ms |
* @n | |110/111|2000ms |
* @n ---------------------------------------------------------------------------------------------------------
* @param bit Set data bit
* @param time Set sampling time
* @return None
*/
void setALSOrUVSMeasRate(eResolution bit,eMeasurementRate time);
/**
* @fn setALSOrUVSGain
* @brief Set sensor gain
* @n ---------------------------------------------------------------------------------------------------------
* @n | bit7 | bit6 | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
* @n ---------------------------------------------------------------------------------------------------------
* @n | Reserved | ALS/UVS Gain Range |
* @n ---------------------------------------------------------------------------------------------------------
* @n | ALS/UVS Gain Range |000|Gain Range: 1 |
* @n | |001|Gain Range: 3 (default) |
* @n | |010|Gain Range: 6 |
* @n | |011|Gain Range: 9 |
* @n | |100|Gain Range: 18 |
* @n | |110/111|Reserved |
* @n ---------------------------------------------------------------------------------------------------------
* @param data Control data
* @return None
*/
void setALSOrUVSGain(eGainRange data);
/**
* @fn readData
* @brief Get raw data
* @return Return the obtained raw data
*/
uint32_t readOriginalData(void);
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีธนาคาร KBANK, SCB, BBL,TMB
กรุณาเก็บหลักฐานการโอนเงินของท่านไว้เพื่อแจ้งการชำระเงินด้วยค่ะ
ท่านสามารถแจ้งการชำระเงินผ่านระบบอัตโนมัติได้โดย Click Link ข้างล่างค่ะ
https://www.arduitronics.com/informpayment
หน้าที่เข้าชม | 15,375,197 ครั้ง |
ผู้ชมทั้งหมด | 5,878,275 ครั้ง |
เปิดร้าน | 21 พ.ค. 2556 |
ร้านค้าอัพเดท | 5 ก.ย. 2568 |