Networking and Communications
For this assigment, we have to:
- (DONE) Design and build a wired &/or wireless network connecting at least two processors.
All the files created for this assigment can be found on the link bellow:
---> DOWNLOAD FILES<---
Have you:
- Described your design and fabrication process using words/images/screenshots.
--> yes
- Explained the programming process/es you used?
--> yes
- Outlined problems and how you fixed them?
--> yes
- Included original design files and code?
--> yes
Bluetooth Communication
Bluetooth communication is a wireless technology for exchanging data over short distances.
For establishing a communication via bluetooth betweeen two devices, a bluetooth socket needs to be created. One of the devices should act as a server, this means that it should create the bluetooth socket and wait for incomming connections. And the other device should act as a client, this means that it should detect the bluetooth devices which act as servers. For pairing the client device with the server device, the client has to provide a pin number (a password) to the server and the server accepts the connection if the pin number is correct.
All of this process can be done with the HC05 Bluetooth module, which is a module that can act as a client, if it is configured as Master, or act as a server if it is configured as Slave. This Module is configured by serial comunication in Hayes commands (AT commands)
Configuring the Slave Module
For configuring the Slave Module, I used an Arduino uno and the Software Serial Library. So that, I could program the module by the virtual UART and read on the computer the messages sent by the module by printing them on the Physical UART.
For configuring the bluetooth module in slave mode I did the next steps:
1. I conected the TX and RX pins of the module on the pin 4 and 5 of the arduino.
2. Then, on the Arduino IDE, I started programming by including the software serial library, creating a virtual UART port on the pins 4 and 5, and defining a global variable that contains the messages sent by the HC05 Module



6. So, I read the module response and printed it on the physical UART with the function readvcsp.





12. Finally, I uploaded the program to the arduino by clicking on upload.
Configuring the Master Module
For configuring the Master Module, I used an Arduino uno and the Software Serial Library.
For configuring the bluetooth module in master mode I did the next steps:
1. I conected the TX and RX pins of the module on the pin 4 and 5 of the arduino.
2. Then, on the Arduino IDE, I started programming by including the software serial library, creating a virtual UART port on the pins 4 and 5, and defining a global variable that contains the messages sent by the HC05 Module

4. On the void setup, I defined the baud rate of serial commnunitacion for the virtual UART (pins 4 and 5) and the physisical UART (pins 0 and 1)







13. finally, I uploaded the program to the arduino by clicking on upload.
Testing the bluetooth connection
For my 13th assigment I did a wired communication between my input device board and an Arduino for controling a servo motor. So the idea for this assigment was to do it wirelessly.
So, with the aid of a protoboard I connected the slave module to the input device board, the Master module to the arduino and suplied voltage to all the boards and devices.
Then, I connected the arduion to the PC and uploaded the code for moving the motor on the arduino.
This is the final result.