Detecting cellphone proximity

Hi, first post and i’m quite new to arduino as well.
I’m doing a project where I need to trigger a servo motor when a cellphone enters to a radius of 5 meters from it. My guess is that I need a sensor that can detect the RF of the phone, and I know that these kind of devices exist, but is there any way that I can get my hands on this type of sensor and would Arduino work with it?

Hi, I've recently built a cell-phone detector with the Arduino. Of course it can only detect the cell-phone when it is actively transmitting. It the person is not making a phone call, it will usually not trigger the detector.

I used the Linear Technology LT5534 power detector. You can get free samples of their chips from the LT web site. I have built the reference circuit in the datasheet and conneted the output of the detector to an analog input of the board.

Obviously, there is a lot of RF signals being detected, such as bluetooth, WLAN and so on, so you need to detect a characteristic pattern of the phone. I'm not sure how universally valid this is, but some experiments learned that because of the TDMA acces, it shows small pulses of about 500 microseconds once every +/- 5 milliseconds. I wrote the software to trigger detection after seeing three such pulses. I you want I can look up the code.

The detector works quite well up to 7 meters or so at home (but this may depend on the environment of course).

Regards, Marc

If you want to detect specific cellphones and they have Bluetooth enabled, then using a Bluetooth arduino may be an easy way to do what you want. It would enable you to detect any Bluetooth cellphone in range or any specific phone based on mac address.

Thanks for the quick answers. The bluetooth option is not enough for me, because I need to detect all possible cellphones. And to marcg: could you please post the code so I can have a look at it. I researched for a few hours and found out that a log amp might be able to do the trick and I might be able to use the code with it. Another thing that I'm willing to try is a hall effect sensor (or something like it) and trigger the motor with any electromagnetic radiation, because I don't need that exact readings. But I have a fear that I will get strange readings from the arduino itself and I'm also concerned for the detection radius of the sensor. If someone has any insight to how big the reading radius is for a hall effect sensor and would it work with a cellphone (in other words, does the phone have strong enough radiation) I would be extremly thankful for the information.

See below for the code. It’s a bit quick and dirty, but it works (for me)…

I do not have any experience with the Hall effect sensor, but I am very sceptical about it. A Hall effect sensor measures a static magnetic field, which is something very different from electromagnetic radiation. I think there is no static magnetic field around a cell phone you could detect and moreover I think you are right about the radius of detecting any magnetic field.

#define radioPin 2
#define rPin 11
#define gPin 9
#define bPin 10

#define THRESHOLD 33

int radioStrength;
int median = 50;

inline void readRadio(){
    radioStrength = analogRead(radioPin);
    if( radioStrength>median) median ++; else median--;
}

void setup()                    // run once, when the sketch starts
{
  pinMode(radioPin, INPUT);
  pinMode(rPin, OUTPUT);
  pinMode(gPin, OUTPUT);
  pinMode(bPin, OUTPUT);
}

void writeRGB(int rValue, int gValue, int bValue){
  analogWrite(rPin, rValue);
  analogWrite(gPin, gValue);
  analogWrite(bPin, bValue);
}

void loop()                     // run over and over again
{
  int count;
  reset:
    writeRGB(0,0,0);
  
  // state machine
  idle: 
    readRadio();
    if(radioStrength<median+THRESHOLD) goto idle;

    // detect short pulse approx 5x100us
    count = 0;
    while(radioStrength>=median+THRESHOLD){
      readRadio();
      count++;
    }
    if(count<=4 || count>=6) goto reset;
    writeRGB(0,0,300);

    // detect period between pulses approx 37x100us
    count = 0;
    while(radioStrength<median+THRESHOLD){
      readRadio();
      count++;
    }
    if(count<36 || count>38) goto reset;  
    
    // detect short pulse approx 5x100us
    count = 0;
    while(radioStrength>=median+THRESHOLD){
      readRadio();
      count++;
    }
    if(count<=4 || count>=6) goto reset;

    // detect period between pulses approx 37x100us
    count = 0;
    while(radioStrength<median+THRESHOLD){
      readRadio();
      count++;
    }
    if(count<36 || count>38) goto reset;  
    
    // detect short pulse approx 5x100us
    count = 0;
    while(radioStrength>=median+THRESHOLD){
      readRadio();
      count++;
    }
    if(count<=4 || count>=6) goto reset;

    // cell phone detected !!!!!    
    // blink the RGB led
    writeRGB(300,0,0);
    delay(500);
    writeRGB(0, 300,0);
    delay(500);
    goto reset;
}

