element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Have a question about Arduino? Ask me!
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1914 replies
  • Subscribers 528 subscribers
  • Views 68472 views
  • Users 0 members are here
  • jeremy_blum
  • expert
  • student
  • arduino
Related

Have a question about Arduino? Ask me!

sciguy14
sciguy14 over 15 years ago

This thread has been closed to new questions.

However, we welcome you to Post Your Questionabout Arduino in the element14 Community Arduino group.  You'll find many fellow members and experts who have just the answer you're looking to find! 

 

Thank You, Your Friends at element14 Community


image

Jeremy Blum

Jeremy is an Electrical and Computer Engineering Student at Cornell University. He has been building microcontroller projects since high school, from a prototype prosthetic hand with a novel control scheme, to a nerf gun that fires at the intruders and uploads their picture to the web.
  • Sign in to reply
  • Cancel

Top Replies

  • billabott
    billabott over 13 years ago in reply to e14 Contributor +2
    @Brendan Your video is somewhat adequate for the intended purpose, however, from an engineer's point of view it is lacking in providing pertinent facts. Such as the part number, data sheet, and source…
  • e14 Contributor
    e14 Contributor over 15 years ago +1
    Jeremy, thanks for your intro videos. I am just getting started myself in Arduino though I have done some simple electronics projects using Atmel chips. Here is an example using ATTiny13 chips. www.youtube…
  • e14 Contributor
    e14 Contributor over 15 years ago +1
    Hi Jeremy I've built a device (see picture) with an Arduino and Ethernet shield that connects to our Network Monitor (Nagios) and moves an arrow to indicate if any of the computers we monitor are not responding…
Parents
  • terryking
    terryking over 15 years ago

    Jeremy, You tutorials are great, and I will be pointing to them from my site. Thanks for taking the time to help so many people!

     

    If you get questions from real beginners, youngsters etc., maybe take a look at: http://yourduino.com 

     

    Regards, Terry King

    On The Red Sea

    terry@yourduino.com.com

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to terryking

    Jeremy,

    The problem i'm having is that im using an arduino uno with a GPRS shield and with the code set up below, i get a continuos sms message on my iphone that i cant stop, also when the wires i have set up on the Gprs are unconnected i still get sms messages on my phone.

    Thanks for your help

     

    //sketch sends a text message if the waterSensor becomes submerged

    #include <SoftwareSerial.h>

     

     

    SoftwareSerial mySerial(7, 8); //gprs shield attached to pins 7 and 8 for software serial connection

     

     

    const String phoneNumber = "+1609xxxxxxx"; //the phone number of the phone to send the text message to, remember to include the country code before the number

    const int sensorPin = 2; //the water sensor is attached to pin 2

    boolean flooded = false; //set the flooded variable to false

    boolean messageSent = false;

     

     

    void setup(){

      mySerial.begin(19200); //19200 is the GPRS baud rate, this must be fixed

      Serial.begin(19200);

      pinMode(sensorPin, INPUT);

      delay(500);

    }

     

     

    void loop(){ //we loop through this area

      if (digitalRead(sensorPin) == HIGH){ //if the sensorPin is high, current is being passed into it, so the sensor must be submerged

        flooded = true; //the basement is therefor flooded

      } else if (digitalRead(sensorPin) == LOW){ //otherwise if it has no current

        flooded = false; //the sensor isn't submerged

        messageSent = false; //we can reset the messageSend, so that if it becomes submerged again, we can end another text message

      }

     

      if ((messageSent == false) && (flooded == true)){ //if we havent yet sent a message, and the sensor is submerged

        sendTextMessage(phoneNumber, "Your basement is flooding [Arduino]"); //we send the text message

        messageSent = true; //we set messageSent to true so that we don't keep sending text messages (this woulld cost a lot of money)

      }

    }

     

     

    void sendTextMessage(String phone, String data){ //sends a text message to phone, containing data

    mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode

    delay(100);

    mySerial.println("AT + CMGS = \"" + phone + "\"");//send sms message, be careful need to add a country code before the cellphone number

    delay(100);

    mySerial.println(data);//the content of the message

    delay(100);

    mySerial.println((char)26);//the ASCII code of the ctrl+z is 26

    delay(100);

    mySerial.println();

    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • e14 Contributor
    e14 Contributor over 12 years ago in reply to terryking

    Jeremy,

    The problem i'm having is that im using an arduino uno with a GPRS shield and with the code set up below, i get a continuos sms message on my iphone that i cant stop, also when the wires i have set up on the Gprs are unconnected i still get sms messages on my phone.

    Thanks for your help

     

    //sketch sends a text message if the waterSensor becomes submerged

    #include <SoftwareSerial.h>

     

     

    SoftwareSerial mySerial(7, 8); //gprs shield attached to pins 7 and 8 for software serial connection

     

     

    const String phoneNumber = "+1609xxxxxxx"; //the phone number of the phone to send the text message to, remember to include the country code before the number

    const int sensorPin = 2; //the water sensor is attached to pin 2

    boolean flooded = false; //set the flooded variable to false

    boolean messageSent = false;

     

     

    void setup(){

      mySerial.begin(19200); //19200 is the GPRS baud rate, this must be fixed

      Serial.begin(19200);

      pinMode(sensorPin, INPUT);

      delay(500);

    }

     

     

    void loop(){ //we loop through this area

      if (digitalRead(sensorPin) == HIGH){ //if the sensorPin is high, current is being passed into it, so the sensor must be submerged

        flooded = true; //the basement is therefor flooded

      } else if (digitalRead(sensorPin) == LOW){ //otherwise if it has no current

        flooded = false; //the sensor isn't submerged

        messageSent = false; //we can reset the messageSend, so that if it becomes submerged again, we can end another text message

      }

     

      if ((messageSent == false) && (flooded == true)){ //if we havent yet sent a message, and the sensor is submerged

        sendTextMessage(phoneNumber, "Your basement is flooding [Arduino]"); //we send the text message

        messageSent = true; //we set messageSent to true so that we don't keep sending text messages (this woulld cost a lot of money)

      }

    }

     

     

    void sendTextMessage(String phone, String data){ //sends a text message to phone, containing data

    mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode

    delay(100);

    mySerial.println("AT + CMGS = \"" + phone + "\"");//send sms message, be careful need to add a country code before the cellphone number

    delay(100);

    mySerial.println(data);//the content of the message

    delay(100);

    mySerial.println((char)26);//the ASCII code of the ctrl+z is 26

    delay(100);

    mySerial.println();

    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube