VEML6030 is a superb high accuracy ambient light digital sensor with 16-bit resolutions in a miniature transparent 2mm x 2mm package that integrated a low noise amplifier, highly sensitive photodiode, 16-bit A/D converter and its supports i2C bus communication interface, interrupt, and power-saving feature.
This sensor will capture light and converts to a digital value range from zero to 120,000 LUX. The VEML6030 is suitable used for Mobile, Handheld devices, smartphones, backlight dimming, industrial sensing, home automation, optical switches, and display panels. For more technical details please refer to the datasheet below.
Requirements and Alternatives
- Arduino IDE | Atmel Studio | MPLAB | Energia | PlatformIO | Processing |
- Eclipse IDE | embedXcode | Ktechlab | Codebender | Visual Micro | Zeus IDE
- SONY SPRESENSE Development Board
- Please refer to this link
- ESPRESSIF
- ESP8266 12, 12E, ESP32, ESP8266 NodeMCU, ESPDuino
- Microcontroller
- ATMEGA4809 Curiosity Nano, ChipKIT DP32, chipKIT WF32,\
- MKR WAN, MK, MKR, PRO, FIO, NANO, EVERY, UNO, MINI, MEGA, PRO MINI, LEO, BT, DUE, ETHERNET,LILYPAD, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266,ATMEGA250 16 MHz, ATSAM3x8E, STM32,
- Note: For AVR (please see the flash size of the MCU and respective pin-outs & bus configuration )
- Note: The Diagram below is using ATMEGA328TQFP & ATMEGA4809. (please refer to each MCU’s respective pin-outs & bus configuration)
- Others
- Teensy, MSP430 Launchpad, Flora, Metro MCU, Trinket, Pro Trinket, LinkItOne, Seeeduino XIAO.
- VEML6030 Light Sensor
- XC6206 3.0 Regulator / AMS1117 3.3v Regulator
- NTJD4401N Dual N-Channel MOSFET
- Resistors (See below required values)
- Capacitor(See below required values)
Wiring Guide
Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
#include <Wire.h> #include "VEML6030_Ambient_Light_Sensor.h" #define AL_ADDR 0x48 Ambient_Light light(AL_ADDR); float gain = .125; int time = 100; long lux = 0; void setup(){ Wire.begin(); Serial.begin(115200); Serial.println("14CORE | VEML6030 Test Code"); Serial.prinln("initializing ............"); delay(2000); if(light.begin()) Serial.println("READY | sensor ready...."); else Serial.println("ERROR | communicating to the sensor."); light.setGain(gain); light.setIntegTime(time); Serial.println("Reading settings..."); Serial.print("Gain > "); float gainVal = light.readGain(); Serial.print(gainVal, 3); Serial.print(" Integration Time: "); int timeVal = light.readIntegTime(); Serial.println(timeVal); } void loop(){ luxVal = light.readLight(); Serial.print("Ambient Light Reading > "); Serial.print(lux); Serial.println(" LUX > "); delay(1000); } |
Downloads
Wiring the VISHAY VEML6030 High Accuracy Ambient Light Digital Sensor
i2C 주소를 어떻게 변경할 수 있습니까?
직렬 스캐너를 사용하여 주소를 찾을 수 있습니다. I2C
당신은 i2c 스캐너에 대한 코드를 찾을 수 있습니다
https://www.14core.com/pca9685-16channel12bit-pwm-i2c-bus-controller/