Control Light ON/OFF Via SMS With SIM900 Module - Visuino Project

by RonFrtek in Circuits > Arduino

168 Views, 1 Favorites, 0 Comments

Control Light ON/OFF Via SMS With SIM900 Module - Visuino Project

Control Light ON/OFF via SMS with SIM900 Module - Visuino Project

In this tutorial, you will learn how to control a light by sending SMS commands using the SIM900 GSM Module and Visuino.

Watch the video!

Special thanks to Finn André Hotvedt for assisting with testing and verifying the correct commands for the SIM900 module.

If you need help with Visuino projects or building a custom prototype using Arduino or other boards, Finn André Hotvedt is a great resource. You can contact him here.

What You Will Need

VisuinoAdvrtisemenArduinoGiga_1 (1).jpg
71UOHZ3zGML.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
power-supply1.png
61wxf8cwgTL.jpg
  1. Iam using in this tutorial a 5V light bulb module, but you can use anything such as LED module, Relay,etc
  2. SIM900 GSM Shield
  3. Arduino UNO
  4. Sim card (You should disable the pin request on the sim card before using it with the GSM shield)
  5. Jumper wires
  6. 5V power supply with enough amps for the shield
  7. Visuino program: Download Visuino


The Circuit

2024-12-24_20-26-56.png
F75JIYMLT5T3M89.jpg
F32142YLT5T3M7V.jpg
  1. Connect the SIM900 GSM Shield to the Arduino


  1. Connect LED module pin [VCC] to Arduino (shield) pin [5V]
  2. Connect LED module pin [GND] Arduino (shield) pin [GND]
  3. Connect LED module pin [IN] to Arduino (shield) Digital pin [2]


  1. Connect with the Jumpers on the shield pins D8(RX) & D7(TX) like you see it on the picture
  2. Make sure that the antenna is connected to the shield
  3. Connect the 5V Power Supply to the shield, and set the switch on the shield to the External Power (See the picture)
  4. Once the Power is connected hold the Power button for 2s
  5. Once the connection with the Network is established the LED will blink every 3s


Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add Components

FWRGU9MLT5T3MMV.png
2024-12-24_20-33-50.png
2024-12-24_20-34-19.png
2024-12-24_20-35-36.png
2024-12-24_20-36-28.png
2024-12-24_20-37-12.png
2024-12-24_20-37-57.png
  1. Add "Software Serial Port" component
  2. Add 2X "Compare Text Value" component
  3. Add 3X "Digital Multi Source" component
  4. Add "Char To Text" component
  5. Add "Start" component
  6. Add "Text Value" component
  7. Add "Toggle(T) Flip-Flop" component

In Visuino Set Components

2024-12-24_20-41-44.png
2024-12-24_20-42-07.png
2024-12-24_20-42-20.png
  1. Double click on the "TextValue1" and in the Elements window
  2. Drag "Set Value" to the left side and in the properties window set "Value" to AT+CMGD=1,4
  3. Drag another "Set Value" to the left side and in the properties window set "Value" to AT+CNMI=1,2,0,0,0
  4. Close the Elements window
  5. Select "CompareValue1" and in the properties window set "Value" to Light ON and "Ignore Case" to True
  6. Select "CompareValue2" and in the properties window set "Value" to Light OFF and "Ignore Case" to True


In Visuino Connect Components

2024-12-24_22-07-04.png
gsm-light.png
  1. Connect "Start1" pin [Out] to "MultiSource1" pin [In]
  2. Connect "SoftwareSerial1" pin [RX] to Arduino Digital pin [7]
  3. Connect "SoftwareSerial1" pin [TX] to Arduino Digital pin [8]
  4. Connect "SoftwareSerial1" pin [Out] to "CharToText1" pin [In]
  5. Connect "CharToText1" pin [Out] to "CompareValue1" pin [In]
  6. Connect "CharToText1" pin [Out] to "CompareValue2" pin [In]
  7. Connect "CompareValue1" pin [Out] to "MultiSource2" pin [In]
  8. Connect "CompareValue2" pin [Out] to "MultiSource3" pin [In]
  9. Connect "MultiSource2" pin [0] to "TFlipFlop1" pin [set]
  10. Connect "MultiSource2" pin [1] to "TextValue1" > "Set Value1": pin [In]
  11. Connect "MultiSource3" pin [0] to "TFlipFlop1" pin [Reset]
  12. Connect "MultiSource3" pin [1] to "TextValue1" > "Set Value1": pin [In]
  13. Connect "MultiSource1" pin [0] to "TextValue1" > "Set Value1": pin [In]
  14. Connect "MultiSource1" pin [1] to "TextValue1" > "Set Value2": pin [In]
  15. Connect "TextValue1" pin [Out] to "SoftwareSerial1" pin [In]
  16. Connect "TFlipFlop1" pin [out] to Arduino digital pin [2]


Optional if you want to monitor response from the GSM shield: Connect "SoftwareSerial1" pin [Out] to Arduino Serial pin [In]

Generate, Compile, and Upload the Arduino Code

Visuino-Compile-UNO.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

When you power the Shield wait a bit for the connection with the network to be established, once the connection is established the LED on the shield will blink every 3s.

Now you can send SMS from the phone using text "Light ON" or "Light OFF" and the LED should turn On or Off.

Congratulations! You have completed your GSM project with Visuino. Also attached is the Visuino project, that I created for this Tutorial. You can download and open it in Visuino: https://www.visuino.eu