Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

SIM808 GPS/GPRS/GSM Shield to Arduino HELP

Status
Not open for further replies.

LarryS

New Member
Hi I'm currently doing a project involving a Dog tracker and I currently have some things initialised in my circuit like the LCD Display, LM35 and a ESP8266. However I want to connect the SIM808 GPS/GPRS/GSM Shield to my arduino. I've looked online to find solutions and the only thing I can find is that I can connect the shield on top of my arduino however I'm looking for a way to do it without that. Can someone explain to me how I can do this and what connections can I use so I can insert them from the arduino to the SIM808 GPS/GPRS/GSM Shield.



Here's the photos of my current project and the pins I've used already from the arduino

Arduino 1.jpg

arduino 2.jpg

SIM.jpg
 
You need to connect power and whatever is needed to comunicate. Is it I2C, SPI, UART?

Mike.
 
You need to connect power and whatever is needed to comunicate. Is it I2C, SPI, UART?

Mike.

Hi sorry I'm not sure I understand (My English isn't too good) what do you mean? I'm not sure which pins I can connect to Arduino since most of the pins have been taken up so wondering what I can do?
 
Hi Larry

I can connect the shield on top of my arduino however I'm looking for a way to do it without that.

Why do you need to avoid mounting the module on top of the Arduino, it is the easy way to do it ? If it's because the Arduino pins are already occupied there is an easy solution. According to the schematic, the 808 module only uses 4 pins on the Arduino. apart from 5v & Gnd; If you remove your existing wires to the Arduino and place the shield on top, the wires can then be replaced in the corresponding points of the shield since they connect through. The one exception to that is pin 11 which from your picture is part of the LCD connections, so it should be possible to reassign that pin in the Arduino sketch.

MM
 
Hi Larry



Why do you need to avoid mounting the module on top of the Arduino, it is the easy way to do it ? If it's because the Arduino pins are already occupied there is an easy solution. According to the schematic, the 808 module only uses 4 pins on the Arduino. apart from 5v & Gnd; If you remove your existing wires to the Arduino and place the shield on top, the wires can then be replaced in the corresponding points of the shield since they connect through. The one exception to that is pin 11 which from your picture is part of the LCD connections, so it should be possible to reassign that pin in the Arduino sketch.

MM

Hi thanks that was very insightful. I'm just wondering could I switch pin 11 to like pin 10? Because on the LCD display, on the datasheets I've seen that it's important that all the pins are the correct way and in the right pin slots?
 
What does pin 11 connect to ? It's difficult to make out on the picture .. might be D4 or D5 on the LCD ??
 
OK, I would expect that to be re-assignable, however, a further thought .. .. .

Would you be able to get your hands on an I2C adaptor ?

1608159062867.png


That would plug into the back of the LCD and only require 2 connections to your Arduino .. A4 & A5, apart from 5vdc & Gnd, which are unoccupied on the SIM808 shield. That would be an easy solution.

MM
 
I'm afraid not, project is due by the end of the week so don't think I'll be able to order one and get one on time
 
LOL .. you've left it a bit late then !

Can you show me the Arduino sketch ?

Use Code Tags .. ie ..

C:
copy & paste your code here

MM
 
C:
#include <DFRobot_sim808.h>
//Mobile phone number, need to change
  #define PHONE_NUMBER "My number here"

  //The content of messages sent
  #define MESSAGE  "Message here"

  DFRobot_SIM808 sim808(&Serial);

#include<LiquidCrystal.h>  //Header file for LCD Module
#include "WiFiEsp.h"

#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(6, 7); // RX, TX
#endif

char ssid[] = "";            // Network Name
char pass[] = "";        // Network Password
int status = WL_IDLE_STATUS;     // Wifi radio's status
int reqCount = 0;                // number of requests received

WiFiEspServer server(80);

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //lcd connected pins
const int sensor = A0;    //Assigning analog A0 to LM35
float tempc;              //Storing temp in °C
float tempf;              //Storing temp in °F
float vout;               //variable to store values from sensor

