HC-05 bluetooth module

hello everyone,
for a project i am using a HC-05 module but it does not receive any data when i send data by apps like arduino bluetooth control. when i use remote xy it does receive data and switches a relay, but when it has to switch multiple relays at one time it open all of them when i need for example only 3 to switch. someone who knows what the problem could be?? thank you to the one who can really help me.

/*
   -- gip bluetooth --
   
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.13 or later version 
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                   
     - for ANDROID 4.13.13 or later version;
     - for iOS 1.10.3 or later version;
    
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.    
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG    

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL

#include <SoftwareSerial.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


#include <RemoteXY.h>

// RemoteXY GUI configuration  
#pragma pack(push, 1)  
uint8_t RemoteXY_CONF[] =   // 138 bytes
  { 255,7,0,0,0,131,0,17,0,0,0,31,1,106,200,1,1,7,0,2,
  3,8,44,22,0,2,26,16,16,79,78,0,79,70,70,0,2,56,9,44,
  22,0,2,26,31,31,79,78,0,79,70,70,0,2,5,45,44,22,0,2,
  26,31,31,79,78,0,79,70,70,0,2,56,46,44,22,0,2,26,31,31,
  79,78,0,79,70,70,0,2,6,84,44,22,0,2,26,31,31,79,78,0,
  79,70,70,0,2,57,84,44,22,0,2,26,31,31,79,78,0,79,70,70,
  0,2,30,124,44,22,0,2,26,31,31,79,78,0,79,70,70,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t switch_01; // =1 if switch ON and =0 if OFF
  uint8_t switch_02; // =1 if switch ON and =0 if OFF
  uint8_t switch_03; // =1 if switch ON and =0 if OFF
  uint8_t switch_04; // =1 if switch ON and =0 if OFF
  uint8_t switch_05; // =1 if switch ON and =0 if OFF
  uint8_t switch_06; // =1 if switch ON and =0 if OFF
  uint8_t switch_07; // =1 if switch ON and =0 if OFF

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;   
#pragma pack(pop)
 
/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_SWITCH_01 4
#define PIN_SWITCH_02 5
#define PIN_SWITCH_03 6
#define PIN_SWITCH_04 7
#define PIN_SWITCH_05 8
#define PIN_SWITCH_06 9
#define PIN_SWITCH_07 10


void setup() 
{
  RemoteXY_Init (); 
  
  pinMode (PIN_SWITCH_01, OUTPUT);
  pinMode (PIN_SWITCH_02, OUTPUT);
  pinMode (PIN_SWITCH_03, OUTPUT);
  pinMode (PIN_SWITCH_04, OUTPUT);
  pinMode (PIN_SWITCH_05, OUTPUT);
  pinMode (PIN_SWITCH_06, OUTPUT);
  pinMode (PIN_SWITCH_07, OUTPUT);
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_SWITCH_01, (RemoteXY.switch_01==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_02, (RemoteXY.switch_02==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_03, (RemoteXY.switch_03==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_04, (RemoteXY.switch_04==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_05, (RemoteXY.switch_05==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_06, (RemoteXY.switch_06==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_07, (RemoteXY.switch_07==0)?LOW:HIGH);
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay() 


}

If somebody shall be able to help you have to provide more information

How does the smartphone interface look like?
post a screenshot

From just looking at the code I would say
whenever you press a button the related OUTPUT switches LOW:HIGH
and only that one particular output that is connected to that oneparticular button that you tap on in the remoteXY-interface is switched LOW:HIGH

You will have to describe in much more details
like this:

If I tap on button 4 in my remoteXY-user-interface on the smartphone
the following OUTPOUTs change state from ...... to state .......

When using hardware like multiple relays this could be a hardware-problem
how do you power the relays?
did you connect ground of what exact type of microcontroller to ground of the relays?
Is this a relay-board or simgular relays?
post a datasheet of the relay-board?

in the schematics i use a wemos but as for now it is an Uno R3 with HC-05 module.
pin 0 = not in use
pin 1 = not in use
pin 2 = rx pin HC-05
pin 3 = tx pin HC-05
pin 4 = relay 1
pin 5 = relay 2
pin 6 = relay 3
pin 7 = relay 4
pin 8 = relay 5
pin 9 = relay 6
pin 10 = relay 7
pin 11 = relay 8
pin 12 = relay 9

the sensor's in the schematics are not in use but will be later at the analog pins

gip_schema_kobeasselberghs_2023_2024.pdf (136,9 KB)

posted e-plan scematics and the interface of the app

could you maybe make a small example??

You seem to have not understand what I was asking you.

I am asking you that you shall describe what behaviour of your current code do you observe.

I have numbered the slide-switches on the screenshot of your remoteXY-App

Assuming App-slide-switch 1 changes relay 1
Assuming App-slide-switch 2 changes relay 2
...
Assuming App-slide-switch 7 changes relay 7

This means user @asskob06 posts an answer similar to this

Situation at powering up my Arduino-Uno R3 with bluetooth-module
all relays are switched ON

If I change the slide-switch 1 from on-position to off-position

I observe this behaviour of the relays:

relay 1.....
relay2....
etc.

yeah this is how it works

So does this mean the problem is solved?

no because when i use 1 slide button 1 relay switches but when i use 2 slide button's all the relay's switch

You seem to think the arduino-Forum is similar to WhatsApp or SnapChat.
Well if yiou want to take 100 posts until your problem is solved go on with such short postings.

If you want the problem solved within less than 10 posts
write down a very detailed posting that describes very detailed what you observe

I insist on this detailed description.

a last example:
I use this code

your real actual code that does compile

On powerup of the arduino Uno R3 with HC05-bluetooh module connected
all relays are switched ............

If I move slideswitch 2 from ....-position to .......-position
relay1 does.........
relay2 does.........
relay3 does .........
relay4 does .........
relay5 does .........
relay6 does .........
relay7 does .........

If you think your hands will ache to much after writing so many letters
wait for somebody else to answer

sorry i am just new to this, i'll do my best to provide you with the info you need but i also don't really know anything about using the bluetooth module, i just want it so that when i switch button 1 relay 1 goes on and not all the relay's at the same time.

this code does compile but it does not what i ask from it, i just want an answer from someone who can friendly and easy explain to me what can be wrong. or someone who can give me and example of an app that does what i ask from it

The trouble with some libraries (e.g. RemoteXY.h) can be trying to find someone who knows such a thing well enough to be able to have a conversation about it.

There are BT serial terminal apps that present simple buttons that can result a text stream (that the user determines).

example of some apps?? i have already tried using apps like arduino bluetooth controller but that just does nothing at all

Look for the bluetooth serial terminal by Kai Morich.
It's not going to work with your RemoteXY.h sketch.
For example, you'd set up a button on it to send "R1o".
Your Arduino would take that in and decode it as relay No.1 off.
("R2O" → relay No.2 on)
("R1O" → relay No.1 on)

Taking this approach will involve good knowledge of C-strings or Arduino Strings.

You can configure the buttons of this bluetooth-app to send character-sequences.
Like @runaway_pancake suggested.

The advantage of this approach is that almost all users will be able to help you because receiving serial character-sequences is a standard-thing that is done all the time.
remoteXY is one of a dozen smartphone-apps only a few users know well.

You haven't described what you want to switch on/off in the end.
Depending on factors like

  • switch with a single or multiple devices (multiple smartphones / tablets)
  • local WiFi is present where you want to switch the relays
  • distance between sender and receiver

it might well be that a different technolgy is much better suited

I want to use valve's for water distrubution. The valve's will be controlled by the NO contact of the relay, there is only one valve wich has a motor to let it go left or right. Works by HC-05 module but it has to work in a little bit of time on wifi at home. They will be used by only 1 device at a time. There will be a wifi amplifier placed next to the whole project. Then i should be able to manage it from wherever i am.

would this code work with the app you recommended??

What code ?

You tagged another forum of mine so i thought you would mean the code that i put in there?