Showing posts with label 1wire arduino. Show all posts
Showing posts with label 1wire arduino. Show all posts

Thursday, October 24, 2013



GPS Tracker Arduino


You will need:

Hardware:

1 Arduino board
1 SIM900 GSM Shield
1 GPS Receiver (Optional)
1 NPN transistor
2 220 Ohm resistors
RS232 to TTL or USB to TTL  (Optional)
Full Internet Access SIM Card


Software:

Arduino sketch
GPS Simulator
GPS Simulator Route file
GPS-Trace Account (FREE)
Bray's terminal



Documentation:

GSM Module from geeetech

SIM900



Step by Step guide


Step 1

Connect your arduino board as follow:




Note: Use the transistor only if you don't have an RS232 to TTL or USB to TTL cable.


Step 2

Modify the following lines of the arduino code:

line 128: char apn[] = "put_your_APN_here";  

                                                              
line 460:  mySerial.print("+RESP:GTFRI,02010B,your_SIM900_IMEI_15digits,GL200,0,0,1,1,");


Step 3

Configure your GSM modem to a baud rate of 9600 by sending the command AT+IPR=9600 using the bray's terminal, don't forget to check the option +CR in the send tab.

Note: If you don't have an RS232 to TTL or USB to TTL cable, load the following code into your arduino board, in order to change the baud rate.

//Change baudrate from 115200 to 9600

#include <SoftwareSerial.h>

SoftwareSerial mySerial (7,8); //RX, TX  for GSM/GPRS Modem



void setup (){

mySerial.begin(115200); // the baud rate your modem it's currently configured.

}

void loop(){

mySerial.println("AT+IPR=9600");
delay(3000);

}



Step 4

 Load the arduino sketch into your board.

Step 5

>Install Avangardo GPS Simulator.

>Configure the Serial port baud rate to 4800:

Go to "settings/output settings/serial port"



>Load the "Route file" and press "start".






Note:
> Zoom in and Out with the mouse wheel.
>To navigate through the map, press and hold the right mouse button.



Step 6

Open the Arduino Serial Monitor (9600) to verify that the system it's working correctly. If everything it's o.k, you will see the NMEA output printed every 15 seconds, after that time, the communication status of the modem will be printed instead.

If you don't see any data string, double check the connection and verify the communication with the modem and/or GPS simulator.


Step 7


>Go to GPS-Trace and create an account (Free).

>Login  to your account and click the wrench icon.

>Configure your device IMEI, Name and  GPS vendor.

>Select google map (Optional)

Step 8

Restart the track simulation of the GPS simulator and restart your modem. Once the track simulation has ended, you can generate a trajectory with GPS-Trace.



O.K, everything worked flawlessly for me, but the GPS Simulator software time trial has expired, what should I do?


If your are working under  Ubuntu (GNU/Linux ):

>Close the GPS Simulator software
>Go to your home folder.
>Press "Ctrl+l" (L) to display the navigation bar (Ubuntu).
>Open the hidden folder ".wine".
>Delete the files "system.reg" and "user.reg".
>Go to "Drive_c/program Files" and delete the folder "Avangardo".
>Reinstall the GPS Simulator software.

Sorry, but I don't use GNU/Linux. I'm a Windows user.

For windows users, just purchase a license (85.00 USD).

Jeje, I'm just kidding. Please follow this article.






Thanks for reading.

Elimeléc




































Saturday, June 8, 2013

Door Open with Dallas iButton Arduino

 
 Requirements
 
 
 Video

 
Schematic 

 
 
 
 
 Breadboard Connection

 


 Code

 
 #include <OneWire.h>

OneWire ibutton (2); // I button connected on PIN 2.

byte ibuttonid[10] = {1,144,74,165,21,0,0,143}; // Ibutton ID must be typed in Decimal in the following order: Family code (01 for DS1990); numbers from R. to L.; CRC. 
byte buffer[10]; //array to store the readed Ibutton ID.

boolean result;  // this variable will hold the compare result

int doorpin = 13; // the output pin to activate the door.

void setup(){
    Serial.begin(9600); 
    pinMode(doorpin,OUTPUT);
   
}

void loop(){
   
 if (!ibutton.search (buffer)){//read attached ibutton and asign value to buffer
    ibutton.reset_search();
    delay(200);
    return;
 }
  
  for (int x = 0; x<8; x++){  
    Serial.print(buffer[x],HEX); //print the buffer content in LSB. For MSB: for (int x = 8; x>0; x--) 
    Serial.print(" "); // print a space
   }
   Serial.println("\n"); // print new line
   
   // compare the ibutton id
   
  result = true; // set variable equal to one.
  for (int x=0; x<10; x++){ 
  int compare1 = ibuttonid[x];// asign each index of arrays to test, one by one and compare
  int compare2 = buffer[x];
  
  
  if(compare1 != compare2){ // if any index comparison is not equal, then the arrays are not equal and result will be 0.
   result = false; 
  }
  
  }
  if(result == true){ // if the arrays are equal, do something.
   Serial.println("Door open for 5 seconds."); 
   digitalWrite(doorpin,HIGH); // Turn on LED on pin 13 (build-in on the Arduino board)
   delay(5000); // wait five seconds. (1 second = 1000 milliseconds)
   Serial.println("Door closed");
   digitalWrite(doorpin,LOW); // turn off LED.
 }
   
    //set buffer back to cero.
    
    for (int x=0; x<10; x++){
     buffer[x] = 0 ;
    }                
}



/* by Elimeléc 
  Jun-07-2013
*/

Friday, June 7, 2013

Read Dallas iButton Arduino

Requirements:
 
-Arduino board
-OneWire Library (unzip and copy to arduino-1.0.3/libraries)
-Maxim Ibutton DS1990
-Maxim Touch Probe Read
 
 
 Schematic
 
 
 Breadboard Connection

 
Code: 
  
 #include <OneWire.h>

OneWire ibutton (2); // I button connected on PIN 2.

byte buffer[20]; //array to store the Ibutton ID.

void setup(){
 Serial.begin(9600); 
   
}

void loop(){
   
 if (!ibutton.search (buffer)){//read attached ibutton and asign value to buffer
    ibutton.reset_search();
    delay(200);
    return;
 }
  
  for (int x = 0; x<8; x++){  
    Serial.print(buffer[x],HEX); //print the buffer content in LSB. For MSB: for (int x = 8; x>0; x--) 
     Serial.print(" "); // print a space
   }
   Serial.println("\n"); // print new line
   
   //crc compute//
   byte crc;
   crc = ibutton.crc8(buffer, 7);
   Serial.println(crc,HEX);
 
     
} 
 
/*by Elimeléc
 Jun-07-2013
*/