- Continuum – Slow Motion LED Art DisplayPosted 11 seconds ago
- The Interactive Storytelling RadioPosted 1 day ago
- ESP 32 ICONS AND ANIMATIONSPosted 2 days ago
- Autonomous Fire Fighting Robot With Self Finding FlamesPosted 3 weeks ago
- Automatic tank filling at homePosted 3 weeks ago
- Automatic chess board designPosted 3 weeks ago
- Automated Hydroponic SystemPosted 3 weeks ago
- Arduino HangmanPosted 3 weeks ago
- All Band Receiver With Si4735 (FM / RDS, AM and SSB) With ArduinoPosted 3 weeks ago
- A Super Easy Security Camera With the ESP32 CAMPosted 4 weeks ago
IKEA SMS lamp with GSM shield
We create a lamp controlled by SMS using a GSM shield, a RGB shield and a Arduino UNO.
Due to the simplicity of these boards, simply plug one over the other and connect a strip led to have a lighting effect.
Then sending normal text messages from any phone, you can turn on and choose the color to set.
The scketch check the text of the received message, if the SMS contains a character, it follows on the corresponding color.
It ‘also provided a fader functions can be called with the character F
This is the list commands:
R to set RED
G to set GREEN
B to set BLUE
Y to set YELLOW
O to set ORANGE
P to set PURPLE
W to set WHITE
F to set the fader function
This is just an example of the possible applications of the GSM / GPRS shield.
You can for example control the home lighting with a simple text message, or receive an SMS in case of alarm.
In addition, the SIM900 has the capacity to also decode DTMF tones, so you can call this in the sim GSM shield and switch loads directly from the telephone keypad.
The complete library it contains many other functions through which you can make calls, connect to the Internet, send and receive SMS.
This is the simple firmware in Arduino.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
//GSM Shield for Arduino //www.open-electronics.org //this code is based on the example of Arduino Labs #include "SIM900.h" #include "sms.h" #include "SoftwareSerial.h" #include "sms.h" SMSGSM sms; int red = 10; // RED LED connected to PWM pin 3 int green = 5; // GREEN LED connected to PWM pin 5 int blue = 6; // BLUE LED connected to PWM pin 6 int r=50; int g=100; int b=150; int rup; int gup; int bup; boolean started=false; char smsbuffer[160]; char n[20]; int fader=1; int inc=10; void setup() { //Serial connection. Serial.begin(9600); Serial.println("GSM Shield testing."); //Start configuration of shield with baudrate. if (gsm.begin(2400)){ Serial.println("\nstatus=READY"); started=true; } else Serial.println("\nstatus=IDLE"); if(started){ delsms(); } }; void loop() { int pos=0; //Serial.println("Loop"); if(started){ pos=sms.IsSMSPresent(SMS_ALL); if(pos){ Serial.println("IsSMSPresent at pos "); Serial.println(pos); sms.GetSMS(pos,n,smsbuffer,100); Serial.println(n); Serial.println(smsbuffer); if(!strcmp(smsbuffer,"R")){ Serial.println("RED"); r=255; g=0; b=0; } if(!strcmp(smsbuffer,"G")){ Serial.println("GREEN"); r=0; g=255; b=0; } if(!strcmp(smsbuffer,"B")){ Serial.println("BLUE"); r=0; g=0; b=255; } if(!strcmp(smsbuffer,"P")){ Serial.println("PURPLE"); r=255; g=0; b=255; } if(!strcmp(smsbuffer,"Y")){ Serial.println("YELLOW"); r=255; g=255; b=0; } if(!strcmp(smsbuffer,"O")){ Serial.println("ORANGE"); r=255; g=165; b=0; } if(!strcmp(smsbuffer,"W")){ Serial.println("WHITE"); r=255; g=255; b=255; } if(!strcmp(smsbuffer,"F")){ Serial.println("FADER"); fader=1; r=50; g=100; b=150; } else { fader=0; } rgb(r, g, b); delsms(); } if(fader){ funcfader(); } } }; void delsms(){ Serial.println("delsms"); for (int i=0; i<10; i++){ //do it max 10 times int pos=sms.IsSMSPresent(SMS_ALL); if (pos!=0){ Serial.print("\nFind SMS at the pos "); Serial.println(pos); if (sms.DeleteSMS(pos)==1){ Serial.print("\nDeleted SMS at the pos "); Serial.println(pos); } else { Serial.print("\nCant del SMS at the pos "); Serial.println(pos); } } } } void funcfader(){ if (rup==1){r+=1;} else{r-=1;} if (r>=255){rup=0;} if (r<=0){rup=1;} if (gup==1){g+=1;} else{g-=1;} if (g>=255){gup=0;} if (g<=0){gup=1;} if (bup==1){b+=1;} else{b-=1;} if (b>=255){bup=0;} if (b<=0){bup=1;} rgb(r, g, b); } void rgb(int r, int g, int b) { |
1 2 3 4 5 6 7 8 9 10 11 |
if (r>255) r=255; if (g>255) g=255; if (b>255) b=255; if (r<0) r=0; if (g<0) g=0; if (b<0) b=0; analogWrite(red, r); analogWrite(green, g); analogWrite(blue, b); } |

Pingback: IKEA SMS lamp with GSM shield | http://64.37.52.42/~feedwiki/Grabfee/