HC-06 or HC-05 and Picaxe

veracruz290

New Member
Has anyone attempted 2 way communication with these Bluetooth Devices?
I am able to use my smart phone to communicate and pass values to a 14M2 picaxe connected to an HC-06 BT module.
I'm also able to change Name, Pin#, and Buad of the Bluetooth Module thru a serial connection 14M2 ---> HC06, what I still however cannot figure out is how to send data from the 14M2 thru the HC-06 to the Phone. I've created the Voltage Divider to protect Rx of the BT Module. I've looked for examples but to No avail!
Perhaps it's not possible? My project involves closing a Garage Door. Feedback that the door is closed would be gold! Any help is greatly appreciated. Thanks Rick
 

manuka

Senior Member
2 way you say ? More detail please ! It's quite possible, although the HC-06 is slave only & the similar Master /Slave HC-05 may be easier to use. Unsure just what "data" you wish to view though- just open/shut or more detailed times etc.

PICAXE -Android projects have certainly arisen, with diverse apps. available for at least "stroll by" monitoring - have you checked these at the Google Play store ? Several have recently been discussed on this forum.

Stan.
 

joe paul

Senior Member
Hi Veracruz290,

I use the HC-06 with the 18M2, and a simple SERIN and SEROUT works fine:

Code:
setfreq m8

serin C.0, T9600_8,w1       ;receives w1 from the Android app into pin C.0