void setup()
{
   // initialize serial for debugging
  Serial.begin(115200);
  // initialize serial for ESP module
  Serial1.begin(9600);
  // initialize ESP module
  WiFi.init(&Serial1);
  
   lcd.begin(16, 2);
   lcd.print("DOG TRACKER\nDEVICE");
   pinMode(A0, INPUT);

   {
    while(!sim808.init()) {
      delay(1000);
        Serial.print("Sim808 init error\r\n");
    }
    Serial.println("Sim808 init success");
    Serial.println("Start to send message ...");

    //******** define phone number and text **********
    sim808.sendSMS(PHONE_NUMBER,MESSAGE);
  }
    while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);
    }

  Serial.println("You're connected to the network");
 
  // start the web server on port 80
  server.begin();

  printWifiStatus();
}
void loop()
   // Looping of LM35
  { vout = analogRead(sensor);
   vout = (vout * 500) / 1023;
   tempc = vout;           // Storing value in °C
   tempf = (vout * 1.8) + 32; //conversion of °C to °F
   Serial.println(tempc);
   lcd.setCursor(0, 0);
   lcd.print("Temperature = ");
   lcd.setCursor(0, 1);
   Serial.println(tempc);
   lcd.print("          "); // overwrite old data with spaces
   lcd.setCursor(0, 1);
   lcd.print(tempc);
   }
  
void printWifiStatus()
{
  // print the SSID of the network you're attached to
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
 
  // print where to go in the browser
  Serial.println();
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);
  Serial.println();
}
 
OK ..
I can't see any reason that you cannot re-assign the enable to pin 10

ie ..
LiquidCrystal lcd(12, 10, 5, 4, 3, 2);

try it and see ?

Is this College work then ?

MM
 
OK ..
I can't see any reason that you cannot re-assign the enable to pin 10

ie ..
LiquidCrystal lcd(12, 10, 5, 4, 3, 2);

try it and see ?

Is this College work then ?

MM

Yeah it is indeed, It's not meant to be finished until next year it's just the coding and that I need done for the weekend but I just want to get that right and initialising the SIM 808 too. I'm flying home for Christmas on Monday so would like to just that bit done lol
 
Flying Home ? where's Home ?

I've attached a schematic for the 808 module. You'll see that only 4 connections are used apart from power & Gnd. If all else fails you could just make those connections, it should work but you may get some interference from the un allocated pins .. .. ..

MM
 

Attachments

  • SIM808 Schematic.png
    SIM808 Schematic.png
    102.1 KB · Views: 200
Flying Home ? where's Home ?

I've attached a schematic for the 808 module. You'll see that only 4 connections are used apart from power & Gnd. If all else fails you could just make those connections, it should work but you may get some interference from the un allocated pins .. .. ..

MM

I'm French, living in Northern Ireland and studying here but can't wait to go home lol

thanks for your help, just one last quick question, is the code I sent you okay to send to my college teachers? I have nothing new to add to it until next year
 
I'm French, living in Northern Ireland and studying here but can't wait to go home lol

Yes, I'm sure. you have a safe trip .. .. .. .

thanks for your help, just one last quick question, is the code I sent you okay to send to my college teachers? I have nothing new to add to it until next year

You're welcome, I think it remains to be seen whether I've helped or not ! :)
As for showing the code to your teachers, who knows .. looks good to me, but then I'm not your tutor .. .. .. .

If you've got until next year to complete, I would seriously consider an I2C module, they are only a few Euros and solve a multitude of problems.

Look forward to seeing you here in the New Year

Bientot

MM
 
Yes, I'm sure. you have a safe trip .. .. .. .



You're welcome, I think it remains to be seen whether I've helped or not ! :)
As for showing the code to your teachers, who knows .. looks good to me, but then I'm not your tutor .. .. .. .

If you've got until next year to complete, I would seriously consider an I2C module, they are only a few Euros and solve a multitude of problems.

Look forward to seeing you here in the New Year

Bientot

MM

Thank you I have ordered an I2C module to my parents home in France so I will collect it when I arrive :)

Merci, joyeux Noël
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top