Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Networking, Protocols, and Devices / Re: sim908 return bad speed on: September 15, 2014, 03:54:45 am
Problem solved  AT+CGPSINF=0 returns velocity in meters/second not in knots.
2  Using Arduino / Networking, Protocols, and Devices / [SOLVED] sim908 return bad speed on: September 11, 2014, 04:39:50 am
Hello,

I'm reading the sim908 GPS info with getPar functionfrom gsmlib, that internally send an AT+CGPSINF=0 command , all works fine but the speed is always under 60 kph (before convert knots to kph), what is the problem? there is a sim908 problem?

Code:
char GPSGSM::getPar(char *str_long, char *str_lat, char *str_alt, char *str_time, char *str_num, char *str_speed)
{
   char ret_val=0;
   char *p_char;
   char *p_char1;
   gsm.SimpleWriteln("AT+CGPSINF=0");
   gsm.WaitResp(5000, 100, "OK");
   if(gsm.IsStringReceived("OK"))
      ret_val=1;
      
   //longitude
   p_char = strchr((char *)(gsm.comm_buf),',');
   p_char1 = p_char+1;  //we are on the first char of longitude
   p_char = strchr((char *)(p_char1), ',');
   if (p_char != NULL) {
          *p_char = 0;
    }
   strcpy(str_long, (char *)(p_char1));
  
   // latitude
   p_char++;
   p_char1 = strchr((char *)(p_char), ',');
   if (p_char1 != NULL) {
          *p_char1 = 0;
    }  
   strcpy(str_lat, (char *)(p_char));
  
   // altitude
   p_char1++;
   p_char = strchr((char *)(p_char1), ',');
   if (p_char != NULL) {
          *p_char = 0;
    }  
   strcpy(str_alt, (char *)(p_char1));
  
   // UTC time
   p_char++;
   p_char1 = strchr((char *)(p_char), ',');
   if (p_char1 != NULL) {
          *p_char1 = 0;
    }  
   strcpy(str_time, (char *)(p_char));  

   // TTFF
   p_char1++;
   p_char = strchr((char *)(p_char1), ',');
   if (p_char != NULL) {
          *p_char = 0;
    }  

   // num
   p_char++;
   p_char1 = strchr((char *)(p_char), ',');
   if (p_char1 != NULL) {
          *p_char1 = 0;
    }  
        strcpy(str_num, (char *)(p_char));

   // speed
   p_char1++;
   p_char = strchr((char *)(p_char1), ',');
   if (p_char != NULL) {
          *p_char = 0;
    }      
   strcpy(str_speed, (char *)(p_char1));  
  
   return ret_val;
}

The fastest retuned value was  29.340792 knots, arround  54.34 kph, but real speed was near 120 kph.

Best regards.
3  Using Arduino / Project Guidance / Re: Arduino 5V regulator is too hot on: August 20, 2014, 01:17:38 pm

A lot of thanks, I will buy one, but i also want to know hoy it works and see the scheme.
4  Using Arduino / Project Guidance / Re: Arduino 5V regulator is too hot on: August 20, 2014, 01:06:45 pm
Yes, use a step down DC to DC converter!
Lots on eBay
here

I'm looking for a DC to DC converter from 12V to 5V scheme.
5  Using Arduino / Project Guidance / Re: Arduino 5V regulator is too hot on: August 20, 2014, 12:59:42 pm
What are you powering the Arduino from, 12VDC from the car's DC jacks and plugging that into the Arduino through the barrel connector?
Yes.
What are you powering that requires 550mA?
I'm using the 5V to power a sim908 module for charging the battery, the module need 500mA to fast charging the battery.

If the regulator is getting really hot, I'd get a separate DC/DC converter to provide power instead of getting a heat sink.  While the heat sink may help, you still run the risk of the regulator shutting itself down (especially if the inside of your car is really hot on a summer day for example).  Not to mention the Arduino uses a linear regulator, whose output voltage will decrease as you draw more current.  Here's a switching step-down DC/DC converter that you can give 12V input, and it will provide a steady 5V output for up to 600mA.  The 600mA max current is close to your 550mA, so just double check what your actual current draw is.
Somebody have this circuit scheme?
6  Using Arduino / Project Guidance / Arduino 5V regulator is too hot on: August 20, 2014, 11:20:42 am
I've a car proyect with arduino that needs arround 550mah, but the Arduino 5V regulator is too hot, Can be a pololus heat sink the solution?

Best regards.
7  Using Arduino / Project Guidance / Re: Arduino OTA with GSM/GPRS & GPS ? on: August 15, 2014, 08:31:48 am
Seems to be easy with another arduino and sd card, I found this docs: http://baldwisdom.com/bootdrive/ but would be perfect if it can be done just with the GSM/GPRS shield with and arduino.
8  Using Arduino / Project Guidance / Arduino OTA with GSM/GPRS & GPS ? on: August 13, 2014, 12:46:16 pm
Hello to all, I'm intesred in upload new firmwares to my devices by OTA (Over The Air) using the GSM/GPRS & GPS shield for Arduino by Open Electronics, somebody can help me?

The idea is put the new firmware into a webserver and devices must download and reflash it.

Best regards.
9  Using Arduino / Networking, Protocols, and Devices / Re: Problems with sim908 and coordinates on: June 13, 2014, 04:49:50 am
The coordinates look like you're inside a building and the GPS reading is about 300m off your real position. That's an acceptable offset for your situation in my opinion given that you're using a GPS module with only a small integrated antenna. Go to an outdoor place where you have at least a 90° clear sky (no obstacles like trees or buildings) and measure again. You'll probably get readings that are accurate to about 5-10m.

Hello pylon, we are testing outdoor with hardware inside a plastic box, we use this antenna http://www.cooking-hacks.com/internal-gps-antenna, most positions are on 10m radius from real position, but some positiong give the wrong position, we take 72 position and only 2 are bad.
10  Using Arduino / Networking, Protocols, and Devices / Problems with sim908 and coordinates on: June 13, 2014, 03:05:37 am
Hello, I'm working with sim908, usually it works well and give me the correct location, but sometimes it returns bad locations, they are too far from real location, to obtain the location I check if SIM908 is 3D fixed with AT+CGPSSTATUS? command, and then I get the location with AT+CGPSINF=0 command.

Here you can see an example with converted coordinates:
real position: 41.680399466667 -0.8860718
sim908 position: 41.675466983333 -0.8852484

¿somebody can help me?
11  Using Arduino / Networking, Protocols, and Devices / Re: Problems with DS3234, is damaged? on: August 05, 2013, 05:31:45 am
some help???
12  Using Arduino / Networking, Protocols, and Devices / Problems with DS3234, is damaged? on: August 03, 2013, 12:49:30 pm
Hello,
I've two DS3234 connected to two different Arduinos, I followed this tutorial http://www.l8ter.com/?p=375 one of them works perfectly but the other show me the following in Serial monitor:

Quote
10/10/10     10:10:0
11/11/11     11:11:11
12/12/12     12:12:12
13/13/13     13:13:13
14/14/14     14:14:14
15/15/15     15:15:15
16/16/16     16:16:16
17/17/17     17:17:17
18/18/18     18:18:18
19/19/19     19:19:19
20/0/20     20:20:20
21/1/21     21:21:21
22/2/22     22:22:22
23/3/23     23:23:23
24/4/24     24:24:24
25/5/25     25:25:25
26/6/26     26:26:26
27/7/27     27:27:27
28/8/28     28:28:28
29/9/29     29:29:29
30/10/30     3:30:30
31/11/31     4:31:31
32/12/32     5:32:32
33/13/33     6:33:33
34/14/34     7:34:34
35/15/35     8:35:35
36/16/36     9:36:36
37/17/37     10:37:37
38/18/38     11:38:38
39/19/39     12:39:39
0/0/40     0:40:40
1/1/41     1:41:41
2/2/42     2:42:42
3/3/43     3:43:43
4/4/44     4:44:44
5/5/45     5:45:45
6/6/46     6:46:46

It seems that every second increase all records in one unit, if I only read every 5 seconds they increased 5 units.
Could it be a wiring or soldering problem or is the DS3234 damaged?

Best regards.
13  International / Software / Re: Problema con interrupcion, despertar el arduino y DS3234 on: July 28, 2013, 02:58:08 pm
Conseguido, tiene la ventaja que se puede cambiar facilmente el tiempo que va a estar dormido, economizando así mucho la batería.

Por si a alguien le interesa el código:

Code:
#include <SPI.h>
#include "ds3234.h"
#include "Enerlib.h"

#define BUFF_MAX 256

const int cs = 8;              // chip select pin
uint8_t sleep_period = 5;      // the sleep interval in minutes between 2 consecutive alarms
Energy energy;
int time_interrupt=0;


