How to connect your arduino project by bluetooth to synchronize with other devices? Step by step guide

Bluetooth is part of the wireless personal area networks ( WPAN ), the purpose of which is to promote the transmission of data and voice from different devices through a radio frequency link in the 2.4 GHZ ISM band. This has made this tool one of the best alternatives when carrying out an Arduino project .

Generally, devices that incorporate this technology have the ability to communicate with each other when they are within range . These communications are executed by radio frequency so that the devices do not have to be aligned, they can even be in separate places as long as they are within the range of the connection.

In this way, this technology has been used by electronics and programmers to use it in different projects with Arduino, since this allows increasing the possibilities when wanting that project carry out some type of activity in the physical world. Here we are going to show you how you can connect your Arduino project by Bluetooth to synchronize it with other devices, for this, follow in detail everything that we will teach you next in the post.

What are the benefits of using Bluetooth connections with Arduino?

Without a doubt, being able to use this type of connections in your Arduino projects will provide you with certain benefits, mainly because it offers you many more possibilities when creating and programming .

This is how here we are going to show you what are the main benefits that all this brings you:

  • Facilitates communications between mobile computers.
  • It allows you to design electronic projects that you will be able to control with your mobile device.
  • Eliminate any type of cable connection and connectors .
  • It allows you to create small wireless networks and facilitate data synchronization between personal computers.
  • It becomes an extra option for Arduino programmers and project developers .
  • Bluetooth is integrated into all technological devices today, so it will allow you to connect your Arduino project   with any technological device that you have at your fingertips.

Bluetooth connection modules Which are the best that we can use?

One of the advantages of being able to work with Arduino is that it offers the possibility of creating connections with other devices without cables, for this it offers the possibility of doing it through Bluetooth modules, this will allow you to incorporate them in each of your projects electronics and robotics and thus achieve better results. This is how then we are going to show you which are the best Bluetooth connection modules   that you can start using on the Arduino platform.

To do this, follow the list that we will show you below:

HC-05 and HC-06 module

Both are Bluetooth modules that can be used to communicate different Arduino projects with this wireless connection, in fact they are the two most used modules for this type of activity. Currently, most users think that this type of connection is an outdated technology, but the truth of all this is that through it a host of very important activities and actions can be developed.

It must be taken into account that in the case of the HC-06 module it behaves as a slave, that is, it constantly waits for connection requests. Therefore, if any device is connected, the HC-06 module transmits to it all the data it receives from the Arduino and vice versa . When you physically see the HC-06 module, you can tell that it is quite similar to the others available on the market.

It should also be mentioned that the HC-06 works as Slave and the HC-05 as Master and Slave, in this case the HC-05 has a total of 6 pins, while the HC-06 has a total of 4 pins .

Bluefruit EZ-Key Module

Bluefruit EZ-Key is used to create what are wireless keyboard controllers , this is how this module is considered fast enough and easy to handle. So this Bluetooth controller works great with any BT-compatible device, be it Mac, Linux, Windows, Android, or iOS.

It also has a total of 12 input pins, pressing one of its buttons will automatically send a keystroke to the computer . In this way, Bluefruit EZ-Key has become an ideal option for all those Arduino projects where you need a keyboard.

Learn step by step how to connect your Arduino project with Bluetooth and synchronize it with other devices

Bearing in mind all the aforementioned in the post, the next thing will be to learn how to connect your Arduino project with Bluetooth and synchronize it with other devices, this will allow you to load your programs to your board without the need to use cables or connectors for it . This type of technology is ideal for those programs where the Arduino is required to be far from your reach or must be operated with a control or mobile device .

In accordance with all this, below we will show you how to carry out this procedure in an easy and fast way:

Necessary materials

For this procedure, the HC-05 Bluetooth module will be used , since this module is sold with a PCB that offers the “Status” pin , it is a pin that allows it to be configured to change to a low state when the connection is opened. to the Bluetooth serial port, which provides that the reset is activated and thus start the operation of the arduino bootloader .

In accordance with this, here are the materials that you will need to have to carry out this procedure:

  • HC-05 Bluetooth module .
  • Arduino Uno R3 .

HC-05 Module Configuration for Wireless Arduino Programming via Bluetooth

You must bear in mind that before this module begins to function as an Arduino programmer, you must configure it so that it behaves as you want.

For this it is important that the HC-05 has the following adjusted parameters:

  • For Arduino Uno with Optiboot: UART set to 115200 baud, 8 bits, 1 stop bits, no stop.
  • For Arduino Duemilanove / Diecimila: UART set to 56700 baud, 8 bits, 1 stop bits, no stop.
  • Sets the polarity of the pin state for proper polarity.

