Mechatronics Exercises

Workspace Navigation

Bluetooth background communication based actuating system

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  1. Aim of the project
    The aim of our project is to create a device which utilises mobile background communication protocols (Bluetooth Low Energy, Wi-Fi) , bluetooth in our case, for device identification and data collection. Depending on the detected device our receiver might then be told to do various actions. For example, when a specific device is identified in the module’s receiving range, an actuator can be employed to turn on a light. This kind of device can be derived for a wide variety of applications. The key is that you don't have to be paired with the bluetooth module in order to it detecting you, you can just keep your phone in your pocket, enter the bluetooth modules range, and the module will detect your phone.

  2. First steps and materials 

    This project will be done using a mobile phone and an Arduino, in which a HC-05 Bluetooth module is connected. At first, our goal is to examine which kind of signals we are able to detect with the module without having to pair the two devices. Our desired result is to inconspicuously automate the identification. Once the identification of devices is successful, we can further develop the system for different operations.

                                                                         HC-05 Bluetooth module

    List of required parts for the project:

    • Arduino Uno
    • HC-05 Bluetooth module (Our module is the version 3.0), Datasheet
    • Voltage divider for the BT-module (resistors).
    • Mobile phone (The bluetooth protocols differ a bit between different phones/operating systems).

                           Voltage divider for the HC-05 module

  3. Schedule

    The project was started on week number 9 by gathering information on existing devices. By week number 11 the device is functioning and we are able to identify different mobile devices based on their background communication data.
    Next step is to deploy the device for different actions.

                                          Device ready to use

                                                                Data gathered by the system

  4. Challenges

    One of the main challenges is the restrictions in the background communication data of mobile devices. Bluetooth Low-Energy is a fairly new technology and the availability of BLE-beacons might be limited.

  5. Further development

    The device can be harnessed for an extensive amount of applications. BLE-beacons could be spread out to gather live data of the amount of people (with bluetooth capable mobile phones) there are in the range of the beacons. This kind of proximity sensing could be useful if one might want to restrict the amount of people in specific premises. Next step could be to utilize the bluetooth signal strength data we get from the device, or to use Wi-Fi signals to identify devices in the same manner as with BLE. 

  6. Implementation

    1. Connect the HC-05 bluetooth module to the Arduino board using a appropriate voltage divider, which in this case was made with 4700 and 10 000 ohm resistors. The HC-05 module is connected to the arduino by following:
      1. TX to arduino TX.
      2. RX to arduino RX.
      3. VCC to arduino 5V output through voltage divider.
      4. GND to  to arduino GND.
      5. Key pin unconnected (will be connected later). 
    2. Apply the code. 
    3. With the HC-05 module (version 3.0) that we used, the procedure to gain access to full AT-mode, and thus to the features that we needed, is following:
      1. Power up the module with the key pin disconnected.  The LED in the module will flash quickly.  
      2. Push and hold the tiny button which is located in the bottom of the HC-05 module, and while holding the button, connect the Key pin of the HC-05 module to arduino 5V. When the key pin is connected, you can release the button. The led on the HC-05 module should now be on continuously. We are in full AT-mode.
      3. The module starts to search for devices in its range (since we've told it to do so in the code), and will list their bluetooth addresses. The list can be monitored via serial monitor. 
      4. In the code you can decide which bluetooth addresses (ie. which devices) will trigger different actions. We chose to light up a led, which is connected to the PIN 13 of arduino, but you can connect basically anything to the pin of your choice, and with just adding the pin output to the code you can actuate pretty much anything. When the device leaves the range of the bluetooth module, the pin output will turn off, and in our case the led is turned off. In our code, the LED was triggered by Aleksi's phone (BT address 9809:CF:68C85A).

The serial monitor should look like in the following picture, 4851:B7:209607 and D004:1:63AEB4 being bluetooth addresses of two different devices.               

7Useful links

HC-05 Datasheet:

HC-05 Bluetooth device inquiry:

HC-05 Troubleshooting:

8. Code

#include <SoftwareSerial.h>