HC05 bluetooth module nearly in dustbin due to frying my noodles over and over

hi All

i don’t really know where to start with this one.

i bought a couple of modules for sending basic text to a set of led modules namely max7219 led, i connected everything up as per tutorial and the basic message in the code appeared as i would have expected. so the LED side is fine.
connected via bluetooth terminal from my Phone no issue with this finding the bluetooth module and connecting. i then sent a message that was supposed to update the led array and Nothing happened.

so i had to investigate the issue, so stat the research

  1. check the i/o of the bluetooth module

found an app that would communicate and show RX and TX response (Term for BT) it fit the bill so installed and followed several ways of testing the module
i now know that if you connect RX and TX to form a loop it sends and receives ok as it shows in term 1 sent and 1 received blue 1 for sent red 1 for received.

  1. set up a simple circuit to turn one LED off and on (code attached)
#include <SoftwareSerial.h>
char data = 0;                //Variable for storing received data
void setup() 
{
  Serial.begin(9600);         //Sets the data rate in bits per second (baud) for serial data transmission
  pinMode(13, OUTPUT);        //Sets digital pin 13 as output pin
  SoftwareSerial mySerial(10,11); // RX, TX
}
void loop()
{
  if(Serial.available() > 0)  // Send data only when you receive data:
  {
    data = Serial.read();      //Read the incoming data and store it into variable data
    Serial.print(data);        //Print Value inside data in Serial monitor
    Serial.print("\n");        //New line 
    if(data == '1')            //Checks whether value of data is equal to 1 
      digitalWrite(13, HIGH);  //If value is 1 then LED turns ON
    else if(data == '0')       //Checks whether value of data is equal to 0
      digitalWrite(13, LOW);   //If value is 0 then LED turns OFF
  }                            
 
}

ok so using the app that was used in the tutorial i thought all would be ok only to find nothing happened i am absolutely stumped as the tutorial video shows it working
i can send the code via serial monitor to turn on the led but if sent via bluetooth nothing appears in serial monitor

i have reset the HC05 module to factory settings and can communicate in AT mode so i cant see a problem there

i have a voltage divider between TX on the arduino and RX on the HC06 and can see 3.2V on the RX pin of the HC05.

so i am not sure where to go as i have exhausted any ideas i can come up with

it could be a duff module but i’m not sure now

below is the code for the max7219 i am eventually going to use PLEASE note the pin outs are as i would have them set i have changed and tried different i/o pins to see if there was a board problem

In the code i have removed some of the Character set due to length of message

// based on an original sketch by Arduino forum member "danigom"
// http://forum.arduino.cc/index.php?action=profile;u=188950
 
//#include <pgmspace.h>
#include <LedControl.h>
#include <avr/pgmspace.h> 
// virtual serial lib, used with bluetooth

const int numDevices = 4;      // number of MAX7219s used
const long scrollDelay = 50;   // adjust scrolling speed
 
unsigned long bufferLong [14] = {0}; 
 
LedControl lc=LedControl(10,11,12,numDevices);
 
const unsigned char scrollText[] PROGMEM ={
    " Frying my Noodles again !!!! "};
 
void setup(){
    for (int x=0; x<numDevices; x++){
        lc.shutdown(x,false);       //The MAX72XX is in power-saving mode on startup
        lc.setIntensity(x,8);       // Set the brightness to default value
        lc.clearDisplay(x);         // and clear the display
         
          
    }
}
 
void loop(){ 
    scrollMessage(scrollText);
    //scrollFont();
}
 
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 const unsigned char font5x7 [] PROGMEM = {      //Numeric Font Matrix (Arranged as 7x font data + 1x kerning data)
//prog_uchar font5x7 [] PROGMEM = {      //Numeric Font Matrix (Arranged as 7x font data + 1x kerning data)
    B00000000,  //Space (Char 0x20)
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    6,
 
    B10000000,  //!
    B10000000,
    B10000000,
    B10000000,
    B00000000,
    B00000000,
    B10000000,
    2,
 
    B10100000,  //"
    B10100000,
    B10100000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    4,
 
   
};
 
 
void scrollFont() {
    for (int counter=0x20;counter<0x80;counter++){
        loadBufferLong(counter);
        delay(500);
    }
}
 
