Hello,
I just started with arduino and mysensors and I would like to share my first steps (re)building my broken uv-sensor.
I bought the orignal TS704 UV sensor about two years ago. A few weeks ago it stopped sending acurate UV readings. On lots of placesa on the internet there are complaints abouts this sensor and the relative short lifetime. Main reason I think is water leakage in the sensor. I didn't want to buy a new one because the problem would be back within 2 years and they are realy expensive at the moment (about €70).
Then I found the mysensors site in my quest to fix my broken device and my first sensor project was born!
I ordered the pieces I needed and started to build.
First the gateway, connected to domoticz which was easy as I connected it directly to the raspberry pi using the pigatewayserial software. Antenna directly connected to the Pi so no Arduino board needed!.
Changed tty TTY_NAME := /dev/ttyMySensorsGateway to tty
TTY_NAME := /dev/ttyUSB30 in the makefile because Domoticz cannot use ttyMySensorsGateway.
After that It was easy to add the serialgateway to Domoticz!
my list:
Arduino pro mini 8mb 3v
UVM-30a UV sensor
NRF24L01+ 2.4GHz Wireless Transceiver
TS704 UV sensor housing including 2xAA batery compartment
Used the default sketch with pin A0 instead of pin 3 (http://www.mysensors.org/build/uv)
On my breadboard I had things up and running quite easy but the readings were strange. Even at night there was UV light measured. The problem was a mismatch between the intructions on this website about the out pin to use and the one mentioned in the sketch. Sketch showed pin A0 as OUT but website showed pin 3 as OUT.
@hek has confirmed that A0 is the correct pin. Website will be updated. (is updated now)
I was mislead because with nothing connected to pin A0 it still gives you output data.
It's also possible to use 3V for the UVM-30A instead of only 5volt I found this in the spec sheet.
So the stepup from 3 to 5v is not needed I think?
To get things in the housing I had to desolder the main piece from the UV sensor. Things have gone wrong from here because after that the sensor did not work anymore. Probably fried the sensor?! New one is on its way.
So I must think of another way to get the sensor in place at the top of the housing. There not enough place so I must be creative and not destroying another sensor!
I also would like to share a short piece of code I found to test the uv sensors output. This way you don't need to attach all the radio wires to see if the sensor is working.
/*
This Sample code is for testing the UV Sensor .
#Connection:
VCC-5V
GND-GND
OUT-Analog pin 0
*/
void setup()
{
Serial.begin(9600);// open serial port, set the baud rate to 9600 bps
}
void loop()
{
int sensorValue;
sensorValue = analogRead(0);//connect UV sensors to Analog 0
Serial.println(sensorValue);//print the value to serial
delay(200);
}
The pieces on the table:
New sensor arrived and bought a 15W soldering iron.
Puting things together and make some room for the sensor board
After everthing was put in place the sensor went outside for testing.
For reference I also used a nearby UV sensor via Weather Underground.
At first everything looked fine but it seems that the measurements from my sensor are to low.
I removed the sensor and did some testing with the above sketch to measure the output voltage on 3.3v and 5v but the results were the samen and to low.
Does anyone know what can cause this low measurement ? checked the wires. checked the sketch. replaced the arduino board.
Another broken sensor?