Arduino Yun RAM limitations & pollution monitoring ministation.

Hi there,

We are a computer club in a small 2ndary school in Nice (Nizza) working on a project to assemble and code a mini air quality / pollution monitoring station.

The ministation is built on an Arduino Yun fitted (for now) with these 3 sensors: BMP180, DTH22 and Waveshare dust sensor (for particles<10PM). Apart particles pollution, we have planned to add an Ozone (O3) and NOx sensors. This ministation should be able to operate autonomously (with a battery sufficient for 48 or 72 hours of operation, datalogging on the SD card and data dissemination on Internet via Temboo… and if possible, with minimal physical dimensions).

Our problem is the following:

With only these 3 sensors and 2 basic pieces of code for the datalogging and Temboo/Google spreadsheet functions, our code already uses 80% of the software memory and more than 60% of the dynamic memory for the global variables… and it appears that Temboo requires a lot of available dynamic RAM for the Choreo data not to get overwritten and corrupted. We already have to disable either the SD datalogging or the Temboo webservices for our code to operate correctly (dynamical RAM problems)… and we are supposed to add two more pollution sensors and more functions to our code (geotagging, filtering, networking,…). :o

Is there something to do apart changing our board ? The linux side could offer more space for a Python program but the dyn. RAM problems would still persist ?

Please help, we are not experts of RAM management on this kind of boards ! (I am a Math teacher :slight_smile: ).
Best from the French Riviera,
Jean-François

Hi there, I work for Temboo.

If you are running into memory issues, you could look at using a profile for your Google Spreadsheet inputs. A profile allows you to simply reference your inputs from your sketch without including all of the String data that consumes memory. You can learn more about that approach here:

You can also free up some memory by putting the inputs that don't change (your Temboo credentials, your Google credentials, your output filter specifications, the Choreo to run) into a settings file on a micro SD card, as described here:

If you have any questions, feel free to contact us at Contact | Temboo - we're always happy to help.

The Temboo support has been very swift to help with suggestions by mail, thank you for that.

I tried to encapsulate my Google spreadsheet credentials into a profile as you suggested but this did not free so much dyn. RAM space (maybe 15%) and it did not work (debugging needed), but I will try again, as well as putting all my global constant variables into setting files (I already have my IDs & credentials in the files TembooAccount.h and a GoogleAccount.h, but I have not tried to read them from the SD card, will go through your tutorial). Before receiving them, this week we are going to augment our sketch with the pieces of code needed for our 2 last sensors (O3 and NOx) and see where we stand in terms of RAM usage.

Thanks again for the ideas/options !
Jeff

Your trouble will be solved if you move the teembo code to a python sketch in the linux side, there you have 64 mb ram vs 2.5 kb sram that the atmega 32U4 has. With arduino side do the readings and then using bridge you can call the python script and send the values.