Lost my memory
Moderators: adafruit_support_bill, adafruit

Lost my memory

by KeepCalm on Tue Feb 18, 2014 4:31 am

Hi,

I had the ultimate GPS logging shield running happily with a UNO, I moved to a Leonardo after reading some posts about the advantage of more SRAM and again all is good but now I am running out of Flash memory for my project,( 4 KB goes for boot loading on the Leonardo as you know). I need to read temp/humidity/ using DHT 11 or similar, read a switch and also count some pulses). speed is not an issue, a logging every 10 seconds would be ok
I have read posts that talk of whittling down the librarys but I suspect this would be a challenge for my limited programing ability, what I am wondering is it possible to use this compact version of the mega (link below) with your shield ? or could anyone point me at some compact code for the DHT11,
Thanks in advance

http://arduinodev.com/store/index.php?r ... duct_id=59
KeepCalm
 
Posts: 8
Joined: Wed Jan 29, 2014 2:23 am

Re: Lost my memory

by adafruit_support_rick on Tue Feb 18, 2014 11:36 am

We don't know anything about that board, but I can't see why it wouldn't work. The shield doesn't work directly with the Mega anyway - you have to jumper the RX and TX to other pins, so you'll have to do the same with this thing. I usually jumper Shield RX and TX to Serial1 RX and TX to use the shield with a Mega
User avatar
adafruit_support_rick
 
Posts: 11593
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Lost my memory

by KeepCalm on Mon Feb 24, 2014 8:57 am

Thanks for your help, do I need to cut the traces on the pcb, and what change would I make to the code ?
KeepCalm
 
Posts: 8
Joined: Wed Jan 29, 2014 2:23 am

Re: Lost my memory

by adafruit_support_rick on Mon Feb 24, 2014 9:53 am

You could cut the traces, but it's not strictly necessary.
In the code, comment out all references to SoftwareSerial, initialize the GPS constructor with "&Serial1"
User avatar
adafruit_support_rick
 
Posts: 11593
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Lost my memory

by KeepCalm on Mon Feb 24, 2014 8:52 pm

Thanks for your help, I have the ultimate gps shield running with a standard mega with the jumpering you suggested, now
I want to add my sensor data to the string that’s written to the sd card, would you be so kind as to give me an example of doing this,
appreciate your assistance.
KeepCalm
 
Posts: 8
Joined: Wed Jan 29, 2014 2:23 am

Re: Lost my memory

by adafruit_support_rick on Tue Feb 25, 2014 9:47 am

Check out our Light & Temperature Logging Tutorial:
http://learn.adafruit.com/adafruit-data ... me-clock-3
User avatar
adafruit_support_rick
 
Posts: 11593
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Lost my memory

by KeepCalm on Thu Feb 27, 2014 7:11 am

Thanks for your help, I hope its ok to ask another question relating to the DHT22
to recap I have a mega + ultimate gps logger, I can log to sd card the gps data and temperature but not the humidity,
The DHT22 runs no problem in the DHT tester sketch, but will only read the temperature in the shield_sdlog sketch that I have “modified”
(apologies for my crude code )

Thanks
Code: Select all | TOGGLE FULL SIZE
// Rad. lets log it!
    //Serial.println("Log");
   
    char *stringptr = GPS.lastNMEA();
    uint8_t stringsize = strlen(stringptr);
    if (stringsize != logfile.write((uint8_t *)stringptr, stringsize))    //write the string to the SD file
      error(4);
   
    if (strstr(stringptr, "RMC")) 
   float h = dht.readHumidity();    //DHT22
   float t = dht.readTemperature();   
    logfile.print(t);
    Serial.print(t);
    logfile.print(",");
    logfile.print(h);
    Serial.print(h);
    logfile.print(",");
   
    logfile.flush();
       
  }
}


/* End code */
KeepCalm
 
Posts: 8
Joined: Wed Jan 29, 2014 2:23 am

Re: Lost my memory

by adafruit_support_bill on Thu Feb 27, 2014 7:39 am

Please post an example of what is being logged by your code.
User avatar
adafruit_support_bill
 
Posts: 29110
Joined: Sat Feb 07, 2009 9:11 am

Re: Lost my memory

by KeepCalm on Thu Feb 27, 2014 8:47 am

22.60,0.00,$GPRMC,134102.942,A,3530.4823,S,14904.0571,E,0.80,7.13,270214,,,A*75
22.40,0.00,$GPRMC,134103.936,A,3530.4845,S,14904.0567,E,0.96,339.18,270214,,,A*72
22.40,0.00,$GPRMC,134105.000,A,3530.4841,S,14904.0566,E,1.16,297.37,270214,,,A*7C
KeepCalm
 
Posts: 8
Joined: Wed Jan 29, 2014 2:23 am

Re: Lost my memory

by adafruit_support_bill on Thu Feb 27, 2014 9:02 am

What is the purpose of this "if" statement in your code? Is there a specific reason you do not want to read the humidity if it is not a GPRMC message?

Code: Select all | TOGGLE FULL SIZE
    if (strstr(stringptr, "RMC")) 
   float h = dht.readHumidity();    //DHT22


Have you tested the humidity readings with the example code from the DHT sensor library?
User avatar
adafruit_support_bill
 
Posts: 29110
Joined: Sat Feb 07, 2009 9:11 am

Re: Lost my memory

by KeepCalm on Thu Feb 27, 2014 9:37 am

Hi Bill

I thought I had that line commented out, my mistake, all good now, thanks for your help, I think its time I went to bed
KeepCalm
 
Posts: 8
Joined: Wed Jan 29, 2014 2:23 am