أسماء بديلة: وحدة OPT3001، وCJMCU-3001، وClosedCube OPT3001، ومقياس لوكس. يمنع مرشحه الأشعة تحت الحمراء، فيتفق مع العين حيث يقرأ الدايود الضوئي العادي قيمًا مرتفعة تحت الإضاءة المتوهجة. شاشة تخفت سطوعها به؛ ودفيئة تسجّل القراءات به.
Pins
| Pin | ماذا تفعل |
|---|---|
VCC، GND |
التغذية، من 3 إلى 5 فولت على اللوحة. |
SCL، SDA |
I2C. تحمل اللوحة مقاومات الرفع. |
INT |
مقاطعة الحد أو جاهزية التحويل، نشطة بمستوى منخفض. |
الخصائص
address، من 0x44 إلى 0x47. وlux هو الضوء؛ المنزلق يغيّره.
قراءته على Arduino
بمكتبة ClosedCube، التي يوفرها Mokxi باسم 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);
}
كيف يتحدث
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.
ما لا يحاكيه
عدد الأعطال والاستجابة الطيفية: المنزلق هو القراءة.
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.