Skip to content

HackYourXmasNotes

Éloi Strée edited this page Dec 26, 2018 · 1 revision

Hello HC 06

Quick Hello

Default Alt

Not to miss

Looking For

Youtube Research: HC 06

Start guide

HC 06

https://youtu.be/ZdvKh3c_yoQ

HC 06

http://forcetronic.blogspot.com/2014/08/getting-started-with-hc-06-bluetooth.html

Step 1: Hardware connection

David Watts

Default Alt
https://youtu.be/W5okUciwFkI

Serial HC06 to Arduino

Step 2: Pair the device

Params > bluetooth > Pair device "HC-06"

Step 3: Connect to it

Blue

Install Blue Term (Don't seem to work for me)

Sena

Sena BTerm
https://youtu.be/DI6Oda6fsSY?t=317
[Sena BTerm](https://play.google.com/store/apps/details? id=com.sena.bterm)

PDF

Step x: Unity Package

Arduino Test on PC Terminal

void setup () {
  Serial.begin(9600);
}

void loop() {
  if(Serial.available())
    Serial.print((char)Serial.read());
}

Try by me

Replace Blue Terms

Italiano good tutorial

https://youtu.be/M7DTEcdzDTI

App Inventer vs Unity ?

https://youtu.be/jR4wX7GF9gQ?t=166

Ryan Tips & Tricks

  • Bluetooth Electronics Basicly it is a interface ui that allow to send letter in the terminal from image. Cool to prototype without coding. /!\ Still need to push a Arduino Script

Ready good tutorial

(Unwatch yet) Default Alt
https://youtu.be/7XdSGU_W4ho

Default Alt

/*
 * Bluetooth HC-06 (SLAVE) control from your Android phone RSB May 2016
 */
#include "Arduino.h"
#include <SoftwareSerial.h>

// Instantiate our BT object. First value is RX pin, second value TX pin
// NOTE: do NOT connect the RX directly to the Arduino unless you are using a
// 3.3v board. In all other cases connect pin 4 to a 1K2 / 2K2 resistor divider
/*
 * ---- pin 6-----> |----1K2----| to HC06 RX |----2K2----| -----> GND
 *
 * See my video at www.youtube.com/c/RalphBacon for more details.
 */
SoftwareSerial BTserial(4, 6); // RX , TX

// Our output indicator (could drive an opto-isolated relay)
byte LEDpin = 8;

// -----------------------------------------------------------------------------------
// SET UP   SET UP   SET UP   SET UP   SET UP   SET UP   SET UP   SET UP   SET UP
// -----------------------------------------------------------------------------------
void setup() {

	// LED output pin
	pinMode(LEDpin, OUTPUT);

	// Serial Windows stuff
	Serial.begin(9600);
	Serial.println("Set up complete");

	// Set baud rate of HC-06 that you set up using the FTDI USB-to-Serial module
	BTserial.begin(9600);
}

// -----------------------------------------------------------------------------------
// MAIN LOOP     MAIN LOOP     MAIN LOOP     MAIN LOOP     MAIN LOOP     MAIN LOOP
// -----------------------------------------------------------------------------------
void loop() {

	// If the HC-06 has some data (single char) for us, get it
	if (BTserial.available() > 0) {

		// Get the char
		char data = (char) BTserial.read();

		// Depending on value turn LED ON or OFF (or error message)
		switch (data) {

		case '1':
			Serial.println("ON");
			digitalWrite(LEDpin, HIGH);
			BTserial.write("ON");
			break;

		case '0':
			Serial.println("OFF");
			digitalWrite(LEDpin, LOW);
			BTserial.write("OFF");
			break;

		default:
			Serial.print("NOT RECOGNISED: ");
			Serial.println(data);
			BTserial.print("Error!");
		}
	}
}

Source: Ralph S Bacon


Step Terminal

Default Alt


Set Name and baud rate

/*This sketch Configures the name and baud rate of an HC 06 Bluetooth module */
char message1[10];//need length of chars being read +1 for null character
char message2[9];

void setup() {
  // set baud rate then delay to give user time to open serial monitor
  Serial.begin(9600);
  delay(5000);
  //Send command to set name of HC06 module, with the below command name will change to "forcetronics"
  Serial.print("AT+NAMEForceT");
  delay(600); //HC06 requires 500 msec for reply
  int8_t count = 0; //declare and intialize count 
  while(1) { //loop until OKsetname is read and cleared from buffer
    if(Serial.available()) {
        message1[count] = Serial.read(); //read in char
        count++; 
        if(count == 9) break; //after we get all 9 char break out of loop
    }
    delay(10);
  }
  
  //Send AT command to change baud rate to 115200
  Serial.print("AT+BAUD8");
  delay(600); //HC06 requires 500 msec for reply
  count = 0; //intialize count
  while(1) { //loop until OK115200 is read and cleared from buffer
    if(Serial.available()) {
        message2[count] = Serial.read(); 
        count++; 
        if(count == 8) break; 
    }
    delay(10);
  }
  
  //print out each message to make sure it worked
  Serial.println("");
  Serial.println(message1);
  Serial.println(message2);
}

void loop() {
 //do nothing
  delay(50);
}

HC-06 Fireworks

"Workshop to learn to use HC-06 Bluetooth under Unity by creating a remote fireworks launcher station for safety and fun" Default Alt
EN - FR

Workshop

Learn the basics

Additionnal:

Step by step

Work in progress

Required

Hardware & Component

Software

Album

Hack Your Xmas


Draft

Look for:...

Some Youtube playlists on the subject I was studying for this experiment


Patreon Only

http://eloistree.be

Clone this wiki locally