VEML6075 UV Sensor
This documentation includes installation guidelines and sample code for your hardware.
Python Library
Turta_VEML6075 library is responsible for communicating with the VEML6075 sensor.
To install the library from the (PyPI) Python Package Index, enter the following command to the console.
Add the following statement to the top of your Python code.
Then, create an instance of the Turta_VEML6075 class.
Now you're ready to access the library by calling the veml6075 instance.
Initialization
The library automatically initializes the required components when its instance is being created, so there is no need to do a manual initialization.
Basic Members
Calculate Average UV Index
Calculates the Average UV Index.
Parameters
None
Returns
Float: Average UV Index.
Calculate UV Index A
Calculates the UV Index A.
Parameters
None
Returns
Float: UV Index A.
Calculate UV Index B
Calculates the UV Index B.
Parameters
None
Returns
Float: UV Index B.
Advanced Members
Calculate Compensated UVA
Calculates compensated UVA.
Parameters
None
Returns
Float: Compensated UVA.
Calculate Compensated UVB
Calculates compensated UVB.
Parameters
None
Returns
Float: Compensated UVB
Samples
You can copy the example code from https://github.com/Turta-io/IoTHAT/tree/master/Samples/Raspbian/Python address, and then copy it to the Raspberry Pi. There is one example of this library.
VEML6075 Sample App
This application demonstrates printing UV Index, UVA Index and UVB Index calculations from the sensor.
To run the example:
Copy the library and sample code to a folder on the Raspberry Pi.
Open terminal, and go to the folder you copied the codes.
Run the sample with the following command:
Sample Code
Result
When you run the sample, it prints UV readings to the terminal. The example output should be like this:
To stop the Python script, just press CTRL + C.
Last updated