SI1145 UV sensor

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
User avatar
ChristianIsobar
 
Posts: 7
Joined: Thu Aug 28, 2014 5:13 am

SI1145 UV sensor

Post by ChristianIsobar »

Hey.

Is it possible to use the SI1145 uv sensor at Raspberry pi b+ ?
https://learn.adafruit.com/adafruit-si1 ... ble-sensor

I have some confusion with the pins.
- If it is possible; how to get started?

-Christian

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SI1145 UV sensor

Post by adafruit_support_rick »

The Si1145 is an I2C device, so it's easy to connect to the Pi. We have a python I2C driver available, but we don't have any code specifically for the Si1145. You'll have to write that yourself.

All you need to do is connect GND to GND, 3.3v to Vin, SDA to SDA, and SCL to SCL.

User avatar
primexandy
 
Posts: 89
Joined: Sat Sep 06, 2014 11:09 am

Re: SI1145 UV sensor

Post by primexandy »

Hi,

I have just got the Pi working with the SI1145 in C / C++. If you are interest in the code I can share it with you.

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: SI1145 UV sensor

Post by egutting »

I'll be writing a driver on it for python later this week once I get the sensor. (Supposed to be in on Wednesday)

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: SI1145 UV sensor

Post by egutting »

You can find the driver in this post:
http://forums.adafruit.com/viewtopic.php?f=50&t=59913

User avatar
ChristianIsobar
 
Posts: 7
Joined: Thu Aug 28, 2014 5:13 am

Re: SI1145 UV sensor

Post by ChristianIsobar »

Thank you very much, i will look into it asap! (Thank you!)

Is it possible to use the UV without soldering the wires to the pins?


-Christian

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SI1145 UV sensor

Post by adafruit_support_rick »

ChristianIsobar wrote: Is it possible to use the UV without soldering the wires to the pins?
No. You must use solder.

User avatar
ChristianIsobar
 
Posts: 7
Joined: Thu Aug 28, 2014 5:13 am

Re: SI1145 UV sensor

Post by ChristianIsobar »

I've soldered it.

I can't get your script working @egutting getting:

Code: Select all

./examples/simpletest.py

Traceback (most recent call last):
  File "./examples/simpletest.py", line 29, in <module>
    import SI1145.SI1145 as SI1145
  File "/usr/local/lib/python2.7/dist-packages/SI1145-1.0.0-py2.7.egg/SI1145/SI1145.py", line 28, in <module>
    import Adafruit_GPIO.I2C as I2C
ImportError: No module named Adafruit_GPIO.I2C

I guess i have to install the Adafruit_GPIO, but got some troubles installing that aswell

Code: Select all

git clone https://github.com/adafruit/Adafruit_Python_GPIO.git

Cloning into 'Adafruit_Python_GPIO'...
error: Couldn't resolve host 'github.com' while accessing https://github.com/adafruit/Adafruit_Python_GPIO.git/info/refs
fatal: HTTP request failed
I'm working through SSH (putty)

And is it possible to check if the UV sensor is connected correctly ?


-Christian

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: SI1145 UV sensor

Post by egutting »

The Adafruit GPIO library is set as a dependency and it should have installed when you installed the SI1145 library. When you did "git clone library address", did you go to the folder and type "sudo python setup.py install"? Let me know if you did this and it's not working. The Adafruit library you need is located here:
https://github.com/adafruit/Adafruit_Python_GPIO.git

Also, to see if the sensor is connected correctly, you can run: sudo i2cdetect -y 1

If the address of the sensor (0x60) shows up, then it should be connected correctly.

User avatar
ChristianIsobar
 
Posts: 7
Joined: Thu Aug 28, 2014 5:13 am

Re: SI1145 UV sensor

Post by ChristianIsobar »

Yes but got an error;

Code: Select all

Installed /usr/local/lib/python2.7/dist-packages/SI1145-1.0.0-py2.7.egg
Processing dependencies for SI1145==1.0.0
Searching for Adafruit-GPIO>=0.2.0
Best match: Adafruit-GPIO 0.2.0
Downloading https://github.com/adafruit/Adafruit_Python_GPIO/tarball/master#egg=Adafruit-GPIO-0.2.0
error: Download error for https://github.com/adafruit/Adafruit_Python_GPIO/tarball/master: [Errno -2] Name or service not known
I've tried to install from that yes.

- Thank you for your help so far, i hope it will going to work.

Where should i write do the i2cdetect command?
- I mean in which folder? (does it matter)
(im new to the phyton world)

-Christian

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: SI1145 UV sensor

Post by egutting »

You can run i2cdetect in any folder.

I may need to fix that dependency link. I'll look into that when I get home this evening. You should be able to install the GPIO library in the same way you installed the SI1145 one though to get it working.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SI1145 UV sensor

Post by adafruit_support_rick »

You can follow this tutorial to set up GPIO
https://learn.adafruit.com/adafruits-ra ... gpio-setup

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: SI1145 UV sensor

Post by egutting »

I just tried to install on a fresh copy of Raspbian and it worked. Not sure what may be the issue with yours not downloading the Adafruit GPIO library.

User avatar
ChristianIsobar
 
Posts: 7
Joined: Thu Aug 28, 2014 5:13 am

Re: SI1145 UV sensor

Post by ChristianIsobar »

Again, thank you for your help and time.

It seems like i have some connection issues, tried a simple ping.
- With no succes.

So i will first fix that problem, and then i will come back with an answer if its working or not :).
- Trying the new inputs you've replied with.

- Christian

User avatar
ChristianIsobar
 
Posts: 7
Joined: Thu Aug 28, 2014 5:13 am

Re: SI1145 UV sensor

Post by ChristianIsobar »

Hey again.

It seemed that there was troubles with the connection of the device, which is solved now (yay!)

I've installed everthing on new, and its working perfectly.

Thank you so much for your help!


- Christian

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”