{"id":161,"date":"2013-06-16T11:14:28","date_gmt":"2013-06-16T11:14:28","guid":{"rendered":"http:\/\/www.pyrobrit.co.uk\/wordpress\/?p=161"},"modified":"2013-06-23T22:53:17","modified_gmt":"2013-06-23T22:53:17","slug":"arduino-in-at-the-deep-end","status":"publish","type":"post","link":"https:\/\/www.pyrobrit.co.uk\/wordpress\/2013\/06\/arduino-in-at-the-deep-end\/","title":{"rendered":"Arduino in at the deep end"},"content":{"rendered":"<p>I purchased the Arduino Duemilanove and GSM shield back in 2011 with the sole intention of building an alarm system for my Garage.\u00a0 The method was quite simple.\u00a0 Use Arduino to sense for break-in using IR and magnetic operated (reed) switches and send text messages to a preset phone number .\u00a0 I also wanted to arm and disarm the system using text messages.<\/p>\n<p>So my first test was to see if I could get the GSM shield to communicate with our phone provider which is O2 in the UK.<!--more--><\/p>\n<p>These are the two modules I&#8217;m using. \u00a0A Seeedstudio &#8220;Seeeduino V3&#8221; which is an Arduino Duemilanove clone and a iteadtdudio IComSat GSM shield.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"Seeeduino V3.0\" src=\"http:\/\/www.seeedstudio.com\/depot\/images\/product\/Seeeduino%20V3.0%20Atmega%20328P.jpg\" width=\"336\" height=\"252\" \/><a href=\"http:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1.jpg\"> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-166\" alt=\"IComSat v1.0 GSM module\" src=\"http:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-297x300.jpg\" width=\"297\" height=\"300\" srcset=\"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-297x300.jpg 297w, https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-96x96.jpg 96w, https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-24x24.jpg 24w, https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-36x36.jpg 36w, https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-48x48.jpg 48w, https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1-64x64.jpg 64w, https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-content\/uploads\/2013\/06\/icomsat-1-1.jpg 1016w\" sizes=\"auto, (max-width: 297px) 100vw, 297px\" \/><\/a><\/p>\n<p>Much to my annoyance the GSM board is updated whilst mine is still in the post from China.\u00a0 Pictured above is the V1.0 version but the V1.1 currently on sale now has Audio in and out.\u00a0 This would be quite useful as having been alerted to a break-in, you could then dial up the alarm system and listen in on the scum or record to SD card the audio transcript.<\/p>\n<p>Sounds simple really but blindly plugging this lot together and uploading some sample Arduino sketches did not produce any favourable results. Long story short was that Arduino 1.0 was released and the IComSat GSM library only worked in Arduino v0.23 or below. That foxed me for a while. Secondly, just inserting an O2 pay as you go sim card seemed to do nothing. At least the serial monitor was showing the Arduino booting up and the GSM shield failing to register the sim.\u00a0 Mind you it failed to register any kind of sim I placed into the device.<\/p>\n<h1>Success!<\/h1>\n<p>Two years later (other projects and kids) I dusted off the modules and tried again.\u00a0 Here is what I used to make this work and the same can be used for the IComSat v1.1 board too.<\/p>\n<ul>\n<li>Installed Arduinio v1.05<\/li>\n<li>Added some credit to the prepay Sim card.\u00a0 It just would not repond at all unless the card had some credit on it.<\/li>\n<li>Grabbed the latest GSM library from here:\n<ul>\n<li><a title=\"IComSat GSM Shield Library\" href=\"ftp:\/\/imall.iteadstudio.com\/IM120417009_IComSat\/Lib_GSM_Shield.zip\" target=\"_blank\">ftp:\/\/imall.iteadstudio.com\/IM120417009_IComSat\/Lib_GSM_Shield.zip<\/a><\/li>\n<li>this one also works well too <a title=\"Arduino GSM shield library\" href=\"http:\/\/gsm-shield-arduino.googlecode.com\" target=\"_blank\">http:\/\/gsm-shield-arduino.googlecode.com<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Ignore the GSM shield documentation on baud rate<\/li>\n<li>Ignore the GSM shield documentation on the Tx\/Rx pins to use<\/li>\n<\/ul>\n<h1>Baud rate<\/h1>\n<p>After loading the example sketch from whichever library you use, you will find the baud rate for serial monitoring to be set to 9600.\u00a0 That&#8217;s fine.\u00a0 It&#8217;s the next line that sets the baud between the Arduino and GSM shield that is wrong.\u00a0 This will be down to experimentation.\u00a0 Some people on the Internet have found 19200 to work but for me on my v1.0 shield it had to be set to 2400.\u00a0 Can it be changed to a higher speed?\u00a0 I don&#8217;t know yet.<\/p>\n<pre style=\"padding-left: 30px;\">Serial.begin(9600); \/\/baud rate to serial monitor\r\ngsm.TurnOn(2400); \/\/module power on with 2400 baud rate set<\/pre>\n<p>or<\/p>\n<pre style=\"padding-left: 30px;\">\/\/Serial connection.\r\nSerial.begin(9600);\r\nSerial.println(\"GSM Shield testing.\");\r\n\/\/Start configuration of shield with baudrate.\r\ngsm.begin(2400)<\/pre>\n<p>Above are the two snippets of code depending on the library you use.<\/p>\n<h1>Tx\/Rx pins<\/h1>\n<p>The documentation says pins 0 and 1. Nope! Doesn&#8217;t work for me and again according to the Internet blogs, the pins to use are 2 and 3.<\/p>\n<p>So setup Tx to pin 2 and Rx to pin 3 using the jumpers on the GSM shield and it will all kick into life.<\/p>\n<h1>Time<\/h1>\n<p>Now that I have a bit of time on my hands, I can start to work on the detection side of this project&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I purchased the Arduino Duemilanove and GSM shield back in 2011 with the sole intention of building an alarm system for my Garage.\u00a0 The method was quite simple.\u00a0 Use Arduino to sense for break-in using IR and magnetic operated (reed) switches and send text messages to a preset phone number .\u00a0 I also wanted to <a href='https:\/\/www.pyrobrit.co.uk\/wordpress\/2013\/06\/arduino-in-at-the-deep-end\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[6],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-arduino","category-6-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":22,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":176,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/161\/revisions\/176"}],"wp:attachment":[{"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pyrobrit.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}