Dependencies¶
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Installing from PyPI¶
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-veml6075
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-veml6075
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install adafruit-circuitpython-veml6075
Usage Example¶
import time
import board
import busio
import adafruit_veml6075
i2c = busio.I2C(board.SCL, board.SDA)
veml = adafruit_veml6075.VEML6075(i2c, integration_time=100)
while True:
print(veml.uv_index)
time.sleep(1)
Contributing¶
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Documentation¶
For information on building library documentation, please check out this guide.
Table of Contents¶
Simple test¶
Ensure your device works with this simple test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import time
import board
import busio
import adafruit_veml6075
i2c = busio.I2C(board.SCL, board.SDA)
veml = adafruit_veml6075.VEML6075(i2c, integration_time=100)
print("Integration time: %d ms" % veml.integration_time)
while True:
print(veml.uv_index)
time.sleep(1)
|
adafruit_veml6075
¶
CircuitPython library to support VEML6075 UVA & UVB sensor.
- Author(s): ladyada
Implementation Notes¶
Hardware:
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
-
class
adafruit_veml6075.
VEML6075
(i2c_bus, *, integration_time=50, high_dynamic=True, uva_a_coef=2.22, uva_b_coef=1.33, uvb_c_coef=2.95, uvb_d_coef=1.74, uva_response=0.001461, uvb_response=0.002591)¶ Driver base for the VEML6075 UV Light Sensor :param i2c_bus: The
busio.I2C
object to use. This is the only required parameter. :param int integration_time: The integration time you’d like to set initially. Availble options - each in milliseconds: 50, 100, 200, 400, 800. The higher the ‘_x_’ value, the more accurate the reading is (at the cost of less samples per reading). Defaults to 100ms if parameter not passed. To change setting after intialization, use[veml6075].integration_time = new_it_value
. :param bool high_dynamic: whether to put sensor in ‘high dynamic setting’ mode :param float uva_a_coef: the UVA visible coefficient :param float uva_b_coef: the UVA IR coefficient :param float uvb_c_coef: the UVB visible coefficient :param float uvb_d_coef: the UVB IR coefficient :param float uva_response: the UVA responsivity :param float uvb_response: the UVA responsivity-
integration_time
¶ The amount of time the VEML is sampling data for, in millis. Valid times are 50, 100, 200, 400 or 800ms
-
uv_index
¶ The calculated UV Index
-
uva
¶ The calibrated UVA reading, in ‘counts’ over the sample period
-
uvb
¶ The calibrated UVB reading, in ‘counts’ over the sample period
-