Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a GSM module sim800. My module responds to the output given by my PIR sensor and sends sms according to it. My module has got +5V, GND, Rx and Tx pins. What are the pin connections that I have to make?

share|improve this question
up vote 0 down vote accepted

My module has got +5V, GND, Rx and Tx pins. What are the pin connections that I have to make?

TX => RX, RX => TX, that is Arduino TX to module RX, and TX to module RX. If you want to use Serial the pins are 0 for Arduino RX, and 1 for Arduino TX.

If you want to use SoftwareSerial you decide which pins to use (check the documentation for valid pins on your board).

// Use software serial with pin 2 for rx and pin 3 for tx
SoftwareSerial gsm(2,3);

Cheers!

share|improve this answer
    
when I use software serial an error pops up during uploading: 'SoftwareSerial' does not name a type. – Reptile1234 Feb 1 at 11:48
    
#include <SoftwareSerial.h>, arduino.cc/en/Tutorial/SoftwareSerialExample – Mikael Patel Feb 1 at 12:05
    
the rx pin from module to 2 pin of microcontroller? – Reptile1234 Feb 5 at 17:40

You have a choice.

Always:

  • GND => GND
  • +5V => +5V

Then, either:

  • TX => RX (0)
  • RX => TX (1)

and use the hardware UART "Serial", but that then means that uploading new code to your Arduino becomes an arduous task since the usage pins 0 and 1 will interfere with that. So the other option:

  • TX => Any pin
  • RX => Any pin

And then use SoftwareSerial to set up a secondary "bit banged" serial port on the two pins you choose.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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