In case anyone comes looking, I've built something recently that did exactly this.
I built three versions, all of which work, but have different constraints in terms of what you're connecting to people.
1)Passive version
One person has a wire attached to them. This is attached directly to the analog pin of the arduino.
If you repeatedly read from the analog pin of the arduino, you will get a pretty random value (basically the person is being a big antenna). However, the amount this value varies is pretty constant. So, I do analogRead 20 times, calculate the variance (you know, the obvious way, using your school maths). This stays constant while someone is not touching anyone else.
The moment they touch someone else, the antenna is one heck of a lot bigger, and the variance increases drastically.
2)Semi-active version
Both people have wires attached to them, person 1 is from analog pin of arduino, person 2 from ground of the arduino. The variance of an analogRead is repeatedly sampled. If the people aren't touching, the value shifts around, as before, and a high variance is shown. When people do touch, the circuit is grounded, and the value goes down to 0.
3)Active version
Both people have wires attached to them, person 1 from analog pin of arduino, person 2 from digital output pin. On the digital output pin, I output a square wave, in sync with my measurements of the analog pin. This way, when people touch, the variance is really high (as it is recording 0...1024...0...1024.) I use the pullup resistor to output the square wave, to limit current, don't know if it really changes much, but I felt more comfortable putting it through the person's body with it.
Because of the active signal being used, the top and bottom values of variance are pretty constant, so this version is I think most accurate.
The measurement loop looks roughly like this:
for(int n=0;n<20;n+=2)
{
pinMode(outpin,INPUT);
digitalWrite(outpin,HIGH); // square wave HIGH (through pull up resistor)
delay(2); // let things settle + don't run analogReads too close together
dataVal[n] = analogRead(inPin);
pinMode(outpin,OUTPUT);
digitalWrite(outpin,LOW);//square wave LOW (as output)
delay(2); // let things settle + don't run analogReads too close together
dataVal[n+1] = analogRead(inPin);
}
// calculate variance of the data values here
Best Answer
I think your Bluetooth suggestion is the most viable one. However I would use the new BLE (Bluetooth Low Energy) standard as it will reduce the current consumption of the senders considerably.
You refer to the devices carried by the users as senders and the fixed room devices as scanners; the actual Bluetooth nomenclature is masters for the fixed room Bluetooth devices, and slaves for the senders since they will be going in and out of the network as people arrive and leave.
In addition to the senders and receivers, you are going to need a host Bluetooth device that receive all of the information from the fixed room devices.
The problem with Bluetooth (or any radio-based scheme) is that multiple room receivers will "see" each of the senders since the range will probably be at least 10m inside a house.
However it's possible to narrow things down using a RSSI (Received Signal Strength Indication). Each master can compute its own RSSI value for the slave, and then these could be sent to a host computer which could do a triangulation calculation. Here is a paper written on this topic.
Note that it is not necessary to actually do a Bluetooth pairing to get the RSSI value; one just needs to execute the command to do an inquiry and each of the RSSI values will be returned along with the MAC ID of the devices. This is very convenient, since it means you never have to actually pair up any of the slaves with any of the fixed room Bluetooth masters.
We're not really supposed to provide specific product information here, I'll just say I have used the Bluegiga BLE113 on a couple of projects successfully.
Note: Beside BLE, I should mention that ZigBee is also an alternative. It works in the same 2.4 GHz frequency range as Bluetooth and Wi-Fi. It has the advantage that it uses a mesh network as a network model, which makes it easier to hop from one node to another (for BLE, you will have to engineer that yourself -- mesh networks are coming to BLE, but are not here yet).
The main disadvantage with ZigBee, as I see it, is there is no built-in transceiver in either PCs or Smartphones, like there is for BLE. Why is that important? If you have a smart phone in your pocket, you won't need to carry anything else to be recognized (such as a bracelet).