-1

Can I connect a Bluetooth module to usual digital pins, other than D0/D1 (RX/TX) pins as the shield is already using the D0 and D1 pins?

My Bluetooth module is an HC-05 MODULE.

2
  • Please be more specific. What Bluetooth module? What do you mean as in "0,1 pins" in comparison to "normal digital pins"? You mean IO pins from the Arduino instead of ICSP? Commented Aug 14, 2016 at 1:31
  • Google SoftwareSerial Commented Aug 14, 2016 at 8:43

2 Answers 2

1

Classic Arduinos use pins 0 and 1 for serial communication to the host computer, so it is problematic to connect a bluetooth module there anyway - it can be done, but basically means that programming the board and communicating with it by serial will not work (at least not reliably) until the interfering bluetooth module is removed or disabled. For these boards you need to use a software serial instance to talk to the module, and you can put it on most any digital pins.

ATmega32u4 boards like the Leonardo do not have debug/programming on pins 0 and 1 but do have a hardware UART there, so those would be the best choice for a bluetooth module, but you can still use software serial.

The Arduino Mega has additional hardware serial pins that would be good choices, but you can use software serial.

Various ARM based boards with Arduino ports typically have additional hardware serial pins which you should use. Software serial may or may not be an option on these (it's not that an implementation cannot exist, but that software serial is generally disadvantageous, so when a chip has more hardware UARTs that particular function may not be ported).

1

you can define pin and can use after defining int RX=any pin TX=any pin

1
  • Define any two PWM to RX/TX it will work do not use 0,1 it will give serial communication error... Commented Dec 26, 2019 at 6:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.