Page 1 of 1

PIC TO PIC USING BLUETOOTH

Posted: Sat Oct 08, 2022 8:12 pm
by siliconchip
Hi,
is it possible to transmit a square wave from one pic micro to another using bluetooth such as the HC-05 bluetooth module, ??

cheers bob

Re: PIC TO PIC USING BLUETOOTH

Posted: Sun Oct 09, 2022 11:37 am
by Steve
The short answer is yes.

We have a full course on this here which you can find in the resource tab on that page.

Re: PIC TO PIC USING BLUETOOTH

Posted: Sun Oct 09, 2022 12:57 pm
by siliconchip
hi steve,
thanks for the reply, i just looked at the course and got lost lol ive no experience with bluetooth i was hoping there may have been something on the site that someone had already done so i could disect it at will to try to get a grip on it i realsie i wont learn anything in 5 mins but would prefer this method if available

cheers bob

Re: PIC TO PIC USING BLUETOOTH

Posted: Sun Oct 09, 2022 2:45 pm
by Bachman
Bluetooth is for data transfer, see Wikipedia: https://en.wikipedia.org/wiki/Bluetooth

You can't use it to transfer pure square wave. HC-05 bluetooth module is an UART - Bluetooth module. You can use it to send (and receive) data from a device to another.

Re: PIC TO PIC USING BLUETOOTH

Posted: Sun Oct 09, 2022 4:00 pm
by chipfryer27
Hi

I don't know your intended application however as per Steve's reply it could be done if you really, really wanted to, but as Bachman points out the UART isn't suited to "sending waves" so you would most likely need to transmit the wave component values for reconstruction at the far end. If you were going to do that, why not just get the Rx PIC to generate the wave in the first place, perhaps being controlled (on/off/duty/etc) by the Tx PIC via the UART?

There is an example of using the module to send data on the WiKi

https://www.flowcode.co.uk/wiki/index.p ... (Wireless)

Hope this is of help.

Regards

Re: PIC TO PIC USING BLUETOOTH

Posted: Sun Oct 09, 2022 6:35 pm
by siliconchip
hi bachman and chipfryer
thanks for the replys sorry i wasnt specific in my description but yes chipfryer i agree about the RX pic being programmed for the wave generator but being initialised by the TX pic i just need to try to construct a working model now as i say ive never touched blue tooth so its a learning curve

cheers bob

Re: PIC TO PIC USING BLUETOOTH

Posted: Sun Oct 09, 2022 8:29 pm
by chipfryer27
Hi

That sounds reasonably straight forward.

I'd look at the wiki example of how to send data via BT and once you are comfortable with that then move on. I'm sure if you get stuck with anything the forum will give good advice.

If using the UART you might also want to look at the Circular Buffer examples too. A very handy component indeed.

Not really what you are after, but on the WiKi there is also an example of PWM using an analogue pot to vary the duty cycle. You could modify that so that instead of reading a value from the pot, it receives it via the BT. That could be a nice project to get started with especially as you are only modifying "working" examples to get the concept correct. Of course you could just send a command via BT to switch a LED on/off too :)

Hope this helps and keep us updated with progress.

Regards

Re: PIC TO PIC USING BLUETOOTH

Posted: Mon Dec 05, 2022 9:30 pm
by siliconchip
hi all

having clicked on the wiki link above there is only one flowchart when sending data via a keypad to the LCD, am i right in thinking that this flowchart is for the transmitting microcontroller as well as the receiving controller ?? with the transmitting HC05 set as master and the receiving HC05 set up as the slave ?? pardon my ignorance but I'm having trouble grasping this cheers in advance

bob