Bluetooth 4.0 (smart / low energy) presence detection

Pop your questions regarding Home automation Domotica hardware here.....
Post Reply
XanderF
Starting Member
Starting Member
Posts: 9
Joined: Fri Jan 16, 2015 2:28 pm

Bluetooth 4.0 (smart / low energy) presence detection

Post by XanderF »

After reading the Xtrusion post by 123unlock I got interested in BLE. Now I'm trying to create a presence detection system using a raspberry pi and BLE devices, but results are poor.

As a receiver I tried the LogiLink BT0015 (100 meter range), Conceptronic 1004108 CBT40NANO (100 meter range) and CSR 4.0 (20 meter range). As a transmitter I use a stickNfind.

I created a test script to receive uuid and rssi values for BLE devices I'm interested in:

Code: Select all

var winston = require('winston');

var logger = new (winston.Logger)({
  transports: [
    new winston.transports.Console(),
    new winston.transports.File({ filename: '/home/pi/bluetooth.log' })
  ]
});

var noble = require('noble');

noble.startScanning([], true);

var addressesToTrack = ['ec...', 'c0...'];

Array.prototype.contains = function(k, callback) {
    var self = this;
    return (function check(i) {
        if (i >= self.length) {
            return callback(false);
        }

        if (self[i] === k) {
            return callback(true);
        }

        return process.nextTick(check.bind(null, i+1));
    }(0));
}

noble.on('discover', function(peripheral) {
  addressesToTrack.contains(peripheral.uuid, function(found) {
    if (found) {
       logger.warn(peripheral.uuid, ' ', peripheral.rssi);
    }
  });
});
This works well when the stickNFind is within 5 meter of the raspberry PI, any further and the PI will not detect the stickNfind anymore. There was no improved switching from a 20 meter BLE USB dongle to a 100 meter one. Strangely enough the 20 meter CSR 4.0 USB dongle worked best. Probably the stickNFind is the problem here.

If anyone is doing something similar or is interested in something similar please leave your comments. Thanks :)
patrickservais81
Starting Member
Starting Member
Posts: 1
Joined: Sun Aug 03, 2014 10:12 pm
Contact:

Re: Bluetooth 4.0 (smart / low energy) presence detection

Post by patrickservais81 »

Any progress? I've been searching the web for some kind of detection, ble seems to be the best (and affordable). But only examples of ibeacons etc. Your approach is the same i was thinking of.

Verstuurd vanaf mijn HTC One M8s met Tapatalk
123unlock
Member
Member
Posts: 86
Joined: Sun Jun 03, 2012 3:08 pm
Location: Apeldoorn / Netherlands
Contact:

Re: Bluetooth 4.0 (smart / low energy) presence detection

Post by 123unlock »

the range of stick'n find is not so best, i bought myself and my wife an fitbit, it looks like those have much better range than the stick'n find and we can keep track of our steps / hart-rate etc :) running a script in nodejs as webservice, were my domotica makes an call to, and galileo to decode and post the fitbit data
both work together fine, one dongle for fitbit decode, and en BTLE dongle for the BLE tracker stuff.

as we always where the fitbit, and i have 2 raspberrys with same setup in the house i can even track prosition of around the house, and place events on this :) for example going from ground floor to the acctic will turn on the attic lights based on tracker signal :)

Dutch fun: Niet omdat het moet.. maar omdat het kan :)
Xtrusion Digital Home Automation Project
Smithl100
Starting Member
Starting Member
Posts: 1
Joined: Wed Feb 24, 2016 4:43 am

Re: Bluetooth 4.0 (smart / low energy) presence detection

Post by Smithl100 »

123unlock can you provide some more info on the fitbit and pi setup. I am able to scan and see the fitbit on the pi, but haven't figured out to look out for the fitbit and track as it goes and comes. Any info is appreciated.
Post Reply

Return to “Questions & Discussions Forum”