📜 ⬆️ ⬇️

Bluetooth charm on everything ready

Introduction


Hello, reader. This article is written to share a simple, but useful life hacking, which I recently put into trial operation.

It was necessary to solve the following problem. For a very elderly relative who does not accept cell phones (especially smartphones), we had to make a wearable emergency call button, which can be used to notify relatives, for example, that she fell within the apartment, moving on walkers, and cannot get up / get to the phone (actually, from such a case the task arose).


')
Looking ahead, I’ll say that the result was a broader solution that can be used to quickly and imperceptibly inform someone that something has happened without getting a cell phone. And all this without "one more device that needs to be charged."

The phrase “on everything finished” implies that all the iron can be found at almost no additional cost. Your applications do not need to write. Programming - graphically, soldering - at will. In short, everything is simple.

Idea


Despite the fact that the market is saturated with devices suitable for solving urgent notification tasks, all of them, from children's watch-trackers to various BLE-buttons, have a significant drawback: I forgot to charge / change the battery in time - goodbye is the main function. At the same time, the functional of the clock is obviously redundant, and the control is complicated.

BLE buttons have a clear advantage - one button, and it lives for several months on a single CR2032 battery. Actually, while choosing which button to order, everything was invented, and the need for the order disappeared.

And the following simple idea was invented: a bluetooth emergency communication device is not only not necessary, but even harmful to be included in “peacetime”. Let the alarm be the fact of switching on and connecting the device to the smartphone. Thus, the device is always ready to perform its, albeit infrequent, but extremely important function (with a working smartphone with bluetooth). And it turns out, theoretically, it doesn't even matter what kind of device it is. We found a Bluetooth connection with a given device — we launched an emergency notification process. However, the choice of a headset bluetooth device allows you to add useful features to the main functionality.

Implementation


Thus, the emergency intra-room alert system can be launched on an Android smartphone in an almost arbitrary state (as long as the bluetooth and cellular communications are working), which is always on charge in the central room, where it reaches the bluetooth from all over the apartment.

As a bluetooth device used ear from broken bluetooth headphones. The battery from the second ear safely climbed into the first. He attached a lace to his neck - it turned out to be a charm.

image

As usual, I forgot to take a picture of the final result.

The software is a wonderful Automate application that allows you to algorithmize and automate various processes using the capabilities of a smartphone. I have long wanted to try, but there was no time or chance. What can I say - very cool. Immediately a lot of ideas arise, what else can be done.

Two processes are written for Automate (“flow” in the terminology of the application) “Bluetooth connection alert” - for alert and “Auto answer” for receiving incoming calls:



The scripts look very simple, the blocks are configured intuitively, the program has help on the functions and configuration of the blocks.

Some text under the spoiler
Scenario 1) Sending SMS according to the list of numbers when connected to a given bluetooth device and the subsequent call to the specified phone number. At the start, an array of alert number strings ["+ 7number1", "+7number2" ...] is configured, then a device connection test unit Bluetooth configured to the specified device mac address.

The MAC address of the headset for configuring the Device Connect block can be found using a program like Bluetooth Device Info.

After the connection - the SMS sending cycle by the array numbers, the call to the specified number and the waiting cycle of disconnecting the Bluetooth device to switch to the new waiting state.

Scenario 2) Auto answer a call from any number from the list - it works regardless of the alarm condition.

The Incoming Call block returns the string number entry argument, which is then checked for membership in the specified array of numbers. If a number is found in the array, the call is automatically accepted.

Automate is configured to start when the phone boots, and at startup, the scripts that were last launched are launched. Restrictions of the free version (limit of simultaneous streams, limit on sending SMS, etc.) do not interfere with the normal operation of the emergency notification system.

I note that the auto answer block (Automate also warns about this) may not work on all phones. For example, on the old Fly iQ411 (Android 4.3) on which the alert system was launched, the auto answer works, on the test LG G4 (Android 6) it does not.

What is the result:


In the event of an accident, just hold down the device button for a few seconds before turning it on. Detecting the connection of the Bluetooth device with the specified address, the smartphone sends alerts and dials the number. At the same time, since the device is a headset, the sound goes through it, and its microphone works, which allows the one whose number is dialed to hear what is happening, and the caller is able to communicate with him, putting a “guard” on his ear. If the number did not answer, then when any trustee calls, the phone will automatically receive the call, again through the headset.

If you connect speakers to the phone, you can call and call a relative through hands-free auto answer in “peacetime” when the bluetooth device is not activated and the sound is played through the speakers.

Ways of development:


Lists of numbers that are specified as an array of strings can potentially be read from the address book, filtering by certain marks (such as the “SOS” tag in the notes). This will take the configuration of the numbers from the Automate application and allow you to use the same universal script on different phones.

With regard to the mobile use of the amulet as a child, you can run GPS, read and send GPS coordinates of the incident, initiate the process of periodically sending new coordinates when moving.

With regard to mobile use, of course, it makes sense to make an auto answer conditional - so that it only works in the alarm state.

For older relatives, you can add the Automate script to remotely turn off the headset bluetooth after it is accidentally turned on so that the battery does not sit down: Sending a special command via SMS disables the bluetooth on the phone for a few minutes → The headset, having lost the phone, disconnects itself.

That's all. Maybe someone will come in handy.

Source: https://habr.com/ru/post/401003/


All Articles