In this project I'm making an arduino communicate with my laptop wirelessly via bluetooth. I'm using hc-05 module for this. I've successfully paired the two devices. If the arduino receives a data then it will send back 5 to the laptop else 0. I've uploaded the following code to the arduino using the com port connected to uno.
then i changed the port to COM8(The port that hc-05 is using) and opened the serial monitor and when I inputted some integer and sent it, I got the following result(in the attachment)
When you paired the laptop to the HC-05, the laptop allocated COM 8 for future comms use with the HC-05. (It will allocate two COM ports, so (8 & 9) or (7 & eight)). If you unpair the two, the COM 8 reference will disappear. Make use of Windows Device Manager.
Simply changing the port to COM 8 in the IDE does not connect the IDE to the HC-05. It's just not designed to work that way.
To make the bluetooth communication work, you have to run a program on the laptop that can connect to the HC-05 (so long as you have previously paired the two, which you have).
Install "Bluetooth Serial Terminal" program on the laptop (assuming it's a Windows machine). Explore. The Arduino sketch will need to use software serial to connect with the HC-05.
You'll need to follow some of the several good tutorials on bluetooth to master it all. It's not hard, but understanding the basics is essential.
There's another forum discussion where someone was attempting to do the same thing.
Ok , can you explain how the serial monitor sends data to the bluetooth and does the serial monitor convert the bits into user readable data before displaying on the monitor? I found some tutorials where they used puTTY to connect the two.
The serial monitor cannot send data to bluetooth, only to Arduino via the USB cable. Use a proper terminal programme like Realterm which can talk to the port the laptop Bluetooth is on. RealTerm is a freebie, there are others, they are all much the same, including puTTY It is not necessary to use software serial, indeed it is not a great idea either. I imagine you already know that you need to disconnect Bluetooth in order to upload your programme.