0

I couldn't find anything on this topic.

Task: to connect sensors to Arduino board via Bluetooth module, process the received data and then send the data to server via GSM module.

Question: Is it possible to connect both of these modules to 1 Arduino board? If I'm not wrong, Arduino Uno has only one pair of Rx Tx pins, while for these two modules each has its own pairs on Rx Tx pins.

I need to know this before ordering them. So, please help

2
  • It sounds to me that a Raspberry Pi with a BT and GSM dongle would be better/easier/cheaper in this situation.
    – Gerben
    Oct 12, 2016 at 15:26
  • Or a cheap cellphone with a custom app.
    – Gerben
    Oct 12, 2016 at 15:27

1 Answer 1

1

Take a look at the SoftwareSerial library which allows other pins to be used for Serial at speeds <= 57600

https://www.arduino.cc/en/Reference/SoftwareSerial

4
  • This is still problematic, as typically only one instance is supported, so the hardware serial must be repurposed from debug/uploading, which creates a lot of development headaches. Essentially a classic Arduino is not the right choice for this. Even something like a Leonardo would be better. Oct 12, 2016 at 23:24
  • Hi @Chris, a board such as a mega2560 would better because it has a number of extra hardware serial ports but the question was for the Uno. Marat confirmed he has the one pair of tx/rx working so second port via SoftwareSerial will work well. Oct 14, 2016 at 15:27
  • It may work, but only problematically - that single hardware serial is usually reserved for communication between the ATmega and development system. Using it for communicating with something else means losing that, and having to take steps to de-conflict it, ie, providing a way to disconnect the peripheral during programming or using a different programming method such as ISP than the bootloader which is typically used with an Uno. Oct 14, 2016 at 15:49
  • There are plenty of solutions I know of on the main hardware serial that don't affect upload. I agree it's a bit cumbersome having to disconnect rx/tx during upload but it's been the default workflow for many users for a long time. Plus software serial tx (1 pin) for debug is okay alongside other software serial. Quite often the bluetooth and gsm code can perform tasks on demand and at separate times allowing them both to use SoftwareSerial leaving the main port free. It's only a problem if the two soft connections are streaming data over the tx at the same time. So does depend on the usage. Oct 14, 2016 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.