void set_next_alarm(void)
{
 
    struct ts t;
    unsigned char wakeup_min;

    DS3234_get(cs, &t);

    // calculate the minute when the next alarm will be triggered
    wakeup_min = (t.min / sleep_period + 1) * sleep_period;
    if (wakeup_min > 59) {
        wakeup_min -= 60;
    }

    // flags define what calendar component to be checked against the current time in order
    // to trigger the alarm
    // A2M2 (minutes) (0 to enable, 1 to disable)
    // A2M3 (hour)    (0 to enable, 1 to disable)
    // A2M4 (day)     (0 to enable, 1 to disable)
    // DY/DT          (dayofweek == 1/dayofmonth == 0)
    boolean flags[4] = { 0, 1, 1, 1 };

    // set Alarm2. only the minute is set since we ignore the hour and day component
    DS3234_set_a2(cs, wakeup_min, 0, 0, flags);

    // activate Alarm2
    DS3234_set_creg(cs, DS3234_INTCN | DS3234_A2IE);
   
}

void INT0_ISR(void)
{
  //detach interrupt and set time_interrupt=1
  //interrupt must be attached again
  detachInterrupt(0);
  time_interrupt=1;

}

void setup()
{
    Serial.begin(9600);
    Serial.println("Entering setup");
    pinMode(2, INPUT);
    delay(5000);
    DS3234_init(cs, DS3234_INTCN);
    DS3234_clear_a2f(cs);
    set_next_alarm();
    attachInterrupt(0, INT0_ISR, LOW);
}


void loop()
{
  if(time_interrupt==1){
    Serial.println(" time_interrupt==1");
    time_interrupt=0;
   
    // set next alarm
    set_next_alarm();
    // clear a2 alarm flag and let INT go into hi-z
    DS3234_clear_a2f(cs);
    //Attach interrupt again
    attachInterrupt(0, INT0_ISR, LOW);
    if (energy.WasSleeping())
      {
        Serial.println("  Interrupt and was sleeping");
      }
    else
      {
        /*
        The IRQ happened in awake state.
        This code is for the "normal" ISR.
        */
    Serial.println("  Interrupt and was NOT sleeping");
      }
  }
  Serial.println("Entering loop");
  delay(1000);
  /*
  //For debuf only
  char buff[BUFF_MAX];
  struct ts t;
   
  DS3234_get(cs, &t);
  // display current time
  snprintf(buff, BUFF_MAX, "%d.%02d.%02d %02d:%02d:%02d", t.year, t.mon, t.mday, t.hour, t.min, t.sec);
  Serial.println(buff);
  */
  Serial.println("Powering down");
  energy.PowerDown();

}
14  Using Arduino / Programming Questions / Re: DS3234, interrupts and alarms on: July 28, 2013, 02:55:49 pm
Now it works!

I need an alarm that wake up the Arduino every 5 minutes or more.

Code:

Code:
#include <SPI.h>
#include "ds3234.h"
#include "Enerlib.h"

#define BUFF_MAX 256

const int cs = 8;              // chip select pin
uint8_t sleep_period = 5;      // the sleep interval in minutes between 2 consecutive alarms
Energy energy;
int time_interrupt=0;


void set_next_alarm(void)
{
 
    struct ts t;
    unsigned char wakeup_min;

    DS3234_get(cs, &t);

    // calculate the minute when the next alarm will be triggered
    wakeup_min = (t.min / sleep_period + 1) * sleep_period;
    if (wakeup_min > 59) {
        wakeup_min -= 60;
    }

    // flags define what calendar component to be checked against the current time in order
    // to trigger the alarm
    // A2M2 (minutes) (0 to enable, 1 to disable)
    // A2M3 (hour)    (0 to enable, 1 to disable)
    // A2M4 (day)     (0 to enable, 1 to disable)
    // DY/DT          (dayofweek == 1/dayofmonth == 0)
    boolean flags[4] = { 0, 1, 1, 1 };

    // set Alarm2. only the minute is set since we ignore the hour and day component
    DS3234_set_a2(cs, wakeup_min, 0, 0, flags);

    // activate Alarm2
    DS3234_set_creg(cs, DS3234_INTCN | DS3234_A2IE);
   
}

void INT0_ISR(void)
{
  //detach interrupt and set time_interrupt=1
  //interrupt must be attached again
  detachInterrupt(0);
  time_interrupt=1;

}

void setup()
{
    Serial.begin(9600);
    Serial.println("Entering setup");
    pinMode(2, INPUT);
    delay(5000);
    DS3234_init(cs, DS3234_INTCN);
    DS3234_clear_a2f(cs);
    set_next_alarm();
    attachInterrupt(0, INT0_ISR, LOW);
}