// Scroll Message
void scrollMessage(const unsigned char * messageString) {
    int counter = 0;
    int myChar=0;
    do {
        // read back a char 
        myChar =  pgm_read_byte_near(messageString + counter); 
        if (myChar != 0){
            loadBufferLong(myChar);
        }
        counter++;
    } 
    while (myChar != 0);
}
// Load character into scroll buffer
void loadBufferLong(int ascii){
    if (ascii >= 0x20 && ascii <=0x7f){
        for (int a=0;a<7;a++){                      // Loop 7 times for a 5x7 font
            unsigned long c = pgm_read_byte_near(font5x7 + ((ascii - 0x20) * 8) + a);     // Index into character table to get row data
            unsigned long x = bufferLong [a*2];     // Load current scroll buffer
            x = x | c;                              // OR the new character onto end of current
            bufferLong [a*2] = x;                   // Store in buffer
        }
        byte count = pgm_read_byte_near(font5x7 +((ascii - 0x20) * 8) + 7);     // Index into character table for kerning data
        for (byte x=0; x<count;x++){
            rotateBufferLong();
            printBufferLong();
            delay(scrollDelay);
        }
    }
}
// Rotate the buffer
void rotateBufferLong(){
    for (int a=0;a<7;a++){                      // Loop 7 times for a 5x7 font
        unsigned long x = bufferLong [a*2];     // Get low buffer entry
        byte b = bitRead(x,31);                 // Copy high order bit that gets lost in rotation
        x = x<<1;                               // Rotate left one bit
        bufferLong [a*2] = x;                   // Store new low buffer
        x = bufferLong [a*2+1];                 // Get high buffer entry
        x = x<<1;                               // Rotate left one bit
        bitWrite(x,0,b);                        // Store saved bit
        bufferLong [a*2+1] = x;                 // Store new high buffer
    }
}  
// Display Buffer on LED matrix
void printBufferLong(){
  for (int a=0;a<7;a++){                    // Loop 7 times for a 5x7 font
    unsigned long x = bufferLong [a*2+1];   // Get high buffer entry
    byte y = x;                             // Mask off first character
    lc.setRow(3,a,y);                       // Send row to relevent MAX7219 chip
    x = bufferLong [a*2];                   // Get low buffer entry
    y = (x>>24);                            // Mask off second character
    lc.setRow(2,a,y);                       // Send row to relevent MAX7219 chip
    y = (x>>16);                            // Mask off third character
    lc.setRow(1,a,y);                       // Send row to relevent MAX7219 chip
    y = (x>>8);                             // Mask off forth character
    lc.setRow(0,a,y);                       // Send row to relevent MAX7219 chip
  }
}/code]


thanks for looking i will try to resolve it but any assistance would be gratefully accepted.

The code at 2 has a SoftwareSerial instance but does not use it ? ?

Start simple. Write a pair of programs where one program sends "hello world" to the other. Only get more complicated when that works.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

Sorry i don't see where you are going with your reply.

i do understand serial data but don't understand why a simple program does not function as expected.

the problem would appear to be with the Bluetooth module

as for the software serial it was a last ditch attempt and hadn't commented it out sorry for that

Thanks anyway :) will keep diging

HeyDJ: Sorry i don't see where you are going with your reply.

I was suggesting the methodology that I would use to get my project to work.

Or maybe it's my Irish blood - I was going there I would not start from here :)

...R

Hi Robin2

To be honest I fear I have a bad board and nothing else, as even the simplest program does not send anything to the Arduino serial monitor or even makes the boards RX and TX lights flicker, three days of reading and investigating has me going round in circles as all I need is some way to test the RX and TX of the HC05unfortunately this seems to just be a dream or on page 1 million of a search for testing a HC05 I/o. The nearest I got was looping the RX TX and seeing two ones in an Android app one blue for TX and red for RX

P.S. all my attempts have used coding found on the net that have worked I have no reason to doubt this

I am waiting for two new modules and will try again

Unless someone here has any better ideas

HeyDJ: To be honest I fear I have a bad board and nothing else, as even the simplest program does not send anything

In that situation simple programs are the best indicator.

...R

HeyDJ: I fear I have a bad board and nothing else,

You probably don't and have everything else, starting with the fact that you have not the faintest idea of what you are doing, not listening to what you are told, and blaming the innocent when you are at fault. The first few lines of the first code window have a problem that has to be fixed before you get to the end of the runway. Read reply #1 again.

Thanks for that No wonder the world is in such a state I’m looking to learn you want to beat me with a stick not of any assistance.

If I’m at fault show me how to improve don’t preach because you are cleverer than a 50 year old

Thanks again Nick

Please close this post as I will work it out as always I have no wish to enter in to a debate I was just looking for some one to point out that I could be in error and lead me to a solution. This however seems to be not how it works here

I have tried approx 20 different sketches provided from various places and I get the same result so if it’s me then so be it. The code provided had been altered to try softwareserial but I posted before I removed all of the code.

I probably won’t be visiting this forum again

Thanks all for looking

HeyDJ: I have tried approx 20 different sketches provided from various places and I get the same result so if it’s me then so be it.

Then you need to contact the writers of those tutorials with your problems.

Choose a good tutorial where the author responds to questions.

HeyDJ: I have tried approx 20 different sketches provided from various places

You don't appear to have tried the code in the link I gave you in Reply #1 ?

...R