Alias: modul OPT3001, CJMCU-3001, ClosedCube OPT3001, lux meter. Filternya memblokir inframerah, jadi hasilnya sepakat dengan mata di mana fotodioda biasa membaca terlalu tinggi di bawah cahaya pijar. Layar meredup dengannya; rumah kaca mencatat data dengannya.
Pins
| Pin | Fungsinya |
|---|---|
VCC, GND |
Catu daya, 3 sampai 5 V pada board. |
SCL, SDA |
I2C. Board membawa pull-up-nya. |
INT |
Interupsi ambang batas atau konversi siap, aktif low. |
Properti
address, 0x44 sampai 0x47. lux adalah cahayanya; slider mengubahnya.
Membacanya di Arduino
Dengan library ClosedCube, yang dibawa Mokxi sebagai ClosedCube_OPT3001.h:
#include <ClosedCube_OPT3001.h>
ClosedCube_OPT3001 opt3001;
void setup() {
Serial.begin(9600);
opt3001.begin(0x44);
OPT3001_Config config;
config.rawData = 0;
config.RangeNumber = 0b1100;
config.ModeOfConversionOperation = 0b11;
opt3001.writeConfig(config);
}
void loop() {
Serial.println(opt3001.readResult().lux);
delay(500);
}
Cara komunikasinya
Sixteen-bit registers: 0x00 the result, an exponent and a twelve-bit mantissa, lux = 0.01 x 2^E x R; 0x01 the configuration (range, 100 or 800 ms, the mode and the flags);
0x02 and 0x03 the limits; 0x7E 0x5449 and 0x7F 0x3001. It powers up shut down;
continuous mode converts every 100 or 800 ms and sets the conversion ready flag, which
reading the configuration clears.
Apa yang tidak dimodelkannya
Jumlah fault dan respons spektral: slider-nya adalah hasil bacaannya.
Common mistakes
Reading the result before a conversion has finished: it reads zero until the first one, 100 or 800 ms after the mode is set.