1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

dont know how to use bluetooth module hc-05

Discussion in 'Arduino' started by toni.zul, Jan 20, 2018.

  1. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    whit 9600 is just sends 241 nothing else
     
  2. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    what post i shud use becuse 9600 whir nl & cr is just send 241 in my serial monitor
     
  3. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    Your not following thru start with this hook it up just like this Just like it.
    [​IMG]
     
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  5. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
  6. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    Make sure you set the arduino serial monitor up at 57600
    after loading code to you uno

    This code let's you play with the HC05
    Code (text):

     */
    #include <SoftwareSerial.h>
    SoftwareSerial mySerial(2, 3); // RX, TX
    void setup() {
      // Open serial communications and wait for port to open:
      Serial.begin(57600);
      while (!Serial) {
        ; // wait for serial port to connect. Needed for native USB port only
      }
      Serial.println("Goodnight moon!");
      // set the data rate for the SoftwareSerial port
      mySerial.begin(9600);
      mySerial.println("Hello, world?");
    }
    void loop() { // run over and over
      if (mySerial.available()) {
        Serial.write(mySerial.read());
      }
      if (Serial.available()) {
        mySerial.write(Serial.read());
      }
    }

     
     
  7. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    i dont understand why i shudnt use 38 post becuse everything work . only problem is ascii becuse everrything is wtited in it
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    Because who can read that

    Serial is ascii text you format it to output readable numbers
     
  10. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    i dont understadc you
     
  11. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    and is there any chanse to change ascii numbers to letters
     
  12. Les Jones

    Les Jones Well-Known Member

    Joined:
    May 15, 2015
    Messages:
    1,592
    Likes:
    202
    Location:
    Lancashire UK
    What be80be says in post #47 is correct. Look at the schematic of the Arduino Uno. You will see that the TX on the HC-05 is in parallel with the TX (Pin 9) on the ATMEGA16U (Via a 1K resistor.) This is the reason why with my sggested method that I suggest removing the ATMEGA328 . (And why the apparent strange way of connecting TX to TX is reqired, This is because RX on the ATMEGA16u is conneted to the TX on the ATMEGA328 and therefor marked TX) It is also the reason for be80be's method using two different pins for TX and RX. (As the ATMEGA328 only has one UART this requires the use of a software UART.) When you post you need to give FULL details of how everything is connected together. You have not said if the bluetooth module is in setup mode (AT command mode) or if it is paired and communicating with another Bluetooth interface. (For example a Bluetooth interface on a PC or Android tablet.)

    Les.
     
  13. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    how to remove ATMEGA328
     
  14. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    Les Jones That I said is correct You cant use the atmega RX and TX pins if it is you will never no where the data is coming you have to remove the Atmega
    But on lots of uno that's not even a option now days

    Remove that atmega
    [​IMG]
     
  15. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    You don't have to you want use it and some boards it can't be removed it's soldered on the board
     
  16. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    i can remove it i have this tipe
     
  17. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
  18. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    but on what i willl upload my program
     
  19. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    This code let's you use the atmega both ways it to show you how it work from there you can go on and do what you want.
    Code (text):

    #include <SoftwareSerial.h>
    SoftwareSerial mySerial(2, 3); // RX, TX
    void setup() {
      // Open serial communications and wait for port to open:
      Serial.begin(57600);
      while (!Serial) {
        ; // wait for serial port to connect. Needed for native USB port only
      }
    }
    void loop() { // run over and over
      if (mySerial.available()) {
        Serial.write(mySerial.read());
      }
      if (Serial.available()) {
        mySerial.write(Serial.read());
      }
    }
     
     
  20. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    5,198
    Likes:
    159
    Location:
    morristown,tn
    You can't with what Les Jones is saying let him fix your problem seems you think he knows best and he seems to think I'm wrong good luck
     
  21. Les Jones

    Les Jones Well-Known Member

    Joined:
    May 15, 2015
    Messages:
    1,592
    Likes:
    202
    Location:
    Lancashire UK
    Just unplug it from the socket assuming it is an Arduino Uno Rev 3. If it is not a plug in chip then you would have to write a program to set the data direction register for the TX pin to be an input. Before doing this you would have to study how to boot loader worked as it might depend on this pin being left as an output.

    Les.
     
  22. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    i dont know why i shoud do that becuse everything is working. my problem is ascii code
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice