21-06-2015, 15:10
Hello, I think that something isn't quite correct:
When I plugged UVM-30A trial without cover, I measured UV Index between 7 and 15. In the evening I had still UV Index for example 4. And when I covered sensor by acrylic cover, UV Index was too low. So:
I tested voltage output and analyzed program. WeatherDuino calculates UV Index by this formula (WeatherDuino_RX_v1.4_b034.ino, table RX_TX, raw 212):
But this is not correct. It includes the impact of acrylic cover, but there is a question, if that impact is linear or not. And measurement in area of low UV indexes has to be fail, because the curve of UV Index isn't here linear:
The upper part of the picture shows the curve from the manufacturer, the bottom is from our programme (it includes the acrylic cover shadow effect).
In the Arduino UVM-30A datasheet is:
So, I think, it would be better:
1) Don't cover UVM-30A sensor by anything. Water small lens doesn't matter, but we have to tighten it around.
2) Our programme would be modified, for example:
But - my problem is I am very bad programmer, maybe there are some mistakes in the new code ...
I've tested it now for 2 days, I think the measurement is more correct than before:
(09-09-2014, 17:39)Werk_AG Wrote: Get a suitable outside waterproof case with a clear acrylic cover (avoid glass, unless it's cristal). Mount the sensor inside the case, facing the acrylic cover. Mount the case horizontaly, in a place with clear sky view.
Connect the output sensor pin, to pin A1 on UV-Solar connector on your TX board. Power for the UV sensor is available on the same connector. Don't use too long cables between TX board and UV sensor (1 to 1,5 meters máx).
Enable the transmission and reception of Solar / UV data, in TX and RX software.
Some small adjusts may be needed in calculations on RX software. None of this is plug and play, which is why building it, is fun and educational.
When I plugged UVM-30A trial without cover, I measured UV Index between 7 and 15. In the evening I had still UV Index for example 4. And when I covered sensor by acrylic cover, UV Index was too low. So:
I tested voltage output and analyzed program. WeatherDuino calculates UV Index by this formula (WeatherDuino_RX_v1.4_b034.ino, table RX_TX, raw 212):
IndiceUV = ((ADC1 * 16.5) / 1024.0)
But this is not correct. It includes the impact of acrylic cover, but there is a question, if that impact is linear or not. And measurement in area of low UV indexes has to be fail, because the curve of UV Index isn't here linear:
![[Image: PorovnaniVypoctu.png]](https://brandys.my-meteo.net/MyDocs/PorovnaniVypoctu.png)
The upper part of the picture shows the curve from the manufacturer, the bottom is from our programme (it includes the acrylic cover shadow effect).
In the Arduino UVM-30A datasheet is:
![[Image: UVM-30A_Index.png]](https://brandys.my-meteo.net/MyDocs/UVM-30A_Index.png)
![[Image: UVM-30A_Table.png]](https://brandys.my-meteo.net/MyDocs/UVM-30A_Table.png)
So, I think, it would be better:
1) Don't cover UVM-30A sensor by anything. Water small lens doesn't matter, but we have to tighten it around.
2) Our programme would be modified, for example:
Code:
float IndiceUV;
int lastUV = -1;
int uvIndexValue [13] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170, 3000};
int uvIndex;
//long ADC0, ADC1;
//long SolarRad;
unsigned int ADC0, ADC1;
unsigned int SolarRad;
ADC0 = RX_Data[2]; // Data from Analog Digital Converter 0 on Arduino TX
ADC1 = RX_Data[3]; // Data from Analog Digital Converter 1 on Arduino TX
//NOT USED = RX_Data[4]; //
#if Solar_Sensor == 1
// --- ADC0 is data from Solar Radiation
if (ADC0 < 4) ADC0 = 0;
SolarRad = map(ADC0, 0, 1023, 0, 1400); // Output an integer, between 0 and 1400 W/m2
#else
SolarRad = 0;
#endif
#if UV_Sensor == 1
// --- UVM-30A on Unit1
for (int i = 0; i < 13; i++)
{
if (ADC1 <= uvIndexValue[i])
{
uvIndex = i;
IndiceUV = uvIndex;
break;
}
}
if (uvIndex != lastUV)
{
lastUV = uvIndex;
}
//IndiceUV = ((ADC1 * 16.5) / 1024.0) ;
#else
IndiceUV = 0;
#endifBut - my problem is I am very bad programmer, maybe there are some mistakes in the new code ...
I've tested it now for 2 days, I think the measurement is more correct than before:

