1
0
mirror of https://github.com/cmur2/python-veml6070.git synced 2024-12-30 16:54:24 +01:00
A python library for accessing the VEML6070 digital UV light sensor from Vishay
Go to file
cn 4eda08a9c9 module: calculate UVA light intensity correctly for rset != RSET_240K
- compensation for rset != RSET_240K was wrong, it increased UVA power/ADC step for rset > RSET_240K
- UVA power/ADC step should have been decreasing as refresh time (sampling time) got longer
- same behavior as with integration_time setting, that works correctly
2019-09-19 01:18:42 +02:00
tests module: calculate UVA light intensity correctly for rset != RSET_240K 2019-09-19 01:18:42 +02:00
veml6070 module: calculate UVA light intensity correctly for rset != RSET_240K 2019-09-19 01:18:42 +02:00
.gitignore module: add pytest for unit and snapshot testing with travis-ci 2018-03-14 00:39:10 +01:00
.pylintrc module: ignore some files for linting 2018-03-14 23:17:54 +01:00
.pyup.yml module: make pyup less noisy 2019-03-13 08:36:59 +01:00
.travis.yml module: test python 3 versions of debian on travis-ci 2019-08-17 21:21:59 +02:00
demo.py module: ignore some files for linting 2018-03-14 23:17:54 +01:00
LICENSE Initial commit 2016-05-29 22:35:03 +02:00
pytest.ini module: add pytest for unit and snapshot testing with travis-ci 2018-03-14 00:39:10 +01:00
README.md module: calculate UVA light intensity correctly for rset != RSET_240K 2019-09-19 01:18:42 +02:00
requirements.txt deps: update pytest from 4.5.0 to 4.6.4 2019-07-02 08:48:46 +02:00
setup.py Fiat lux 2016-05-29 23:13:04 +02:00

python-veml6070

Build Status

A Python library for accessing the VEML6070 digital UV light sensor from Vishay via python-smbus using the I2C interface.

Default settings are suitable for Raspberry Pi 2 and 3 and was successfully tested using a breakout.

I created this Python library in style of e.g. python-tsl2591 (of the TSL2591 light sensor) since I found either python code broken for my hardware or code targeted at Arduino.

Usage

Consult the datasheet, the application notes and see demo.py for clues how to use this library.

Not all functions of the chip are supported, especially not the interrupt handling since I had no use for this. Please send pull requests for improvements and bug fixes!

Serious Flaws before September 2019

In September 2019 it was discovered (and fixed) that:

  • previously the sensor was never shutdown between measurements which wastes power but still takes measurements successfully
  • the UVA light intensity was calculated wrongly (too high) for rset != RSET_240K due to wrong compensation: higher rset leads to higher sampling time leads to higher absolute ADC step counts which should lead to every ADC step indicating a smaller amount of W/(m*m) of UVA power and a higher precision of the final UVA power but it wrongly behaved the opposite way. The integration_time worked correctly all the time.

License

Python files in this repository are released under the MIT license.