NETWORKING AND COMUNICATION

WEEK 15

 - Design and build a wired &/or wireless network connecting at least two processors

For this task, I decided to research and explore Bluetooth technology. Bluetooth is a wireless personal area network (WPAN) that allows the transmission of voice and data between different devices. For my network, I used two Bluetooth modules. To start, it is important to know that there are two types of Bluetooth modules, master and slave. The slave function as receiver and only connects to one master, the master however functions as an emitter and can be connected to many slaves.

When we review the modules, we can see that there are two types, HC-05 and HC-06. HC-05 is a module that has six pins and can be configured as master and slave. While the HC-06 is a module that has only four pins and can be configured only as a slave.

In order to program the network, it was necessary to program two modules, one as master and the other as slave, I programmed two HC-5 modules. You can use Arduino IDE to program both. To program master and slave, I used the same code, since the real configuration is on AT mode.

I defined the programming of the modules, both "master" and "slave" as the same, however I must say, I used only three digital pins in addition to VCC and GND. Pins 10 and 11, for RXD and TXD, an for the key pin number 9.

ARDUINO FILES MASTER

To set up the AT master I used two tutorial. The first one was good but I was not able to connect both modules from different microcontrollers. I learned some usefull comands. To send any command I will write AT + command. AT + PSWD, tell me the pasword to connect to the other module. AT + UART, tell me the speed of the Bluetooth. AT + ROLE = 1 tell me that this module is set as mater. If I make the question AT + ROLE? I can check the configuration mode. AT + CMODE = 1 allows me to connect to any available address. If I make the question AT + CMODE? Tell me that the configuration mode is 1. AT + VERSION? tell me the version number of the Bluetooth module.

The following table details the steps to be followed to configure the master module in AT.

To set up the slave I used the same two tutorials. The other module must be set: AT + ROLE = 0. To name the new device we should type the command AT + NAME = SLAVE, so that I can recognize by the name wich one is the device.  Just like the master configuration, I ask AT + PSWD? to know the slave password. This password can be changed by typing AT + PSWD = "desired number".

Finally I managed to connect both modules. At the time they were already linked, everything that was written on the serial port of one machine would automatically appear on the serial port of the other.

xmottex@gmail.com