UV sensor issue

I got a UV sensor a while back and am just now getting time to play with it. It is SEN 0162 and came with an analogue cable but no instructions. Can this cable be used to connect to an arduino directly without the need to add wires etc? The cable appears to plug into the sensor

Hi Peter,

Being an analog sensor, all you need to do is read the output voltage using an analog pin on your Arduino and then react accordingly. The cables on those sensors can’t physically plug into the Arduino, so you’ll just need to cut one end of the cable and tin the wires so you can insert them into the headers of your Arduino.


Thanks. I am obviously a beginner!

I guess you mean the free end in the attached pic? One end seems to go into the sensor OK as I have done. Do I need to cut the free end as you say?

Peter Ryan

Hi Peter,

Yes, otherwise you won’t be able to connect it to your Arduino. You could also just use some male jumper wires to connect it up although that wouldn’t very secure enough for anything other than prototyping

I see now what to do! Unfortunately I cut the end so the wires are now free so cannot use male jumper leads! I need to get another little cable that came with the unit - are these for sale separately? I guess not so will need to get another unit. My total ignorance showing

Not a huge issue Peter, you won’t need to buy a new cable. Instead just get some 1x1 header housings and male crimp pins.

You’ll get way more than you need, but crimp connectors are invaluable for any project, and a great option to have on hand for future connectors.

thanks for your advice - I will get these at jaycar later today

All i want to do is experiment with some sensors with an arduino so I do not need any robust connections

I got some more connectors and think I now finally have the sensor connected but it always gives zero output?

Is there any way to tell if it is working correctly.

What is your code on the Uno?

I use the supplied code slightly modified as attached

Arduino seems to be supplying 5 v to sensor as measured with multimeter

However sensor seems to give zero volts out. It must be blown or otherwise faulty?

Thanks for giving it a go Peter, lets get a replacement on the way to you.

Thanks Graham

I am really keen to get this working for some Internet of Things work so am certain to buy some more systems

Peter Ran

1 Like

I did send payment for this replacement sensor. Was this strictly required?


Peter Ryan

Hi @Peter47774,

In this scenario no payment was needed - we sent you a replacement straight away. I’ll send you an email to fix that up.

Thanks Graham I received another UV sensor

However I still have the same issue – zero output? I am sure it is wired up to the Arduino correctly

Peter Ryan

Hi Peter,

Sounds like there’s something else going on then. Could you post the code that you’re using? If you’ve got a multimeter handy, I’d recommend testing the voltages on each pin at the sensor to ensure that it’s connected the way that you expect.

I moved the PC-arduino-UV system outside where there IS some UV!

Now I can get 30 – 40 mV output and confirmed with multimeter. However I should be getting a much higher Vout value in the 600 – 1000mV range out on a high UV day according to the spec sheet below.
The multimeter also showed an input voltage of 5.7 V for the sensor

Hmm, well first up, 5.7V is higher than I’d expect it to be if you’re running it off the Arduino 5V pin. Could you measure the 5V pin voltage with nothing connected?

Could you post the code that you’re using so we can take a look at it?

My PHYSICS error! Thanks for your patience

I put the sensor directly in the sun and it gives readings in the rage 700 – 950 mV at 4pm in Melbourne

According to the Met Bureau the UV index is 7.6

This corresponds to a sensor voltage in range 795 – 881 mV according to calibration.

If I enclose the sensor with my hand, it registers zero. If I go into the shade, the reading drops to 30 – 60 mV

Thus I conclude that all is working perfectly. I was testing it previously in the shade or even indoors where UV=0!!

My aim was to test the sensor against various UV ‘apps’ – however these only access a website rather than use an onboard sensor to measure the UV

Is there a similar DF robot sensor for ambient light detection or infra red?