
This project builds a text-message-controlled switch to turn a 12V lamp on or off from anywhere with cellular coverage, with no internet connection needed.
Components needed
An Arduino Uno board, a SIM900 GSM shield, a single-channel 5V relay, a 12V lamp, and a suitable external power supply.
Wiring it up
The SIM900 shield mounts directly onto the Arduino board, and controls a single-channel relay via a digital pin (pin 12 in this project), with the relay safely isolating the 12V lamp circuit from the low-voltage control circuit.
How it works: parsing text commands
The code watches incoming messages, searching for three specific keywords via string comparison: the word "ON," which activates the relay by setting pin 12 to LOW to close the 12V lamp circuit; the word "OFF," which does the opposite by setting the pin to HIGH to cut power to the lamp; and the word "STATE," which makes the system reply with a confirmation message showing the lamp's current status (on or off). The code keeps a variable tracking the lamp's state continuously to ensure an accurate reply when "STATE" is requested.
You can find the SIM900 shield and relay modules at Juthour Tech.
Leave your comment