Greetings, I’m a (sort of) newbie who had his first taste of arduino couple of weeks ago. I want to make sms-based irrigation system, and for that purpose I bought cheapo SIM900 module from ebay. I had serious problems communicating with it (factory auto-baud…).
Anyways sms-based control is finished, and I thought it would not be a bad idea to share the code, because I think there a lot of people out there who are trying to make something useful with arduino and SIM900, and I think this is more or less complete system. Second reason is that I would like some useful comments from experienced members. My code does not use String type at all, I had serious problems with it, so text is C-type char.
The code is based on two invaluable tutorials: tronix and Serial Input Basics which are a must to read.
My SMS controller has following usage scenario:
- Send SMS: “#boss” and the number who sent it will be written in EEPROM, and arduino will only communicate with this number.
- Send SMS: “#start” and OUTPUT pin 10 will be set to HIGH immediately
- Send SMS: “#shutdown” and OUTPUT pin 10 will be set to LOW immediately
- Send SMS: “#start 19” and OUTPUT pin 10 will be set to HIGH immediately and kept HIGH for 19 minutes. Of course you can set the number of minutes as you wish in SMS.
State of OUTPUT pin 10, and timers is saved every 5 minutes into EEPROM, so the system is more or less capable of surviving power outages, and timer will resume, or previous state will be restored.
Only downside of sketch is that it does not automaticaly turn on the SIM900, because mine is not capable of that, so I’m not able to test it.
Comments are very very very welcome…
SMSbasedSIM900.ino (6.83 KB)