Wireless Loud Phone Ringer - Help Elderly With Electronics!
by Giovanni Aggiustatutto in Circuits > Wireless
4397 Views, 42 Favorites, 0 Comments
Wireless Loud Phone Ringer - Help Elderly With Electronics!
Hi, I am Giovanni Aggiustatutto and welcome to this Instructable! A while ago an elderly person asked me to make an additional ringtone for her phone, so that she can hear it well when it rings. In her home there are three cordless phones, and the charging base of one of the phones is connected to the phone port of the internet router. The additional ringer is to be put in another room near the TV, so that also had to be wireless. In addition to a very loud sound, the ringer also needs LEDs, so she can see immediately when there is a call. The difficult part is not the sound nor the LEDs, but is detecting when the phone rings and communicating that over the radio to the additional ringer. One possibility is to decode the radio connection of the phones themselves, but this is definitely out of my capabilities. So I thought about using a microphone put on the charging base of the phone (it has a ringer inside) to detect when the phone rings, that triggers the additional ringer via a WiFi connection.
To see more details about this project, watch the video on my channel (it has English subtitles).
Supplies
To make this project I used:
- 2 ESP8266 Wemos D1 mini boards
- 5 red LEDs
- 1 green LED
- 6 330 ohm resistors for the LEDs
- 1 loud buzzer
- 1 switch
- 1 Arduino sound sensor module
- 3-pin JST connector
- JST to jumper cable
- Jumper connectors
- Perfboard
- Wire
- 8 M3 threaded inserts
- 8 M3x12 mm screws
Tools:
- Soldering iron
- 3D printer with white PLA
- Hot glue
- Basic tools
Uploading the Code
Before making any electrical connection, we first have to upload the code to the two ESP8266 boards. To connect the ESP8266 that will be near to the phone to the one connected to the buzzer and the LEDs, I used the ESP-NOW WiFi communication protocol, which is a library provided by Espressif, the manufacturer of the ESP chip. I chose this library because it is really easy to use. Before uploading the code to the two boards, we need to know the MAC address of the board that we will use as a receiver. In order to do so I uploaded the following sketch on it via the Arduino IDE.
#include "WiFi.h"
//#include <ESP8266WiFi.h>
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_MODE_STA);
//WiFi.mode(WIFI_AP_STA);
Serial.println(WiFi.macAddress());
}
void loop() {
}
Once the sketch was uploaded, I opened the serial monitor and waited for the Board MAC address to show up. This address has to be copied from there and pasted in the code for the transmitter board, before uploading it.
#include <ESP8266WiFi.h>
#include <espnow.h>
// REPLACE WITH RECEIVER MAC Address (example 34:94:54:8E:13:20)
uint8_t broadcastAddress[] = {0x34, 0x94, 0x54, 0x8E, 0x13, 0x20};
// Structure example to send data
// Must match the receiver structure
typedef struct struct_message {
bool isRinging;
} struct_message;
// Create a struct_message called myData
struct_message myData;
unsigned long lastTime = 0;
unsigned long timerDelay = 800; // send readings timer
int micStatus = 0;
const int micPin = 14; // D5
const int ledPin = 12; // D6
// Callback when data is sent
void OnDataSent(uint8_t *mac_addr, uint8_t sendStatus) {
Serial.print("Last Packet Send Status: ");
if (sendStatus == 0){
Serial.println("Delivery success");
}
else{
Serial.println("Delivery fail");
}
}
void setup() {
// Set microphone pin as input
pinMode(micPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
// Init Serial Monitor
Serial.begin(74880);
// Set device as a Wi-Fi Station
WiFi.mode(WIFI_STA);
// Init ESP-NOW
if (esp_now_init() != 0) {
Serial.println("Error initializing ESP-NOW");
return;
}
// Once ESPNow is successfully Init, we will register for Send CB to
// get the status of Trasnmitted packet
esp_now_set_self_role(ESP_NOW_ROLE_CONTROLLER);
esp_now_register_send_cb(OnDataSent);
// Register peer
esp_now_add_peer(broadcastAddress, ESP_NOW_ROLE_SLAVE, 1, NULL, 0);
}
void loop() {
if (digitalRead(micPin) == HIGH) {
micStatus = 1;
digitalWrite(ledPin, HIGH);
}
if ((millis() - lastTime) > timerDelay) {
if (micStatus == 0) {
myData.isRinging = false;
digitalWrite(ledPin, LOW);
}
if (micStatus == 1) {
myData.isRinging = true;
micStatus = 0;
}
// Send message via ESP-NOW
esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));
lastTime = millis();
}
}
// REPLACE WITH RECEIVER MAC Address (example 34:94:54:8E:13:20)
uint8_t broadcastAddress[] = {0x34, 0x94, 0x54, 0x8E, 0x13, 0x20};
This is where to insert the MAC address into the code.
The code for the receiver board is the following, and can be uploaded without modifications.
#include <ESP8266WiFi.h>
#include <espnow.h>
// Structure example to receive data
// Must match the sender structure
typedef struct struct_message {
bool isRinging;
} struct_message;
// Create a struct_message called myData
struct_message myData;
const int led1 = 12; // LEDs from the top to the bottom of the device
const int led2 = 14;
const int led3 = 0;
const int led4 = 4;
const int statusLed = 13;
const int buzzer = 5;
const long buzzerTime = 200 ;
long timeFromLastUpdate = 0;
unsigned long previousMillis = 0;
const long interval = 500;
bool produceSound = false;
bool produceLight = false;
bool flag = false;
bool previousFlag = false;
bool hasIncremented = false;
int numberOfBlinks = 10;
// Callback function that will be executed when data is received
void OnDataRecv(uint8_t * mac, uint8_t *incomingData, uint8_t len) {
memcpy(&myData, incomingData, sizeof(myData));
Serial.println("Data received!");
if (myData.isRinging == false) {
produceSound = false;
digitalWrite(statusLed, LOW);
timeFromLastUpdate = millis();
}
if (myData.isRinging == true) {
digitalWrite(statusLed, LOW);
timeFromLastUpdate = millis();
//produceSound = true;
//produceLight = true;
//numberOfBlinks = 0;
}
}
void setup() {
// Set LED and ring pin as output
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(statusLed, OUTPUT);
pinMode(buzzer, OUTPUT);
// Initialize Serial Monitor
Serial.begin(74880);
// Set device as a Wi-Fi Station
WiFi.mode(WIFI_STA);
// Init ESP-NOW
if (esp_now_init() != 0) {
Serial.println("Error initializing ESP-NOW");
return;
}
// Once ESPNow is successfully Init, we will register for recv CB to
// get recv packer info
esp_now_set_self_role(ESP_NOW_ROLE_SLAVE);
esp_now_register_recv_cb(OnDataRecv);
}
void loop() {
unsigned long currentMillis = millis();
if ((timeFromLastUpdate + 10000) < millis()) {
digitalWrite(statusLed, HIGH);
}
if (currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
flag = !flag;
}
callRoutine();
blinkLeds();
soundBuzzer();
}
void blinkLeds() {
if (flag == true && (produceLight == true || numberOfBlinks <= 5) && hasIncremented == false) {
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
numberOfBlinks++;
hasIncremented = true;
produceLight = false;
Serial.print("on ");
Serial.println(numberOfBlinks);
}
if (flag == false) {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
Serial.println("off");
hasIncremented = false;
}
}
void soundBuzzer() {
if (flag == true && produceSound == true) {
digitalWrite(buzzer, HIGH);
produceSound = false;
}
if (flag == false) {
digitalWrite(buzzer, LOW);
}
}
void callRoutine() {
if (myData.isRinging == true && previousFlag != flag) {
produceSound = true;
produceLight = true;
numberOfBlinks = 0;
}
else {
previousFlag = flag;
}
}
Of course the code can be modified to meet your needs.
3D Printing the Box
After uploading the code on the tow boards, I started designing the two enclosures for both the board that will be near the phone and the one that will be in the other room using Fusion 360. Figuring out the shape to give the two boxes was not an easy task, as they had to integrate well in the room. When the design was complete, I 3D printed the two enclosures, the supports for the LEDs and the lids using white PLA.
The 3D files for the parts can be downloaded from below, ready to be sliced and printed.
Once the two boxes were 3D printed, I inserted 4 threaded inserts in the holes of each box, using a soldering iron set to 230°C to gently push them in the plastic.
Ringer Board
The wireless ringer will have 4 red LEDs in front to indicate when the phone rings and a green one to indicate that the connection is active, as well as a very loud buzzer on the back. To make the connections, I soldered the ESP8266 board onto a piece of perfboard, using the jumper headers included. Then I routed the pins for the LEDs and buzzer to some jumper connectors on the board, following the wiring diagram that you can find below. When I was building the circuit I forgot to add the resistors for the LEDs on the board, so I had to add them later near the LEDs, although I suggest to put them on the board, as the circuit becomes much neater.
Downloads
Ringer LEDs
I inserted the LEDs in the 3D printed support, and soldered together the negatives of them. On the positive of each LED I put a resistor to limit the current, and after the resistor I connected a piece of wire. If you put the resistors on the board, as I suggest, you will need to connect only the piece of wire to the positive of the LEDs, without the resistors. Then I soldered the common negative and positive of each LED to the jumper connectors I put on the perfboard earlier, which go to the ESP8266 pins. When you do this, be sure to follow the schematic to not invert the pins. To prevent short circuits, I put a heat-shrinking tube on each connection.
Closing the Ringer Box
I put the buzzer in the back panel, along with a switch to turn it off, leaving only the LEDs as a signal for when the phone is ringing. The positive of the buzzer is connected to one pin of the switch. From the back panel come two wires, one from the other pin of the switch and the other one from the negative of the buzzer, which I connected to the two remaining pins on the perfboard.
Now we can mount the circuit in the box. First, I mounted the LED holder with the LEDs with hot glue. Then I glued the board as well, putting a piece of plastic underneath to make the USB port align with the hole on the lid. I closed the lid with M3 bolts screwed into the threaded inserts, and we can say that the ringer is finished. To power the ringer I will use a 1A USB power supply with a micro-USB cable.
Detecting When the Phone Rings
At this point I took care of the part that detects when the phone rings. To detect when the phone rings, I used a sound sensor module made for Arduino, that has a small microphone on it. On the pins are connections for power and a digital output, which is activated when the noise the microphone hears is greater than a certain threshold, which we set with the potentiometer. This microphone will be placed near the base of the phone, which has a ringer inside, so it will trigger the additional ringer when there is a call.
Sound Sensor Electronics
The outer box that will contain the transmitter ESP8266 board connected to the microphone will be the same as the ringer box, but at the back it will have a connector to connect the microphone and at the front it will only have an LED, to indicate when a sound is detected.
So I soldered the other ESP8266 onto a perfboard, and I routed the pins of the ESP8266 needed for the microphone module and the LED to some jumper connectors. This time I put the resistor for the LED onto the board, so I connected two wires directly between the two pins of a red LED and the two corresponding jumpers on the board.
Then I soldered a 3-pin JST connector on a small piece of perfboard, to which I connected three wires for 3,3v, GND and the digital signal of the microphone module. These three wires go to the corresponding pins on the board.
Sound Sensor Box
As I said before, the box for the board connected to the sound sensor is exactly like the one for the ringer, to give continuity to the design. Also this time I glued the LED in the LED support, and glued the support to the box. Then I glued the JST connector in the hole of the back panel of the box. As with the ringer, I glued the board inside the box with a piece of plastic underneath, to make the USB port align with the hole on the panel. As a last thing I closed the lid with M3 bolts screwed into the threaded inserts, and we can say that also the sound sensor is finished.
To connect the microphone module to it I used a JST to jumper cable, with the JST connector plugged into the box we just made and the jumper connector plugged into GND, positive and digital output of the microphone module.
Installing
After some testing, I brought the system to the home of the person I made the project for. There I fixed the microphone module with double-sided tape on the base of the phone, that has a ringer inside. The box with the ESP8266 was put next to the phone, connected to the USB power supply.
The ringer itself was put in another room, below the TV, so that when she is watching TV at a high volume she can see the LEDs flashing when there is an incoming call.
Finished!
This project has already been in use for more than a week now, and it's been working really well. I hope you enjoyed this guide as much as I enjoyed making a project to help someone, and if you want to see more details, watch the video on my channel (it has English subtitles). Bye!