I am interested in building a means of mapping a room using an Arduino, ultrasonic distance readings (HC-04), and Matlab software. I found all kinds of projects on the net to do this, but all of them are connected directly to the computer via USB.
My question is whether I can do this wirelessly by using the HC-05 bluetooth module that will transmit information to the computer, and there I will do the data analysis of the ultrasound readings using Matlab. What is the type of information that the module is able to transmit, and can this information suit me for a mapping program that can work with Matlab?
Can I send a distance reading? For example, in the way of rotating the ultrasonic on a servo motor, transmit the readings in such a way that they are saved in a certain file, and let this file be processed by Matlab into a drawing? (I still don't know exactly how to do it, but I want to ask in principle if it's possible at all.)
If the distance is a integer and always less that 256 you could send a single byte holding the value.
Alternatively you could "print" a value to the HC-04 and send it as a series of ASCII coded characters
Either way you would need to receive and interpret the data. You would be wise to use a start and end character in your data message so that the messages can be kept in step because serial communication is not always reliable
Wireless serial acts like any other serial, so on the PC, use a terminal program like PuTTY or Teraterm to log the data to a file. As mentioned above, wireless serial is less reliable than wired, so some check of message integrity is advised.
Are programs such as PUTTY or Coolterm able to connect to Bluetooth or an application that receives input from Bluetooth? From what I have seen and understand, these programs are able to create a text file (or Excel) from a USB connection to one of the ports.. I don't quite understand how it interfaces with Bluetooth. I would appreciate an explanation