nfarrier
Published © LGPL

On the phone monitor

Working in a cubicle where colleagues couldn't see when I was on the phone, I needed a device that lights up every time I'm on the phone.

IntermediateFull instructions provided2 hours493
On the phone monitor

Things used in this project

Hardware components

HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
LED (generic)
LED (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Arduino UNO
Arduino UNO
×1
Male/Male Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor 2
MIT App Inventor 2

Story

Read more

Custom parts and enclosures

3D printed box

OPTIONAL box to enclose the device.

Schematics

MIT App Inventor 2 Sketch

The app that watches to phone to send signal when there's a call (incoming or outgoing).

Wiring diagram

Code

Arduino Code

Arduino
This listens for the phone's Bluetooth signal, and turns on if there's an active phone call.
int LED1=8;  // red to change

int tx=1;
int rx=0;
char inSerial[15];


void setup(){
  Serial.begin(9600);  
  pinMode(LED1, OUTPUT);
  
  pinMode(tx, OUTPUT);
  pinMode(rx, INPUT);
  delay(2000);
  digitalWrite(LED1, HIGH);  // blink 3x to show it's on
  delay(500);
  digitalWrite(LED1, LOW);
  delay(500);
  digitalWrite(LED1, HIGH);
  delay(500);
  digitalWrite(LED1, LOW);
  delay(500);
  digitalWrite(LED1, HIGH);
  delay(500);
  digitalWrite(LED1, LOW);
}

void loop(){
  int i=0;
  delay(500);
  if (Serial.available() > 0) {
  while (Serial.available() > 0) {
  inSerial[i]=Serial.read();
  i++;
  }
  inSerial[i]='\0';
  Check_Protocol(inSerial);
  }
}

void Check_Protocol(char inStr[]){
  int i=0;
  int m=0;
  Serial.println(inStr);
  if (!strcmp(inStr,"Off")){    //Led1 Off  
    digitalWrite(LED1, LOW);
    Serial.println("Off");  // only used for debugging
    for(m=0;m<11;m++){      // clears out buffered data so it doesn't keep seeing it and repeat
      inStr[m]=0;}
    }
  if (!strcmp(inStr,"On")){     //Led 1 on
    digitalWrite(LED1, HIGH);
    Serial.println("On"); // only used for debugging
    for(m=0;m<11;m++){    // clears out buffered data so it doesn't keep seeing it and repeat
      inStr[m]=0;}
    }
  else{
    for(m=0;m<11;m++){  // clears out buffered data so it doesn't keep seeing it and repeat
      inStr[m]=0;}
  i=0;
  }
}

MIT App Inventor 2 Sketch

Scheme
The app that watches the phone and sends a signal when there's a call (incoming or outgoing).
No preview (download only).

Credits

nfarrier

nfarrier

1 project • 6 followers
I'm a retired science and technology teacher, and have an amateur radio license. I enjoy programming and making things.

Comments