Connecting a Bluetooth module to an Arduino Pro

Hello,

We are trying to get our Bluetooth module (a JY-MCU, see JY MCU - Google Search) to work with a 5V Arduino Pro 328 (https://www.sparkfun.com/products/10915).

We have a C++ openFrameworks app that communicates with the Arduino using Bluetooth or USB as a serial port. It uses this library: http://www.openframeworks.cc/documentation/serial/ofSerial.html. The app sends a value over serial to the Arduino. The Arduino listens for these values and uses them to control the brightness of an LED.

Our setup works perfectly with an Arduino Uno. With the Pro we get power on the Bluetooth module (light turns on), but no communication at all.

Wiring:

Bluetooth RX > Arduino TX 1
Bluetooth TX -> Arduino RX 0

Code:

int ledPin = 11;
 
void setup(){
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}
 
void loop(){
  while(Serial.available() > 0){
    byte val = Serial.read();
    Serial.print("Receiving value from Bluetooth: ");
    Serial.println(val);
    analogWrite(ledPin, val);
  }  
}

Results of our tests:

  • Arduino Uno + USB as serial port: works
  • Arduino Uno + Bluetooth as serial port: works
  • Arduino Pro + USB as serial port: works
  • Arduino Pro + Bluetooth as serial port: doesn't work

Our conclusion was that we were missing something in the connection between Bluetooth and the Pro. Any ideas?

Thanks,
Bert

Have you tried just simply echoing the vale you receive from serial back over serial. You sketch currently sends about 35 bytes for every single byte it receives.
Is this the exact same sketch as you used for the UNO?
You do have an LED connected to pin 11 as the on board LED is pin 13.

Riva:
Have you tried just simply echoing the vale you receive from serial back over serial. You sketch currently sends about 35 bytes for every single byte it receives.
Is this the exact same sketch as you used for the UNO?
You do have an LED connected to pin 11 as the on board LED is pin 13.

Thanks for your reply.

We tried echoing, yes.

The sketch is exactly the same for the Uno.

There was an LED connected to pin 11. Code controls that pin, not the onboard one.

A couple of ideas.
Have you tried swapping the RX/TX pins over. They seem reversed on the Pro schematic compared to the UNO schematic.

Maybe the regulator on the Pro cannot handle the current drain of the BT module and the other components connected to it. (Unlikely but you never know)

  • Arduino Uno + USB as serial port: works
  • Arduino Uno + Bluetooth as serial port: works
  • Arduino Pro + USB as serial port: works
  • Arduino Uno + Bluetooth as serial port: doesn't work

I assume the last entry is a typo and should be 'Arduino Pro + Bluetooth as serial port: doesn't work'

Riva:
A couple of ideas.
Have you tried swapping the RX/TX pins over. They seem reversed on the Pro schematic compared to the UNO schematic.

Swapping the pins didn't seem to have any effect.

Riva:
Maybe the regulator on the Pro cannot handle the current drain of the BT module and the other components connected to it. (Unlikely but you never know)

That sounds interesting. How could we test this?

Riva:
I assume the last entry is a typo and should be 'Arduino Pro + Bluetooth as serial port: doesn't work'

Yes, thanks for spotting that. Corrected in original post.

I'm running out of ideas here.
How do you connect the BT module, is it connected to the D0/D1 pins on the board edge or to the FTDI header TX/RX pins.
How are you powering the board?

The only way I can see to power the board and bypass the onboard 150mA voltage regulator is to use The FTDI power connector 5/3.3V pin or either VCC pin. **Disclaimer You must be sure the supply is 5V regulated.