Author Topic: Wireless Communication Using HC-06 Bluetooth Module  (Read 4842 times)

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Wireless Communication Using HC-06 Bluetooth Module
« on: September 28, 2016, 05:22:59 AM »
While digging around for some parts for another project I ran across my HC-06 Bluetooth to Serial module. I hooked it up to my spare arduino running GRBL 1.0c and connected to it with BCL.

This was really easy since I happen to have the bluetooth adapter already setup with the same communication parameters that we use for the arduino on the laser engraver. Since that step was already done, all I had to do was connect the HC-06 module to the 5v, ground, RX0, & TX1 pins on the arduino and then connect to the com port on my computer for the HC-06.

And Here are the results.

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #1 on: September 28, 2016, 05:59:49 AM »

Lob0426

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1627
  • Let the Magic Blue Smoke out!
    • View Profile
    • Richards RasPi Web Server
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #2 on: September 28, 2016, 09:22:58 AM »
Ok now you have to solder it to the back side pins for field trials.

Then you have to redesign the L7 update board you worked on, to have a connector, JST-XH probably, Bluetooth connector. Then I can run it with my Tablet wireless. LOL.


You should have about a 21ft range on that adapter. How much of a load does it put on the Nano?

Great work I would have never thought it could be don on a Nano!
Richard
A5 2.5W w/homing switches on L7
A5 2W diode self upgraded from stock 500mw
Printrbot Play. Ext bed, integrated tablet control.
Printrbot Simple Metal
USA

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #3 on: September 28, 2016, 10:17:08 AM »
No load... The Bluetooth board simply bypasses the FTDI or CH340 chip and sends the serial commands to the same lines. The data coming back out gets picked up by the Bluetooth board and sent to the PC. The arduino doesn't know the serial traffic is not coming from the usb chip so no code change needed either.

As for range, I have some external antennas (like what you would find on a WIFI modem) with a SMA connector and wire to go to the Bluetooth board.

Lob0426

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1627
  • Let the Magic Blue Smoke out!
    • View Profile
    • Richards RasPi Web Server
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #4 on: September 28, 2016, 01:02:05 PM »
So the load is the same as using USB!

Now I have to look I may have an 05 or 06 around here. The Franken-Mega would be easy to adapt RX/TX are open headers. Then Mega-mini's too.
Richard
A5 2.5W w/homing switches on L7
A5 2W diode self upgraded from stock 500mw
Printrbot Play. Ext bed, integrated tablet control.
Printrbot Simple Metal
USA

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #5 on: September 28, 2016, 01:35:53 PM »
by load, I took that to mean strain on the micro. If that is what you meant then no. If you are asking if the communication back and forth is as fast as a cable then no, there is some lag and how it affects the machine is yet to be determined. I unplugged it from my spare to hook up the Bluetooth. A real test would be cutting something with it.

I threw this together in about an hour this morning so I haven't done much beyond seeing if BCL could connect to it and send some commands.

Lob0426

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1627
  • Let the Magic Blue Smoke out!
    • View Profile
    • Richards RasPi Web Server
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #6 on: September 28, 2016, 01:52:48 PM »
Send a job to the real board, do not bother turning the power on. time it. Then run the Bluetooth/Nano and time it, same job. You will see if it is communicating fast enough or if it is slow. Bluetooth is good for about 2Mb/s. The serial is at 115200. I would think that it would be about the same timing for either test.

You would only be testing the communication speed.

Still, Good work. I hate all the wires hanging from these things and 3D printers. We should only need one dang wire, POWER!

I could not find anything really useable for WiFi!
Richard
A5 2.5W w/homing switches on L7
A5 2W diode self upgraded from stock 500mw
Printrbot Play. Ext bed, integrated tablet control.
Printrbot Simple Metal
USA

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #7 on: September 28, 2016, 02:36:15 PM »
I didn't put a stopwatch to it this morning but I did test for speed and it does take a second or two longer to get the welcome message. I have not timed how long it takes to say the job is completed  though.

phedders

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #8 on: October 20, 2016, 12:30:58 AM »
I'm planning to use an ESP-12F on mine. If you're not familiar with the ESP8266 chip and its boards google - they are amazing little wifi microcontroller chips - and soooo cheap. Very cost effective way to put any serial device onto your network.

There is a nice sketch written by the laserweb guys that makes the serial port available on a tcp port.
I'm using linux so T2/BCL hold no interest for me - but might for you guys.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2913
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #9 on: October 20, 2016, 06:17:59 AM »
I also use Linux and would like to go wireless. The major reason for not doing so is there is currently nothing in the firmware to turn the laser OFF if there is a loss in communications. For me to go wireless I would need:

   1. Ability to error check each line.
   2. Enough local storage to buffer the entire image.

I suspect that a minimum solution would be on the order of a RPi with networking builtin. The effort would then be a host / slave implementation using standard Linux networking.
 
SARCASM - Just one more service we offer here.

beikeland

  • Guest
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #10 on: October 20, 2016, 06:30:32 AM »
I use a RPi today, but I will be considering moving to ESP8266, and use a virtual serial port if I need to use the machine from windows.

I'm hoping to do something like a hardware watchdog anyway; like if there is no step/dir signals for X time, disengage the the laser. But first I need to get the thing running the way I want.

Word of caution though, you may want to make sure you have propper 3.3v to 5v level conversion for both a ESP8266 (and RPi if not using USB). Some claim ESP8266 is 5v tolerant, but its still not officially part of the datasheet, and failures will be over time. ESP-Link firmware is quite good for Wifi serial bridges using ESP chips.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2913
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #11 on: October 20, 2016, 07:28:06 AM »
I have (unopened) a newer RPi that has onboard wireless as well as wireless USB dongles that work well inside my house (25m). The GRBL firmware support a STATUS message command whereby the host can ask the controller is status and can get a reply of <RUN:xx:yy:...> or <IDLE:xx:yy:...>. Might be able to utilize this for a keep-alive signal.
SARCASM - Just one more service we offer here.

beikeland

  • Guest
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #12 on: October 20, 2016, 08:36:17 AM »
Hmm, thats a possibility that requires no hardware intervention, beyond a relay or something in series with the laser.

I'll need to look into teeing off the serial data and use a tap for monitoring it. On the othe r hand, having hardware monitoring step/dir signals does prevent issues with potential bugs in Grbl which is infinitely more complex than a simple code to monitor pins. Hopefully I'll have E-stop and a relay on the laser control/power wired up in a few weeks and can start looking at options for a watchdog.

parnz

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #13 on: October 20, 2016, 09:00:23 AM »
I'm think about the wireless jogging joystick project.... ;D

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 2833
  • Administrator
    • View Profile
Re: Wireless Communication Using HC-06 Bluetooth Module
« Reply #14 on: October 20, 2016, 09:13:00 AM »
@Agastar

Hey...look at that oscilloscope...!!!
Admin -- Ralph -- support @ BenCutLaser dot us
https://www.dropbox.com/s/qv1qee2vb65785t/SetupBenCutLaser3.2a.zip?dl=0
BCL Paid license: $49.95
via Paypal to bclpp@primemail.com