Commands to configure the HC-05 module

It is also important that you take into account a series of very important commands to configure in the HC-05, which we will show you below:

  • AT + ORGL
  • AT + Role = 0
  • AT + POLAR = 1.0
  • AT + UART = 115200,0,0,0
  • AT + INIT

Now line by line you must do the following steps for its configuration:

  • The first thing will be to restore the factory settings .
  • Now you must configure it in slave mode, for this it establishes a transparent serial bridge from the PC.
  • Set the polarity of pin 32 labeled State on the HC-05 module, so that it goes low when the device is connected to the module.
  • The next thing will be to make the baudrate match the speed of the bootloader.
  • Finally, you must exit the configuration mode and start the normal operation of the HC-05 module .

Assembling the circuit for Arduino programming via Bluetooth

At this point it will be necessary to connect the TX and RX pins of the Bluetooth to the RX and TX pins of the Arduino respectively, keep in mind that these are crossed. In the case of the Status pin of the Bluetooth, it will function as a reset and must be connected to the reset pin of the Arduino through a 100 nF ceramic capacitor. In this case, the resistors shown in the circuit are to reduce the voltage of the TX pin (5 volts output) of the Arduino to something close to 3.3 Volts, this being the most logical level that the Bluetooth module supports  .

In this case, the connections should be as seen in the following image:

  • When the circuit is already armed, it can be seen as follows on a breadboard.

  • After this, the hardware is ready to try to carry out the Arduino programming by Bluetooth .

Arduino Wireless Programming via Bluetooth

When you have the module configured and the circuit assembled, the next thing will be to wirelessly program the Arduino via Bluetooth . At this point it will be assumed that the HC-05 module has already been paired with the computer .

So you will have to carry out the pairing process and in the same way there is a serial port over Bluetooth where it is shown correctly in the device manager. The procedure to be able to pair a Bluetooth device will vary depending on the operating system. You should also check the Windows device manager.

There the virtual serial ports must be correctly displayed as can be seen in the image that we present below:

  • The next thing will be to open the Arduino IDE and there you must select the new serial port that was created when the HC-05 was paired with the computer.

  • Now we must open the Blink Sketch that is located in the examples folder and we click on the “Upload” button so that the download of the program to the Arduino board is automatically executed .

The upload of the program should proceed normally until the execution of the code loaded on the Arduino begins . Now, if an error arises, it may be because a bad signal has been connected or that the polarity of the state pin was not done correctly in the configuration .

If for some reason the sketch cannot be recorded on the Arduino, then it will be necessary to experiment with the value of the capacitor, a very good idea for this is to increase its value until ensuring that the Arduino is reset correctly when opening the serial port on Bluetooth, in this case the recommended values ​​are 100 nF to 1 uF .

The best Arduino projects with wireless connection via Bluetooth that you can do on your own

As has been mentioned, Bluetooth connections have become one of the best tools when carrying out certain types of Arduino projects, especially those that we want to manage or control from a distance . That is why here we are going to show you the best Arduino projects with a wireless connection that you can do on your own.

To do this, follow in detail the list that we will show you below:

Universal remote

Surely your control of the television or sound equipment has been damaged and now you have no way to control it, for this you can start creating a universal remote by combining Arduino technologies with that of the wireless connection. This is how this project can be created through a Bluetooth or USB connection, for this you simply have to have a 3D printer and print the case, add the buttons and a joystick  and voila, you can start to have control again.

BB8 life size

This project has been considered one of the most popular in robotics, it consists of using simple roll-on deodorants for what will be the base of the BB8, as well as other recycled materials that you will surely have at home.

For its operation, it will be necessary to have an Arduino board and Bluetooth connectivity, so you have the luxury of being able to control it from your own smartphone . Without a doubt, it has become a very motivating project due to all the use that can be made of recyclable materials that can be had at home without giving it any type of use.

Smart fridge

If you are one of the people who has a rolling refrigerator to use for field trips or for your trips and thus be able to load your drinks and other food, then you can start to give it life so that she can walk by herself wherever she wants that you go, this will avoid having to be charging it on your own.

To do this you simply need an Arduino board, a Bluetooth connection, a smartphone and a rolling cellar or refrigerator. When programming all this and turning it into a smart wine cellar, you can control it through your smartphone through the Bluetooth connection, in this way it will follow you wherever you go.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button