Arduino Uno and GSM Shield with Sensor Issue

Hello,

I built a unit which reads moisture and communicates the data with an Arduino GSM Shield. The sensor returns a number between 0 and 10,000 based on moisture. The sensor works, I receive valid readings. I programmed the GSM part of the unit to do the following:

  • Send a call with no voice/sound to a specified phone number if the moisture reading hits a certain value
  • If a text of "S" or "s" is received, send a text to the specified phone number with the sensor reading(also includes a temp., hum. reading)
  • If a numerical text is received (i.e. 500), set the new call point to that number

I built and programmed the unit based on the above design and it worked great. The unit fully function.

Then, after about three days using it, turning it on and off multiple times, the text functionality became buggy. Anytime the unit was turned off and then back on (no power, then power) an initial text with the sensor readings would be sent. However, a text of "S","s" or a number would not return another text or reset the call point. The unit would still call when the moisture value reached the initial call point.

I have included the code as an attachment(both ino and txt) because it was too long for the post.

I think the problem may involve memory but I have not found a way to solve the problem. I would appreciate any help or advice.

Justin

GSMsensor.ino (7.43 KB)

GSM with Sensor Code.txt (7.71 KB)