Machine Learning Data Crunching/Storage

Hello

I would like to do some machine learning with sensors attached to my Arduino. I am looking at how I am going to store data and do some pretty complicated crunching. I have an ATMega2560 that I would like to use for the application. My real question is if there is any chance that I could allocate something like a 4000 element array and process that data in a timely manner with what I assume is a pretty measly processor.

I am looking at these two methods:

  1. Store data in ATMega RAM and use its processor (more or less looking for confirmation this is stupid and won't work.)
  2. Use a Bluetooth hardware module which communicates with a device (PC or iPhone) and allow that hardware to store the data in RAM, do the crunching, and provide feedback to the ATMega.

As always, thanks for the help.

Sounds like some heavy processing. Not really Mega's strong suit. A 4000 element array would be ok if the data type is char or byte, but even int would be twice that large and take up too much space.

Maybe you should consider something with more grunt. Tell us more and we can suggest something suitable. Teensy 3.x is Arduino compatible. For more power still, maybe consider Raspberry Pi Zero, which is not Arduino compatible.

Yeah, my main hope is that I can use some sort of background program on another heavier computer to do the processing and just hand back the ATMega the important information it needs for making the circuit execute logically via Bluetooth. I have a number of Arduino sensors I have bought, so I'd shy away from getting into Rasperry Pi.
Do you think a Bluetooth interface would be feasible?

Answer the question. Will your data items fit in a byte?

JohnFrye:
Do you think a Bluetooth interface would be feasible?

Yes. It is feasible​ to make an interface with Bluetooth. Is it the best approach for your project?

I assume is a pretty measly processor

You don't know enough to assume any thing. An AVR at 16MHz on byte wide data gives you 16MIPS! Read the data sheet.

Then google or use paper and pen! and do some calculation!

When look for stuff with google the best sites are the dot edu sites, score them 7/10. Rate this place 2 or may be 3 out of 10

Google (first hit) gave me this dot edu. MIPS

This is the key quote

The Motorola 68000 processor 1979 ran at 1 MIPS at 8 Mhz in the year 1979 as compared to the Intel Core 2 X6800 processor which ran at 27,079 MIPS at 2.93 Ghz in 2006

Knock off the AVR's are slow crap!

Mark

PS You also need to look at the delay caused by moving data around.

Mark

JohnFrye:
Hello

I would like to do some machine learning with sensors attached to my Arduino. I am looking at how I am going to store data and do some pretty complicated crunching. I have an ATMega2560 that I would like to use for the application. My real question is if there is any chance that I could allocate something like a 4000 element array and process that data in a timely manner with what I assume is a pretty measly processor.

4000 elements of which type?

4000 elements of char, byte, int8_t or uint8_t would require 4000 bytes.

This will fit into the RAM of a MEGA2560

4000 elements of 'int' would require 8000 bytes

This will NOT fit into the RAM of a MEGA2560

If you need more storage area than the RAM of a MEGA260 provides, you could store data on SD card.

Read/write to/from SD card can exceed 100KB per second, when managing it the right way.

'1284P has 16K SRAM, twice that of a Mega, if that helps.

Also what means "process the data" and "timely manner"? Do you need to do a complicated algorithm with every member of the array every millisecond or do you need to find mean value once a day?