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?
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);
You have a choice.
- GND => GND
- +5V => +5V
- 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.