serout C.1, T9600_8,(w1)    ;sends w1 to the app from pin C.1
Hope am not missing a more complex issue. (I don't use a voltage divider for either RX or TX with the HC-06.)

Good luck!

Take care, Joe.
 

jims

Senior Member
Hi Veracruz290,

I use the HC-06 with the 18M2, and a simple SERIN and SEROUT works fine:

Code:
setfreq m8

serin C.0, T9600_8,w1       ;receives w1 from the Android app into pin C.0

serout C.1, T9600_8,(w1)    ;sends w1 to the app from pin C.1
Hope am not missing a more complex issue. (I don't use a voltage divider for either RX or TX with the HC-06.)

Good luck!

Take care, Joe.
joe paul...all this communication stuff is way over my head; but I'd like to learn how to communicate with my PC using my iphone. Any recommendations about where/how to get started? Thank you, JimS
 

joe paul

Senior Member
Hi JimS,

I am afraid that most of it is over my head, also. What I did was use a free Android app and the HC-06 Bluetooth transceiver to control the 18M2 chip, a wireless remote control for toy trains. Someone else will have to address your questions. (I can explain why and how I did things for my project, but that's all I can offer.) I would like to dive more deeply into all of this, but there are only 24 hours in a day and I have no formal training in electronics, only learned BASIC Plus back in college (1977)!

Good Luck!

Take care, Joe.
 

veracruz290

New Member
Hi Veracruz290,

I use the HC-06 with the 18M2, and a simple SERIN and SEROUT works fine:

Code:
setfreq m8

serin C.0, T9600_8,w1       ;receives w1 from the Android app into pin C.0

serout C.1, T9600_8,(w1)    ;sends w1 to the app from pin C.1
Hope am not missing a more complex issue. (I don't use a voltage divider for either RX or TX with the HC-06.)

Good luck!

Take care, Joe.
Joe, I think this might work. Thanks so much for sharing your knowledge.
I'm using RoboRemo Free from the Android Google Play Store.
Took me a little while to realize values were being sent ascii code. So for Instance Send the capital Letter A and you get b.1= 65. ...... serin C.0, T9600_8,b1
but I can't get Word Variables to give consistent data? if I use .......serin C.0, T9600_8,w1 the value for w1 jumps all over the place during debug.
My project involves using my smart Phone to open and close the garage door.
I'll add a reed switch or some other device for feedback that the door is indeed closed.
Thanks again for your code example, Rick
 

joe paul

Senior Member
Hi Rick,

I just tried this with the free app "SENA B Term"

Code:
setfreq m8
main:

serin C.0, T9600_8,b1   
if b1=97 then goto main2   ; lowercase "a"
goto main

main2:

serout C.1, T9600_8,("door closed")    

goto main
So something like "If pinC.0=1 then goto main2" when the reed switch connected to C.1 is closed.

I haven't tried to use RoboRemoFree for serial in yet.

Take care, Joe.

P.S. How about a simple snap-action limit switch? No need for a magnet and more precise.

P.P.S. Just got the RoboRemoFree text log working; use "dbg door closed/n" for the SEROUT string, with the 'log id' in the app set to "dbg" or 3 letters of your choice. J.
 
Last edited:

veracruz290

New Member
2 way you say ? More detail please ! It's quite possible, although the HC-06 is slave only & the similar Master /Slave HC-05 may be easier to use. Unsure just what "data" you wish to view though- just open/shut or more detailed times etc.

PICAXE -Android projects have certainly arisen, with diverse apps. available for at least "stroll by" monitoring - have you checked these at the Google Play store ? Several have recently been discussed on this forum.

Stan.
Stan are you talking about Apps Like RoboRemo Free, blueterm,
and SenaBTerm? Are there any out there you really like?
Thanks, Rick
 

veracruz290

New Member
Wow Joe! thanks! I'll have to give it a go when I can find the time.
Might not be until Friday or Saturday.
Can't wait!
Take Care, Rick
 

hippy

Ex-Staff (retired)
I can't get Word Variables to give consistent data? if I use .......serin C.0, T9600_8,w1 the value for w1 jumps all over the place during debug.
SERIN only receives byte values even when the variable is a word, unless you put a # in front of the variable when it receives an ASCII sequence and converts that to a number.
 

manuka

Senior Member
Rick: Yes those Android apps. you mention are typical of the swag available. You may need to trial several however to find which best suits your needs & personal preferences.

Please confirm you ARE using an Android of course! Also mention it's version (Jelly Bean 4.2 etc)- very recent Androids may use BT 4 (a.k.a. BTSmart or BLE).

FWIW - classic DEBUG is rather a messy PICAXE command, & SERTXD (& the editors inbuilt terminal program) is now usually preferred. Stan.
 

veracruz290

New Member
Thanks Everyone for your direction and advice. I've been using RoboRemoFree and is working great allowing me to send commands from my smart Phone to my HC-06 BT module.
I do have a line of code coming out of my picaxe.... serout C.1, T9600_8,("door closed")..... but can't seem to find an example of how to use RoboRemo to display that message?
Has anyone seen anything that might point me in the correct direction??
Thanks, Rick
 

joe paul

Senior Member
Hi Rick,

Please see the post script of my last message:

"P.P.S. Just got the RoboRemoFree text log working; use "dbg door closed/n" for the SEROUT string, with the 'log id' in the app set to "dbg" or 3 letters of your choice. J. "

Take care, Joe.
 

veracruz290

New Member
I am perplexed!!!
but this stuff sure is fun!!
Here's where I am hung up....

Here's my set up
Running RoboRemoFree on:
Samsung -SM-G900A Galaxy S5
Andriod Version 4.4.2

Using a "text log" Dialog Box with --> set id =gdc

Code being sent from my picaxe....

setfreq m8
main:
serin C.0, T9600_8,b1
if b1=97 then goto main2 ; lowercase "a"
goto main
main2
serout C.1, T9600_8,("gdc door closed/n") ' BTW This works with an LCD Serial enabled Display connected to pin C.1
goto main


I still get no indication on my "Text Log" Dialog Box on RoboRemoFree???
Is there something right in front of my face I can't see?
Perhaps there something wrong with MY HC-06 BT module??


Appreciate all the help and input. Thanks Joe and everyone else this make it that much more fun! Rick
 

joe paul

Senior Member
Hi Rick,

The only thing I can offer is to try it with another app to see if the module is sending anything.

Make sure you have the latest version of RoboRemoFree. Then open 'menu' -- 'more options' -- 'RFCOMM settings' then choose "auto" and "default" and press "OK."

Good luck!

Take care, Joe.
 
Last edited:

veracruz290

New Member
Thanks Joe

haha, Not sure what's the issue. Seems like I've tried everything!!
I have a few more of the HC-06 BT Modules coming OVER on the slow boat from China.
Should be here before may 6th.
I guess I'll wait to see if that's the issue, unless I can't think of, or anyone else can think of, something else to try in the meantime.

I am using the latest version of RoboRemoFree.The auto Port channel is selected as well as default for UUID. Encrypted is not ticked.
Scratching my head in Ohio, Thanks again all, Rick
 

joe paul

Senior Member
Hi Rick,

Try using "dbg" for the id; perhaps some bug with your choice. Have you tried the Sena B Term app?

Take care, Joe.
 

veracruz290

New Member
Joe, Yes to first question I have tried using "dbg"
and No I haven't had any luck with Sena B Term, but I'll give it another shot!
Thanks for the suggestion!!
Take Care, Rick
 

joe paul

Senior Member
Hi Rick,

Perhaps your voltage divider is blocking the signal. I didn't use a voltage divider at first; some boards didn't need one. It wouldn't hurt to remove the voltage divider for a few minutes. Did you change the baud rate? I am stumped!

Good Luck!!!!

Take care, Joe.
 

veracruz290

New Member
Joe, I will try that next... no voltage divider!! Good suggestion! Wonder if that's it?
I'll let you know tomorrow? Thanks, Rick
 

veracruz290

New Member
Joe, I tried no Voltage Divider. Just feeding ---> serout C.1, T9600_8,("gdc door closed/n") raw from pin C.1 to HC-06 like we discussed, and the issue persists!!
So...I'm waiting for another HC-06.

Something you might find interesting,
I took my prototype circuit with HC-06, Picaxe, and small driver circuit connected to garage door circuit switch and tested the unit.
I was able to connect via bluetooth from about 100 feet then close and open the door! Sweet!
Thanks for all your help. Rick
 

joe paul

Senior Member
Hi Rick,

Thanks for the info about the distance. I suspect that all boards aren't created equally! If you have the time to invest while you wait for that slow boat from China, try the SENA B Term free app. You'll get serial in with less trouble.

I have been using the SENA B Term and SEROUT as I explore the Hall Effect circuit. (Those sensors are very, very tiny, like the head of a pin; a square head.)

Good luck!!!

Take care, Joe.
 

veracruz290

New Member
Hi Rick,

Thanks for the info about the distance. I suspect that all boards aren't created equally! If you have the time to invest while you wait for that slow boat from China, try the SENA B Term free app. You'll get serial in with less trouble.

I have been using the SENA B Term and SEROUT as I explore the Hall Effect circuit. (Those sensors are very, very tiny, like the head of a pin; a square head.)

Good luck!!!

Take care, Joe.
Joe, I did try SENA BTerm. Works for sending information but still not receiving any messages back from Picaxe.
Perhaps I'm still not doing something correct?
As for the distance, I did enhance the Antennae a bit. I modified to equal quarter wave length. Not sure about the, "Correctness" ;) if you will, but as an experiment it sure does seem to boost the distance.
Thanks Kindly, Rick
 

joe paul

Senior Member
Hi Rick,

Well, when you get your new module, you'll have it all working. Please keep us posted!

Good Luck!!!!!!!!!

Take care, Joe.
 
Top