Communication using a Bluetooth module


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2011
    Location
    Bangalore, India
    Posts
    33

    Default Communication using a Bluetooth module

    Hi,

    I am using my cell phone to communicate with a device that has a PIC 12F683 and an HC-06 Bluetooth module (Linvor). Initially, certain parameters are set from the cell phone and then the device goes to sleep. When the device wakes up, it waits to connect to the cell phone. When I connect to the device from the cell phone using the app Blueterm, I get the message "Connected to Linvor". Once I see this message, I type '1' on the phone. When this '1' is received by the device, it executes a subroutine. Here's my question.

    Is there a way to detect that the device has been connected to the phone by reading the value of some register of the PIC? If the answer is Yes, then I don't need to type '1' on the phone. The device can check the value of the register to know whether the connection has been established. If there is no connection, it keeps waiting. If the connection has already taken place, the device goes ahead with the next command to be executed.

    I am using DEBUGIN and DEBUG for communication at 9600 baud rate, 8 data bits, no parity, 1 stop bit (8N1). 12F683 does not have a hardware USART and hence I will have to rely on software commands like DEBUGIN, DEBUG and SERIN, SEROUT.

    Would highly appreciate any help.

    Bala

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,042


    Did you find this post helpful? Yes | No

    Default Re: Communication using a Bluetooth module

    This is for HC05:
    http://m.instructables.com/files/ori...0GH1LWQ0PO.pdf

    Page 10, can you check PI09 output while using automatic connection feature?

    (Never used this device yet)

    Robert
    Last edited by Demon; - 1st November 2013 at 14:13.

  3. #3
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Communication using a Bluetooth module

    Presuming it is not possible from the PIC, you may investigate "Tasker" or "ITTT" (If This Then That), both Android applications (I believe ITTT has an Apple version) that automate functions on your cell. For example, Tasker turns off the screen lock on my cell in range of my Wi-Fi and turns it on when I leave range. It also logs onto my website and performs "housecleaning" chores Tuesdays at 9:00pm and notifies Pebble of various telephony conditions. Quite capable of sending (or responding to) specifically worded texts and emails as well... I am confident it would recognize and respond as you wish. Seems like a perfect compliment to Bluetooth automation, even if (sadly) it does not resolve your specific need.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Communication using a Bluetooth module

    The HC-06 module (if you have the backplane with it too) has a state output...
    This output toggles on and off when not paired and is solid on if it it...
    So, you can write a routing that looks to see if this pin is on or off and waits to see if it's status changes.

    Also, the pic can send an "AT" to the HC-06, if it receives an "OK" then the module is NOT paired...
    However, if the module IS paired and an "AT" is sent then the "AT" is transmitted to the phone where the phone could be programmed to reply with it's own code... or not reply at all... In ether case the pic will know it's paired...

  5. #5
    Join Date
    May 2011
    Location
    Bangalore, India
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: Communication using a Bluetooth module

    Thanks a lot, Robert, Amoque and comwarrior for your helpful replies.

    Replies from Robert and comwarrior give me the following idea: Once the device wakes up from sleep, keep checking pin 24 (Status LED) of the BT module for high pulse width. If and when the pin is continuously high, it means that the connection with the phone is established.

    Amoque, I am using Samsung Android phone and the app Tasker (or ITTT) has many uses and I am sure, I will be using it for one of my future projects.

    Bala

Similar Threads

  1. RN41 Bluetooth Module
    By gavo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th July 2013, 17:13
  2. Bluetooth module for Ipod?
    By DanPBP in forum Bluetooth
    Replies: 3
    Last Post: - 10th October 2012, 17:16
  3. Bluetooth Module, SKKCA-21, Cytron
    By arson88 in forum Bluetooth
    Replies: 3
    Last Post: - 19th March 2012, 17:44
  4. Bluetooth module @ 3.3 volts
    By ardhuru in forum Bluetooth
    Replies: 9
    Last Post: - 22nd January 2012, 05:09
  5. What bluetooth module to choose?
    By mbox in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th November 2009, 00:01

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts