bluetooth – Blog eTechPath https://blog.etechpath.com Tue, 03 Jan 2023 12:36:07 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://blog.etechpath.com/wp-content/uploads/2017/08/BrandLogo12-150x150.png bluetooth – Blog eTechPath https://blog.etechpath.com 32 32 Bluetooth Controlled 8×8 LED MAX7219 Matrix using Android Phone. https://blog.etechpath.com/bluetooth-controlled-8x8-led-max7219-matrix-using-android-phone/ https://blog.etechpath.com/bluetooth-controlled-8x8-led-max7219-matrix-using-android-phone/#comments Thu, 12 Oct 2017 00:51:25 +0000 https://blog.etechpath.com/?p=416 About:

This project is about moving LED matrix display. In this project we will use MAX7219 8×8 LED module for display, Arduino UNO for brain and Bluetooth serial  module for communication. You will need an Android phone for controlling this display.




Things you will need: 

  1. Arduino UNO.
  2. MAX7219 LED modules – 3Nos.   (You can add many of these for increasing length of display)
  3. HC-05 Serial Bluetooth Module.      (You can use any other similar serial Bluetooth module instead )
  4. Android Phone.

 

Circuit Diagram:

Circuit Diagram

wiring diagram

 

Code :

    /*
          8x8 LED Matrix MAX7219 Scrolling Text
              Android Control via Bluetooth
    */
    #include <MaxMatrix.h>
    #include <SoftwareSerial.h>
    #include <avr/pgmspace.h>
    PROGMEM const unsigned char CH[] = {
      3, 8, B00000000, B00000000, B00000000, B00000000, B00000000, // space
      1, 8, B01011111, B00000000, B00000000, B00000000, B00000000, // !
      3, 8, B00000011, B00000000, B00000011, B00000000, B00000000, // "
      5, 8, B00010100, B00111110, B00010100, B00111110, B00010100, // #
      4, 8, B00100100, B01101010, B00101011, B00010010, B00000000, // $
      5, 8, B01100011, B00010011, B00001000, B01100100, B01100011, // %
      5, 8, B00110110, B01001001, B01010110, B00100000, B01010000, // &
      1, 8, B00000011, B00000000, B00000000, B00000000, B00000000, // '
      3, 8, B00011100, B00100010, B01000001, B00000000, B00000000, // (
      3, 8, B01000001, B00100010, B00011100, B00000000, B00000000, // )
      5, 8, B00101000, B00011000, B00001110, B00011000, B00101000, // *
      5, 8, B00001000, B00001000, B00111110, B00001000, B00001000, // +
      2, 8, B10110000, B01110000, B00000000, B00000000, B00000000, // ,
      4, 8, B00001000, B00001000, B00001000, B00001000, B00000000, // -
      2, 8, B01100000, B01100000, B00000000, B00000000, B00000000, // .
      4, 8, B01100000, B00011000, B00000110, B00000001, B00000000, // /
      4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // 0
      3, 8, B01000010, B01111111, B01000000, B00000000, B00000000, // 1
      4, 8, B01100010, B01010001, B01001001, B01000110, B00000000, // 2
      4, 8, B00100010, B01000001, B01001001, B00110110, B00000000, // 3
      4, 8, B00011000, B00010100, B00010010, B01111111, B00000000, // 4
      4, 8, B00100111, B01000101, B01000101, B00111001, B00000000, // 5
      4, 8, B00111110, B01001001, B01001001, B00110000, B00000000, // 6
      4, 8, B01100001, B00010001, B00001001, B00000111, B00000000, // 7
      4, 8, B00110110, B01001001, B01001001, B00110110, B00000000, // 8
      4, 8, B00000110, B01001001, B01001001, B00111110, B00000000, // 9
      2, 8, B01010000, B00000000, B00000000, B00000000, B00000000, // :
      2, 8, B10000000, B01010000, B00000000, B00000000, B00000000, // ;
      3, 8, B00010000, B00101000, B01000100, B00000000, B00000000, // <
      3, 8, B00010100, B00010100, B00010100, B00000000, B00000000, // =
      3, 8, B01000100, B00101000, B00010000, B00000000, B00000000, // >
      4, 8, B00000010, B01011001, B00001001, B00000110, B00000000, // ?
      5, 8, B00111110, B01001001, B01010101, B01011101, B00001110, // @
      4, 8, B01111110, B00010001, B00010001, B01111110, B00000000, // A
      4, 8, B01111111, B01001001, B01001001, B00110110, B00000000, // B
      4, 8, B00111110, B01000001, B01000001, B00100010, B00000000, // C
      4, 8, B01111111, B01000001, B01000001, B00111110, B00000000, // D
      4, 8, B01111111, B01001001, B01001001, B01000001, B00000000, // E
      4, 8, B01111111, B00001001, B00001001, B00000001, B00000000, // F
      4, 8, B00111110, B01000001, B01001001, B01111010, B00000000, // G
      4, 8, B01111111, B00001000, B00001000, B01111111, B00000000, // H
      3, 8, B01000001, B01111111, B01000001, B00000000, B00000000, // I
      4, 8, B00110000, B01000000, B01000001, B00111111, B00000000, // J
      4, 8, B01111111, B00001000, B00010100, B01100011, B00000000, // K
      4, 8, B01111111, B01000000, B01000000, B01000000, B00000000, // L
      5, 8, B01111111, B00000010, B00001100, B00000010, B01111111, // M
      5, 8, B01111111, B00000100, B00001000, B00010000, B01111111, // N
      4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // O
      4, 8, B01111111, B00001001, B00001001, B00000110, B00000000, // P
      4, 8, B00111110, B01000001, B01000001, B10111110, B00000000, // Q
      4, 8, B01111111, B00001001, B00001001, B01110110, B00000000, // R
      4, 8, B01000110, B01001001, B01001001, B00110010, B00000000, // S
      5, 8, B00000001, B00000001, B01111111, B00000001, B00000001, // T
      4, 8, B00111111, B01000000, B01000000, B00111111, B00000000, // U
      5, 8, B00001111, B00110000, B01000000, B00110000, B00001111, // V
      5, 8, B00111111, B01000000, B00111000, B01000000, B00111111, // W
      5, 8, B01100011, B00010100, B00001000, B00010100, B01100011, // X
      5, 8, B00000111, B00001000, B01110000, B00001000, B00000111, // Y
      4, 8, B01100001, B01010001, B01001001, B01000111, B00000000, // Z
      2, 8, B01111111, B01000001, B00000000, B00000000, B00000000, // [
      4, 8, B00000001, B00000110, B00011000, B01100000, B00000000, // \ backslash
      2, 8, B01000001, B01111111, B00000000, B00000000, B00000000, // ]
      3, 8, B00000010, B00000001, B00000010, B00000000, B00000000, // hat
      4, 8, B01000000, B01000000, B01000000, B01000000, B00000000, // _
      2, 8, B00000001, B00000010, B00000000, B00000000, B00000000, // `
      4, 8, B00100000, B01010100, B01010100, B01111000, B00000000, // a
      4, 8, B01111111, B01000100, B01000100, B00111000, B00000000, // b
      4, 8, B00111000, B01000100, B01000100, B00101000, B00000000, // c
      4, 8, B00111000, B01000100, B01000100, B01111111, B00000000, // d
      4, 8, B00111000, B01010100, B01010100, B00011000, B00000000, // e
      3, 8, B00000100, B01111110, B00000101, B00000000, B00000000, // f
      4, 8, B10011000, B10100100, B10100100, B01111000, B00000000, // g
      4, 8, B01111111, B00000100, B00000100, B01111000, B00000000, // h
      3, 8, B01000100, B01111101, B01000000, B00000000, B00000000, // i
      4, 8, B01000000, B10000000, B10000100, B01111101, B00000000, // j
      4, 8, B01111111, B00010000, B00101000, B01000100, B00000000, // k
      3, 8, B01000001, B01111111, B01000000, B00000000, B00000000, // l
      5, 8, B01111100, B00000100, B01111100, B00000100, B01111000, // m
      4, 8, B01111100, B00000100, B00000100, B01111000, B00000000, // n
      4, 8, B00111000, B01000100, B01000100, B00111000, B00000000, // o
      4, 8, B11111100, B00100100, B00100100, B00011000, B00000000, // p
      4, 8, B00011000, B00100100, B00100100, B11111100, B00000000, // q
      4, 8, B01111100, B00001000, B00000100, B00000100, B00000000, // r
      4, 8, B01001000, B01010100, B01010100, B00100100, B00000000, // s
      3, 8, B00000100, B00111111, B01000100, B00000000, B00000000, // t
      4, 8, B00111100, B01000000, B01000000, B01111100, B00000000, // u
      5, 8, B00011100, B00100000, B01000000, B00100000, B00011100, // v
      5, 8, B00111100, B01000000, B00111100, B01000000, B00111100, // w
      5, 8, B01000100, B00101000, B00010000, B00101000, B01000100, // x
      4, 8, B10011100, B10100000, B10100000, B01111100, B00000000, // y
      3, 8, B01100100, B01010100, B01001100, B00000000, B00000000, // z
      3, 8, B00001000, B00110110, B01000001, B00000000, B00000000, // {
      1, 8, B01111111, B00000000, B00000000, B00000000, B00000000, // |
      3, 8, B01000001, B00110110, B00001000, B00000000, B00000000, // }
      4, 8, B00001000, B00000100, B00001000, B00000100, B00000000, // ~
    };
    int dIn = 7;   // DIN pin of MAX7219 module
    int clk = 6;   // CLK pin of MAX7219 module
    int cs = 5;    // CS pin of MAX7219 module
    int maxInUse = 2;    // Number of MAX7219's connected
    MaxMatrix m(dIn, cs, clk, maxInUse);
    SoftwareSerial Bluetooth(8, 7); // Bluetooth
    byte buffer[10];
    char incomebyte;
    int scrollSpeed = 100;
    char text[100] = "www.etechpath.com  "; // Initial text message
    int brightness = 15;
    int count = 0;
    char indicator;
    void setup() {
      m.init(); // MAX7219 initialization
      m.setIntensity(brightness); // initial led matrix intensity, 0-15
      Bluetooth.begin(38400); // Default communication rate of the Bluetooth module
    }
    void loop() {
      // Printing the text
      printStringWithShift(text, scrollSpeed);
      
      if (Bluetooth.available()) {   // Checks whether data is comming from the serial port
        indicator = Bluetooth.read();   // Starts reading the serial port, the first byte from the incoming data
        // If we have pressed the "Send" button from the Android App, clear the previous text
        if (indicator == '1') {
          for (int i = 0; i < 100; i++) {
            text[i] = 0;
            m.clear();
          }
          // Read the whole data/string comming from the phone and put it into text[] array.
          while (Bluetooth.available()) {
            incomebyte = Bluetooth.read();
            text[count] = incomebyte;
            count++;
          }
          count = 0;
        }
        // Adjusting the Scrolling Speed
        else if (indicator == '2') {
          String sS = Bluetooth.readString();
          scrollSpeed = 150 - sS.toInt(); // Milliseconds, subtraction because lower value means higher scrolling speed
        }
        // Adjusting the brightness
        else if (indicator == '3') {
          String sB = Bluetooth.readString();
          brightness = sB.toInt();
          m.setIntensity(brightness);
        }
      }
    }
    void printCharWithShift(char c, int shift_speed) {
      if (c < 32) return;
      c -= 32;
      memcpy_P(buffer, CH + 7 * c, 7);
      m.writeSprite(32, 0, buffer);
      m.setColumn(32 + buffer[0], 0);
      for (int i = 0; i < buffer[0] + 1; i++)
      {
        delay(shift_speed);
        m.shiftLeft(false, false);
      }
    }
    void printStringWithShift(char* s, int shift_speed) {
      while (*s != 0) {
        printCharWithShift(*s, shift_speed);
        s++;
      }
    }
    void printString(char* s)
    {
      int col = 0;
      while (*s != 0)
      {
        if (*s < 32) continue;
        char c = *s - 32;
        memcpy_P(buffer, CH + 7 * c, 7);
        m.writeSprite(col, 0, buffer);
        m.setColumn(col + buffer[0], 0);
        col += buffer[0] + 1;
        s++;
      }
    }

 

 