Quite right a hall effect sensor detects magnetic fields and they drop of with an inverse cube rule as opposed to the inverse square rule for electromagnetic radiation. So detecting a magnet at 5m distance isn't going to happen with a hall effect sensor. I have used hall effect sensors and they are not the most sensitive form of magnetic sensing. Anyway, as mentioned before, a cell phone doesn't have a magnetic field associated with it.

Note the cell phone doesn't necessarily have to be in use as they are occasionally polled from the transmitter of the cell they are in but you probably couldn't relay on this.

Hi, I am currently working on my thesis, and found this thread very helpful. I have a little experience with Arduino but I've found on the Internet easy tutorials on how to make EMF detectors. I am basically interested in what Glitch is asking. I want to allow people to visualize microwaves and static/magnetic waves from their cellphones/ipods and even from the WiFi of the building. Is there a way to merge all of this sensors and code into one structure so I could receive data from this waves and represent them in an interactive installation? I I would really appreciate any help! Thanks!

Short of using a full RF spectrum analyzer as a sensor/detector ($$$), I think you are asking a little too much of a Arduino and simple RF detection methods.

Lefty

Hi Lefty, thanks for getting back to me. Yeah those are very expensive. What about the Trifield (http://www.amazon.com/s/?ie=UTF8&keywords=trifield&tag=googhydr-20&index=aps&hvadid=3835933421&ref=pd_sl_5hq5ighkn9_e) meter? is not that expensive but I am not sure if I could receive data in numbers to create a serial communication. It doesn't have to be really exact, cause it'll be an artistic piece, and I want the frequency to be reproduced by speakers in audio frequency and then this waves be visualized in water.

Thanks, D

Given the market penetration of mobile phones, wouldn't it be simpler to detect humans, and assume they've got a mobile? ;D

D,

I think the circuit described above could very well suited for that. The actual EM frequencies are not in the audible range of course, but you could translate the radiation strength into audible frequencies for instance. Alternatively, you can turn the 'modulation' frequencies which are in the audible range into souds. The specific TDMA access scheme that is used to distinguish GSM signal from other signals should be audible and different devices GSM/Wifi/bluetooth should sound differently. It is the kind of thing you hear when you put your cell phone close to your radio set.

Marc

Hi Marc,

Thank you for the advice, I appreciate it. I am now ordering the LT5534 power detector to prototype, I think according to the data-sheet and what you are saying it would work great. Do you have by any chance your project documented around the web? I would love to see it more in detail if you don't mind... Thanks,

D

Hi Marc,
I have a question, I am trying to buy the part at linear tech. Did you request the free sample that says: cut tape 3GHz Log Amp RF Detector?
Thanks, and sorry for so many questions.
Best,
Denise

No, I do not have it documented anywhere, but it is just the circuit in the data sheet. With a chip antenna connected to the input (don't know any part number for that one) and the output connected to an analog input of the Arduino. The Arduino code is in this thread.

These pages may also be interesting: http://petertodd.org/tech/emf-detector/ http://www.edn.com/article/CA6391433.html

That is indeed the right free sample.

Sounds good! I'll take I look at them now. I already ordered the free samples, hope they send them.Tomorrow I will experiment with EMF detectors, let's see how that goes and if I am able to capture something interesting. Thanks again for your time,

D

Hi Marcg.
Today I received my sample :slight_smile: after receiving an empty package the company re-sent me a sample (I have 2x LT5534ESC6#PBF)
to be honest, the part it’s way smaller than I expected. How exactly did you mount it? I don’t know if I should buy a break out board or risk it by soldering each leg to a thin wire?

Thanks for the help,
Best
Denise

I am also waiting for the sample and want to be able to detect radio frequencies or/and cellphones.

How did you mount it to arduino and what parts do you need for the code? Chip antenna, the detector, arduino board obviously and something else? What kind of chip antenna is it and where can you get it?

Sorry for all the questions, I am quite new to arduino and will require lots of help with my project in coming weeks so hopefully I will be able to get some here on the forum.