I have a project that uses a SIM800L module with an Arduino Nano Every to control four(4) relays with SMS messages and to make a call if one(1) of any six(6) inputs is activated.
The relays are controlled with 2n2222 NPN transistors with current limiting resistors, a diode for voltage spikes protection.
They are connected to the onboard voltage regulator from the Nano Every that can supply 1.1A.
The relays are 80mA at 5v so the 1.1A is more than enough.
The inputs have pulldownresistors for each one.
The SIM800L module has an LM2596 2A voltage regulator set to 4V.
The connections are as follows:
ARDUINO PIN # | Connection
2 - Relay 1
3 - Relay 2
4 - Relay 3
5 - Relay 4
6 - Input 1
7 - Input 2
8 - Input 3
9 - Input 4
10 - Input 5
11 - Input 6
12 - SIM800L TX
13 - SIM800L RX
I am using the SoftwareSerial library where pin 12 is set as RX and pin 13 as TX.
The board does not call when the input is activated.
When troubleshooting with the serial monitor, the signal is registered and everything goes according to plan except the calling. The commands used work on another board that has just inputs.
The board does not register the SMS messages. When troubleshooting with the serial monitor, the messages sent from my phone were never registered on the board.
The commands used for SMS reading work on another board that has only relays.
I made this one as a combination of both.
The code is attached as a file because the message was longer than 9k characters.
A lot of the code is commented out because i only wanted to test calling. There are functions made that can be used for messaging with SMS, notify the user when the signal is removed, and notify a program i made in processing that has a GUI.
Mesana_Gotov.ino (15.1 KB)