Bluetooth HC-05 interferes with MPR121

Hello,

im currently working on a project, which uses the capacitive sensor "MPR121" and the Bluetooth Module HC-05 on the Arduino Pro Mini.

The MPR121 itself is working, but as soon as I add the HC-05 Bluetooth module to the Arduino, the MPR constantly outputs random data, without me touching the pins of the MPR.
The problem occurs either when the HC-05 is only connected to the same power source and not used at all to transfer data or when the HC-05 is connected to a seperate power source and connected to transfer data.
I am using 3.3V.

The code I'm using at this moment for testing only the MPR121 functionality is the example from the MPR121 library "Adafruit", which isn't even featuring the bluetooth module:

#include <Wire.h>
#include "Adafruit_MPR121.h"

// You can have up to 4 on one i2c bus but one is enough for testing!
Adafruit_MPR121 cap = Adafruit_MPR121();

// Keeps track of the last pins touched
// so we know when buttons are 'released'
uint16_t lasttouched = 0;
uint16_t currtouched = 0;

void setup() {
  while (!Serial);        // needed to keep leonardo/micro from starting too fast!

  Serial.begin(9600);
  Serial.println("Adafruit MPR121 Capacitive Touch sensor test"); 
  
  // Default address is 0x5A, if tied to 3.3V its 0x5B
  // If tied to SDA its 0x5C and if SCL then 0x5D
  if (!cap.begin(0x5A)) {
    Serial.println("MPR121 not found, check wiring?");
    while (1);
  }
  Serial.println("MPR121 found!");
}

void loop() {
  // Get the currently touched pads
  currtouched = cap.touched();
  
  for (uint8_t i=0; i<12; i++) {
    // it if *is* touched and *wasnt* touched before, alert!
    if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
      Serial.print(i); Serial.println(" touched");
    }
    // if it *was* touched and now *isnt*, alert!
    if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) {
      Serial.print(i); Serial.println(" released");
    }
  }

  // reset our state
  lasttouched = currtouched;

  // comment out this line for detailed data from the sensor!
  return;
  
  // debugging info, what
  Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t\t 0x"); Serial.println(cap.touched(), HEX);
  Serial.print("Filt: ");
  for (uint8_t i=0; i<12; i++) {
    Serial.print(cap.filteredData(i)); Serial.print("\t");
  }
  Serial.println();
  Serial.print("Base: ");
  for (uint8_t i=0; i<12; i++) {
    Serial.print(cap.baselineData(i)); Serial.print("\t");
  }
  Serial.println();
  
  // put a delay so it isn't overwhelming
  delay(100);
}

Thanks in advance for any help!

What are you using for a power supply?
What is the power supply requirement of your HC-05?
How is bluetooth wired to Arduino?

Thanks for your reply!

Nick_Pyner:
What are you using for a power supply?
What is the power supply requirement of your HC-05?
How is bluetooth wired to Arduino?

Power through mini USB adapter.
Requirement is 3.3V as far as I can tell.

Wiring: VCC to VCC
GND to GND
RXD to 9
TXD to 8

I'm surprised you get anything at all. Are you sure of your comms connections? Your code does not include software serial, yet the Rx,Tx is to pins 8,9, which rather suggests software serial.. My 5v Pro Mini uses pins 0,1 for bluetooth, like most any other Arduino.
What sort of breakout board is the HC-05 on, if any?

Colleague of OP here

We haven't included the HC-05 in the code yet (it works, though). The problem is that just wiring the HC to the Arduino in any way (without coding) interferes with the MPR data we get via USB.

As for the HC-05, we are using one that looks like this: https://botland.com.pl/19754-thickbox_default/modul-bluetooth-hc-05-gw-040.jpg

Sorry if I misunderstood you, you may have already noticed, we are not exactly experienced with all this stuff.

In case you need it, here's the wiring of the MPR:
GND -> GND
3.3 V -> VCC
SDA -> A4
SCL -> A5

Thanks in advance

OK. I know nothing about the MPR121 but it would appear to have nothing whatsoever to do with Bluetooth, and that would apply irrespective of you using software serial or proper hardware serial.

I'm afraid I can only guess that the wiring is not as kosher as you think. The most obvious place to check is the grounds.