Maximum array size

I understand the arduino has about 1k of ram and I assume bytes in an array are put in this ram. Realisticaly how much of this ram is available. Or to be precise how large would you expect an array could be.

Thanks,

It depends on how much of the stack your program uses, as the stack is also stored in RAM. The Arduino environment probably uses around 150 bytes of RAM, and libraries might use, some, too. My advice would be to use no more than around 500 bytes of RAM in your program if you want to play it safe and make sure the stack has plenty of room. You could probably go higher than this, but it gets riskier as you do.

  • Ben

Depending on what you want to do with the data, it might be useful for you to store the data in program memory. The ATmega168 chip has 16k of program memory of which the bootloader uses 2k. You can put your array in the other 14k. More information is here:

But this is only really useful to you in the array is read only.

I will be using it to store NMEA strings, accelerometer readings, engine speed, gear postion. My theory is that I will compile this information from different sensors into an array and then dump the whole lot to SD card in one shot.