Project with the objective of sending and receiving files on a computer, via Bluetooth, from an SD card connected to an Arduino, using Arduino UNO, Visual Basic, Sdcard Module, serial communication and SPI protocol.
Arduino code (C++)
Form Design Code (Visual Basic)
Form code (Visual Basic)
This project is divided into two parts: the Visual Basic program and the Arduino program. The Visual Basic program, through serial communication, is responsible for allowing the user to connect with the HC-05 bluetooth module that is connected to the Arduino serial, enabling wireless communication between the computer and the Arduino. After that, the user chooses whether to send or receive a file from the SDcard and Visual Basic handles the communication with the Arduino to inform what the user wants, in response, the Arduino with the SDcard module that uses the SPI protocol, accesses the card SD and reads or saves a file to it, also allowing the user to see which files exist in the root of the sdcard, in case he chooses to receive a file.
Load the program into the Arduino in the BluetoothDataFile_ArduinoBluetoothDataFile_Arduino.ino folder and open the Visual Basic application in the BluetoothDataFile_VisualBasic2010BluetoothDataFilebinDebugBluetoothDataFile.exe folder, once opened click on the "update serial" button, select COM from the combo box where the bluetooth module is paired and click "connect to serial". With this, simply choose between receiving or sending a file to the SD card.
Receive file: To receive a file click on the "receive file" button and wait for the blank box below the button to show the file options that can be received from the root of the SD, choose a file by double clicking on its name, after that A message will appear asking if you really want to receive that file, click "yes" and select a location to save it in the new window that has opened, now just wait for the reception to complete, monitoring the progress bar and waiting for the confirmation message. transfer completion.
Send file: To send a file, click on the file search button next to the text box on the form, select the file you want to send and click on the "send" button, after that just wait for the progress bar to reach the end and the sending completion message appears.
Note: The name of the files that will be received and sent must have a maximum of 8 characters and an additional 3 characters for the extension, otherwise the transfer will not be successful.
Click on the image above to see a video on how to use the program
One of the bugs that can occur is that when receiving the file, data is lost, which will result in Visual Basic being unable to complete the transfer and it will not be successful, in addition, the speeds of sending and receiving files are considerably slow. (The baud rate of the serial COM is 38400bps, due to data loss at higher speeds), especially the sending speed, this is due to limitations in the hardware of the bluetooth module, the Arduino serial and the libraries that are being used in the Arduino program.