รหัสสินค้า | AS00635 |
หมวดหมู่ | วัดสภาพแวดล้อมและแก๊ส Environmental / Gas |
ราคา | 625.00 บาท |
สถานะสินค้า | พร้อมส่ง |
จำนวน | ชิ้น |
The Waterproof Digital Ambient Light Sensor is a robust and versatile device designed to measure light intensity across a wide range of environments, from 0 to 200,000 Lux. Utilizing the Modbus-RTU 485 communication protocol and powered by a DC 5-32V wide voltage supply, it ensures seamless integration with systems like the Arduino via compatible expansion boards.
With an IP68 waterproof rating, the sensor can withstand complete submersion, making it ideal for both indoor and outdoor applications, including weather stations, greenhouses, outdoor lighting, and automotive smart lights. Its high accuracy (±5%), broad measurement range, and durable construction make it a reliable solution for demanding environments.
IP68 Waterproof Design
The sensor is fully waterproof, meeting the IP68 standard, and can be submerged in water without damage. This makes it suitable for use in harsh outdoor environments, such as weather stations, greenhouses, and automotive applications, ensuring consistent performance in wet or humid conditions.
Wide Range and High Accuracy
With a measurement range of 0-200,000 Lux and a resolution of 0.01 Lux, the sensor provides precise light intensity readings across diverse scenarios, from dim indoor settings to bright outdoor environments. Its ±5% accuracy ensures reliable data for critical applications like plant growth monitoring and lighting control.
Easy Integration and Compatibility
The sensor supports the Modbus-RTU 485 protocol and can be easily connected to Arduino and other microcontroller platforms using expansion boards like the TTL to RS485 module or the Gravity: Active Isolated RS485 to UART Signal Adapter. Its simple wiring and wide voltage power supply (DC 5-32V) make it user-friendly and adaptable to various setups.
Num | Label | Description |
---|---|---|
Red line | VCC | Power input positive pole, DC5-32V power supply |
Blue line | GND | Power ground wire |
Yellow line | 485-A | RS485 data line A |
Green line | 485-B | RS485 data line B |
Interface | Encoding | Data bits | Parity bits | Stop bits | Error checking | Baud rate |
---|---|---|---|---|---|---|
RS485 | 8-bit binary | 8 | None | 1 | CRC | 1200、2400、4800、9600、19200、38400、57600 bit/s configurable, default 9600bit/s |
Using Modbus-RTU communication protocol, the format is as follows:
Initial structure ≥4 bytes of time
Address code = 1 byte
Function code = 1 byte
Data area = N bytes
Error check = 16-bit CRC code
End structure ≥4 bytes of time
Address code: The address of the sensor, which is unique in the communication network (factory default 0x01).
Function code: The function indication of the command sent by the host. This sensor reads the register function code 0x03 and writes the register function code 0x06
Data area: The data area is the specific communication data. Note that the high byte of 16-bit data is in front!
CRC code: A two-byte check code.
Register address | Content | Operation | Range and definition |
---|---|---|---|
0002H | High 16-bit data of illumination value | Read-only | Two bytes |
0003H | Low 16-bit data of illumination value | Read-only | Two bytes |
0046H | Illumination acquisition rate | Read-write | Level 1-20 |
0047H | Illumination calibration enable bit | Read-write | 01 Enable illumination calibration function, 00 Disable illumination calibration function |
0048H | Illumination calibration compensation value | Read-write | This value is written with the actual value enlarged by 100 times; for example, if compensation of 1.4 is required, the written value needs to be enlarged by 100 times, that is, 140; Calculation method: (collected illumination value ÷ ambient illumination value) × 100 = compensation value For example: the collected illumination value is 221, the actual ambient illumination is 260, and the calculated compensation value = (221 ÷ 260) × 100 = 85 |
0064H | 16-bit device address | Read and write | Range is (1-254), 255 is the general control command address |
0065H | 16-bit baud rate selection | Read and write | 0-1200, 1-2400, 2-4800, 3-9600, 4-19200, 5-38400, 6-57600 |
0066H | Parity bit | Read and write | 00 no parity, 01 odd parity, 02 even parity |
0067H | Version information | Read only | Level 1-20 |
00E0H | Device soft reset write command | Write only | Level 1-20 |
00F0H | Device factory reset write command | Write only | Level 1-20 |
Inquiry frame:
Address code | Function code | Register start address | Register length | Check code low bit | Check code high bit |
---|---|---|---|---|---|
0x01 | 0x03 | 0x00 0x02 | 0x00 0x02 | 0x65 | 0xCB |
Response frame:
Address code | Function code | Return valid bytes | Illumination data high 16 bits | Illumination data low 16 bits | Check code low bit | Check code high bit |
---|---|---|---|---|---|---|
0x01 | 0x03 | 0x04 | 0x00 0x0C | 0xF4 0x73 | 0x3D | 0x15 |
Light value:
00 0C F4 73 (hexadecimal) =849011/1000 =>Light value = 849.011Lux
Inquiry frame: (Modify the current address to 0x02)
Address code | Function code | Register address | Modify value | Check code low bit | Check code high bit |
---|---|---|---|---|---|
0x01 | 0x06 | 0x00 0x64 | 0x00 0x02 | 0x49 | 0xD4 |
Response frame:
Address code | Function code | Register address | Modify value | Checksum low bit | Checksum high bit |
---|---|---|---|---|---|
0x01 | 0x06 | 0x00 0x64 | 0x00 0x02 | 0x49 | 0xD4 |
Inquiry frame: (Modify address to 0x01, baud rate to 9600)
After modifying the address or baud rate, the sensor needs to be powered off and reconnected
Address code | Function code | Register start address | Register length | Modify address | Modify baud rate | Parity check | Checksum low bit | Checksum high bit |
---|---|---|---|---|---|---|---|---|
0x01 | 0x10 | 0x00 0x64 | 0x00 0x03 | 0x00 0x01 | 0x00 0x03 | 0x00 0x00 | 0xA9 | 0x03 |
Response frame:
Address code | Function code | Register start address | Register length | Modify address | Modify baud rate | Checksum low bit | Checksum high bit |
---|---|---|---|---|---|---|---|
0x01 | 0x10 | 0x00 0x64 | 0x00 0x03 | 0x00 0x01 | 0x00 0x03 | 0x9C | 0x05 |
Inquiry frame:
Address code | Function code | Register start address | Data length | Check code low bit | Check code high bit |
---|---|---|---|---|---|
0xFF | 0x03 | 0x00 0x64 | 0x00 0x02 | 0x90 | 0x0A |
Response frame:
Address code | Function code | Return valid bytes | Device address | Baud rate | Check code low bit | Check code high bit |
---|---|---|---|---|---|---|
0x01 | 0x03 | 0x04 | 0x00 0x01 | 0x00 0x03 | 0xEB | 0xF2 |
The real address of the device read is 01, and the baud rate is 0x03, which is 9600.
Inquiry frame:
Address code | Function code | Register address | Modify data | Check code low | Check code high |
---|---|---|---|---|---|
0xFF | 0x06 | 0x00 0xF0 | 0x00 0x00 | 0x9C | 0x27 |
Response frame:
Address code | Function code | Register address | Modify data | Check code low | Check code high |
---|---|---|---|---|---|
0xFF | 0x06 | 0x00 0xF0 | 0x00 0x00 | 0x9C | 0x27 |
If the power of the RS485 device is small and the required current is less than 12V-160mA, the RS485 to UART signal conversion module does not require a 12V external power supply, making wiring more convenient.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);
uint8_t Com[8] = { 0x01, 0x03, 0x00, 0x02, 0x00, 0x02, 0x65, 0xCB };
float LUX;
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() {
readLux();
Serial.print("Lux = ");
Serial.print(LUX, 3);
Serial.println(" (lux) ");
delay(1000);
}
void readLux(void) {
uint8_t Data[10] = { 0 };
uint8_t ch = 0;
bool flag = 1;
while (flag) {
delay(100);
mySerial.write(Com, 8);
delay(10);
if (readN(&ch, 1) == 1) {
if (ch == 0x01) {
Data[0] = ch;
if (readN(&ch, 1) == 1) {
if (ch == 0x03) {
Data[1] = ch;
if (readN(&ch, 1) == 1) {
if (ch == 0x04) {
Data[2] = ch;
if (readN(&Data[3], 6) == 6) {
if (CRC16_2(Data, 7) == (Data[7] * 256 + Data[8])) {
LUX = (Data[3] * 0x1000000 + Data[4] * 0x10000 + Data[5] * 0x100 + Data[6]) / 1000.000;
flag = 0;
}
}
}
}
}
}
}
}
mySerial.flush();
}
}
uint8_t readN(uint8_t *buf, size_t len) {
size_t offset = 0, left = len;
int16_t Tineout = 500;
uint8_t *buffer = buf;
long curr = millis();
while (left) {
if (mySerial.available()) {
buffer[offset] = mySerial.read();
offset++;
left--;
}
if (millis() - curr > Tineout) {
break;
}
}
return offset;
}
unsigned int CRC16_2(unsigned char *buf, int len) {
unsigned int crc = 0xFFFF;
for (int pos = 0; pos < len; pos++) {
crc ^= (unsigned int)buf[pos];
for (int i = 8; i != 0; i--) {
if ((crc & 0x0001) != 0) {
crc >>= 1;
crc ^= 0xA001;
} else {
crc >>= 1;
}
}
}
crc = ((crc & 0x00ff) << 8) | ((crc & 0xff00) >> 8);
return crc;
}
Print the collected light values
Possible reasons for no output or output errors:
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีธนาคาร KBANK, SCB, BBL,TMB
กรุณาเก็บหลักฐานการโอนเงินของท่านไว้เพื่อแจ้งการชำระเงินด้วยค่ะ
ท่านสามารถแจ้งการชำระเงินผ่านระบบอัตโนมัติได้โดย Click Link ข้างล่างค่ะ
https://www.arduitronics.com/informpayment
หน้าที่เข้าชม | 15,375,832 ครั้ง |
ผู้ชมทั้งหมด | 5,878,910 ครั้ง |
เปิดร้าน | 21 พ.ค. 2556 |
ร้านค้าอัพเดท | 6 ก.ย. 2568 |