Adding new i2c sensors

Posted on
Tue Mar 14, 2017 8:48 am
andarv offline
Posts: 126
Joined: Jun 28, 2015
Location: Stockholm, Sweden

Re: Adding new i2c sensors

I'll try them and report as soon as I get them. Most likely it's 20days away...

Posted on
Tue Mar 14, 2017 9:45 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

on the BME280

there sensors called BME-BMP280 they are NOT the BME280, but the successor of the BMP180.. You can use them as a BME280 device from the plugin point of view - code is the same- , but they do not deliver humidity.

Karl

Posted on
Tue Mar 14, 2017 11:04 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

found the library .. for the APDS-9960.. for the RPI

installation is a little complex but doable ..

the pipe the output into stdin python program and you "see" the results: up/left/right ..

now waiting or the module..

Karl

https://justinwoodman.wordpress.com/2014/11/15/using-the-apds-9960-rgb-proximity-and-gesture-sensor-with-the-raspberry-pi-2/

Posted on
Thu Mar 16, 2017 11:41 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

andarv,

got the gesture sensor.. RGB and proximity works, the gesture not yet.. ==> the interrupt output does not do anything, look like it is not the RPI, but the sensor, ..

Karl

Posted on
Thu Mar 16, 2017 3:49 pm
andarv offline
Posts: 126
Joined: Jun 28, 2015
Location: Stockholm, Sweden

Re: Adding new i2c sensors

OK, so the sensor show some kind of life that always something. Hopefully I'll get my some time next week, otherwise it'll take some time before I'm able to test mine.
Ordered a few BME280, lucky you pointed out the difference between BMP and BME, ordering from Chine it's not that simple to recognize.

Posted on
Thu Mar 16, 2017 3:51 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

It looks as if the one I ordered is not the 6690. But an older model. Exactly that issue is described in the post in the discussion. So I ordered aboriginal sparkfun. Let's see if that works.


Sent from my iPhone using Tapatalk

Posted on
Thu Mar 16, 2017 3:55 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

Once it works I was planning to add direct actions on the rpi. E.g. Pin up/down for xx secs (xx = 0.1....100000000000secs)
To make it instantaneous and send also send the msg to indigo.

Also have order the fm i2c radio. So the weekend is busy


Sent from my iPhone using Tapatalk

Posted on
Fri Mar 17, 2017 1:40 am
andarv offline
Posts: 126
Joined: Jun 28, 2015
Location: Stockholm, Sweden

Re: Adding new i2c sensors

I was close to order the older before notice that 9960 was better supported, but it really is a jungle of sensors.

Posted on
Fri Mar 17, 2017 10:19 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

2 line display works..
Attachments
Screen Shot 2017-03-17 at 11.18.20.png
Screen Shot 2017-03-17 at 11.18.20.png (327.36 KiB) Viewed 3036 times

Posted on
Sat Mar 18, 2017 11:45 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

Andvar,

have converted the 2000 lines of C++ code to python for the gesture/color/proximity modul..
The color and proximity sensor part works. But I still can't get the gesture to work. Not even in the basic C++ program = no output, will try to do it now in python..
I don't get any interrupt triggers, not even on the scope = the pin does not send anything- with both the original spark fun and chinese knock off.. also no signal on the scope . it must be in the config ..

have learned a bit how to move things fro C++ to python.. Now I can access the feature directly

just talking to my self,.. need a break was a long night

Karl


get output, but not with interrupts:
Code: Select all
Ambient,Red,Green,Blue:  2266 898 795 795
readProximity            25
readGesture              DIR_NONE
Ambient,Red,Green,Blue:  2201 881 775 773
readProximity            28
readGesture              DIR_LEFT
Ambient,Red,Green,Blue:  1150 465 401 402
readProximity            255
readGesture              DIR_LEFT
Ambient,Red,Green,Blue:  192 78 80 67
readProximity            42
readGesture              DIR_LEFT
Ambient,Red,Green,Blue:  163 66 68 57
readProximity            40
readGesture              DIR_LEFT
Ambient,Red,Green,Blue:  253 103 112 91
readProximity            44
readGesture              DIR_NONE
Ambient,Red,Green,Blue:  177 72 73 62
readProximity            43
readGesture              DIR_NONE

Posted on
Sat Mar 18, 2017 2:16 pm
andarv offline
Posts: 126
Joined: Jun 28, 2015
Location: Stockholm, Sweden

Re: Adding new i2c sensors

I was relived when I read that last part about talking to your self, at one point a was afraid you might ask a question. Coudn't tell the diffence between C++ and Python even with a gun to the head. I can't understand why computers don't speak all languages nativelly infact...

But it looks as the sensors read the direction? And how sensitive is the proximity?

Posted on
Sat Mar 18, 2017 11:09 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

we are getting there .. proximity / color/ gesture sensor.. but the interruption still does not work.. but with polling every 0.2 secs it works
Attachments
Screen Shot 2017-03-19 at 00.10.38.png
Screen Shot 2017-03-19 at 00.10.38.png (49.94 KiB) Viewed 2985 times

Posted on
Sat Mar 18, 2017 11:45 pm
andarv offline
Posts: 126
Joined: Jun 28, 2015
Location: Stockholm, Sweden

Re: Adding new i2c sensors

That looks really promising, can't wait to to test how it works.
You increased the polling to fetch the gesture.

I didn't intend for you to loose all that sleep when I ordered that sensor. I'll go down and start working on the covering glass then.

Posted on
Sun Mar 19, 2017 10:47 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

Andvar,
if you want to try out the proximity sensor
https://www.dropbox.com/s/r6tlxoxdx46lf3u/piBeacon-v-7-45-66.zip?dl=1

some comments:
use GPIO for interrupt pin
you can add a direct action on the RPI in the device edit, for beginner use "ls" for e.g. proximity change
you can also use the GPIO commandline commands to set outputs up/down.

this is the first public version.. have not found any pgm issues, but need to work on logic .

karl

example for an action:
Code: Select all
gpio -g mode 22 out; gpio -g write 22 1
would set GPIO # 22 mode to out, and set the pin up; see https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/
for more examples for the gpis commands from the command line.

you would see:
20170319-12:08:04 action: gpio -g mode 22 out; gpio -g write 22 1
in the log file /var/log/apds9960.log if you set debug sensors on the RPI to high

Posted on
Sun Mar 19, 2017 11:33 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Adding new i2c sensors

got the i2c module FM TEA 5767 to work, but the sound quality is poor. Need to work on the antenna,

the idea was that you could have a radio controlled by indigo/raspberry.


Karl

Who is online

Users browsing this forum: No registered users and 6 guests