void loop()
{
  if(time_interrupt==1){
    Serial.println(" time_interrupt==1");
    time_interrupt=0;
   
    // set next alarm
    set_next_alarm();
    // clear a2 alarm flag and let INT go into hi-z
    DS3234_clear_a2f(cs);
    //Attach interrupt again
    attachInterrupt(0, INT0_ISR, LOW);
    if (energy.WasSleeping())
      {
        Serial.println("  Interrupt and was sleeping");
      }
    else
      {
        /*
        The IRQ happened in awake state.
        This code is for the "normal" ISR.
        */
    Serial.println("  Interrupt and was NOT sleeping");
      }
  }
  Serial.println("Entering loop");
  delay(1000);
  /*
  //For debuf only
  char buff[BUFF_MAX];
  struct ts t;
   
  DS3234_get(cs, &t);
  // display current time
  snprintf(buff, BUFF_MAX, "%d.%02d.%02d %02d:%02d:%02d", t.year, t.mon, t.mday, t.hour, t.min, t.sec);
  Serial.println(buff);
  */
  Serial.println("Powering down");
  energy.PowerDown();

}
15  Using Arduino / Programming Questions / Re: DS3234, interrupts and alarms on: July 28, 2013, 02:01:58 pm
Hello Mark,
I rewrite my code, and the problems is the same.

Code:
Code:
#include <SPI.h>
#include "ds3234.h"
#include "Enerlib.h"

#define BUFF_MAX 256

const int cs = 8;              // chip select pin
uint8_t sleep_period = 5;       // the sleep interval in minutes between 2 consecutive alarms
Energy energy;
int time_interrupt=0;

// how often to refresh the info on stdout (ms)
//unsigned long prev = 5000, interval = 5000;


void set_next_alarm(void)
{
 
    struct ts t;
    unsigned char wakeup_min;

    DS3234_get(cs, &t);

    // calculate the minute when the next alarm will be triggered
    wakeup_min = (t.min / sleep_period + 1) * sleep_period;
    if (wakeup_min > 59) {
        wakeup_min -= 60;
    }

    // flags define what calendar component to be checked against the current time in order
    // to trigger the alarm
    // A2M2 (minutes) (0 to enable, 1 to disable)
    // A2M3 (hour)    (0 to enable, 1 to disable)
    // A2M4 (day)     (0 to enable, 1 to disable)
    // DY/DT          (dayofweek == 1/dayofmonth == 0)
    boolean flags[4] = { 0, 1, 1, 1 };

    // set Alarm2. only the minute is set since we ignore the hour and day component
    DS3234_set_a2(cs, wakeup_min, 0, 0, flags);

    // activate Alarm2
    DS3234_set_creg(cs, DS3234_INTCN | DS3234_A2IE);
   
}

void INT0_ISR(void)
{
 
 
  /*
  The WasSleeping function will return true if Arduino
  was sleeping before the IRQ. Subsequent calls to
  WasSleeping will return false until Arduino reenters
  in a low power state. The WasSleeping function should
  only be called in the ISR.
  */
  //detachInterrupt(0);
  time_interrupt=1;

}

void setup()
{
    Serial.begin(9600);
    Serial.println("Entering setup");
    pinMode(2, INPUT);
    delay(5000);
    DS3234_init(cs, DS3234_INTCN);
    DS3234_clear_a2f(cs);
    set_next_alarm();
    attachInterrupt(0, INT0_ISR, LOW);
}


void loop()
{
  if(time_interrupt==1){
    Serial.println("time_interrupt==1");
    time_interrupt=0;
    if (energy.WasSleeping())
      {
        Serial.println("  Interrupt and was sleeping");
      }
    else
      {
        /*
        The IRQ happened in awake state.
        This code is for the "normal" ISR.
        */
    Serial.println("  Interrupt and was NOT sleeping");
      }
  }
  Serial.println("Entering loop");
  delay(1000);
  //Serial.println("Powering down");
  //energy.PowerDown();
 
 
  char buff[BUFF_MAX];
  struct ts t;
   
  DS3234_get(cs, &t);
  // display current time
  snprintf(buff, BUFF_MAX, "%d.%02d.%02d %02d:%02d:%02d", t.year, t.mon, t.mday, t.hour, t.min, t.sec);
  Serial.println(buff);

}
Pages: [1] 2 3 4