Steps :

  1. Connect MAX7219 LED modules with each other as shown in above wiring diagram.
  2. Connect led modules data pins to arduino data pins and connect source power as shown in circuit diagram.
  3. Now connect HC-05 serial module to RX TX pins of Arduino. Arduino RX to HC-05 TX and arduino TX to HC-05 RX.
  4. Download code into arduino using Arduino IDE.
  5. Download android application from download section and install it in your phone .
  6. Now you can connect your phone with this display using provided application to control matrix display.



Downloads :

  1. Android appliation
  2. MAX7219 Datasheet
  3. MaxMatrix.h


Check this WiFi controlled MAX7219 LED Matrix using ESP-12 NodeMCU module

]]>
https://blog.etechpath.com/bluetooth-controlled-8x8-led-max7219-matrix-using-android-phone/feed/ 1
How to program XS3868 audio bluetooth module using USB TTL module https://blog.etechpath.com/how-to-program-xs3868-audio-bluetooth-module-using-usb-ttl-module/ https://blog.etechpath.com/how-to-program-xs3868-audio-bluetooth-module-using-usb-ttl-module/#comments Mon, 04 Sep 2017 22:48:48 +0000 https://blog.etechpath.com/?p=205 About :

XS3868 is based on OVC3860 RF transceiver. OCV3860 is low voltage single chip Bluetooth RF transceiver providing Bluetooth stereo solution. OVC3860 is a 2.4GHz transceiver with Bluetooth V2 baseband and can transfer 20bit high quality audio codec. OVC3860 is fetured with inbuilt power management and support advance lithium ion batteries with switch regulator.




In this project we are going to learn how to program XS3868 audio Bluetooth module using TTL USB module. Here you will learn how to change the costume Bluetooth device name and the security password of XS3868 device.

 

Requirments :

  1. XS3868 module
  2. USB TTL serial module
  3. 3.7v li-ion battery or any 3.6v-4.2v voltage source
  4. LED with 470 Ohm resistor (optional)
  5. Compute (to communicate with the device)

 

Circuit Diagram :

xs3868_bluetooth_UART

 

Steps:

    1. Connect xs3868 with battery then wire its reset terminal with 1.8v output terminal of xs3868.
    2. As shown in diagram connect TX of xs3868 to RX of UART module and RX of xs3868 to TX of UART  module.
    3. At last connect UART module GND terminal to common ground of xs3868.



  1. Download  “OVC3860 RevD Develop” tool from link given bellow at download section.
  2. Connect UART module to your computer USB port and check the COM port number for UART device, if it is other than COM-1 then change it to COM-1 first. [Here’s How To]
  3. Open OVC3860 RevD Develop tool with administrative rights, you will see the window similar as below,OVC3860_RevD_Develop_tool
  4. Now reset xs3868 module from reset pin and you will see the your device connected in tool window with green circle on the top.
  5. Now scroll down to item Local Name and Pincode, this is your Bluetooth name and password.
  6. Change it to desired Bluetooth name and password as you want.
  7. Click Write ALL button in tool and if everything went right, you will get Success message pop up on screen.

 

Download Section:

  1. OVC3860 RevD Development tool
  2. OCV3860 AT-Command Set



]]>
https://blog.etechpath.com/how-to-program-xs3868-audio-bluetooth-module-using-usb-ttl-module/feed/ 5
How to convert your wired headphones into Bluetooth headphone https://blog.etechpath.com/how-to-convert-your-wired-headphones-into-bluetooth-headphone/ https://blog.etechpath.com/how-to-convert-your-wired-headphones-into-bluetooth-headphone/#respond Sun, 03 Sep 2017 22:40:29 +0000 https://blog.etechpath.com/?p=189 About:
In this projects we are going to use XS3868 Bluetooth module to convert our wired headphones to wireless one. XS3868 is based on OVC3860 RF transceiver. OCV3860 is low voltage single chip Bluetooth RF transceiver providing Bluetooth stereo solution. OVC3860 is a 2.4GHz transceiver with Bluetooth V2 baseband and can transfer 20bit high quality audio codec. OVC3860 is fetured with inbuilt power management and support advance lithium ion batteries with switch regulator.
This device can be program through serial port using AT commands, we will see this chapter later on how to program XS3868 using serial adapter.




Required Components:

  1. XS-3868 Bluetooth module.
  2. Good quality Headphones (wired).
  3. 10k resistor.
  4. 47uF capacitor.
  5. 3mm LED.
  6. 3.7v  Lithium ion battery.

Tools:

  1. Soldering ion
  2. Soldering paste
  3. Soldering tin wire

Wiring Diagram:

xs3868_bluetooth_headphone




My Prototype:

DIY_XS3868_Bluetooth_Headphone            

 

 


]]>
https://blog.etechpath.com/how-to-convert-your-wired-headphones-into-bluetooth-headphone/feed/ 0