Processing power of the arduino [solved]

Hey there, I am looking for some help

I am developing a measuring set to measure our energy harvesting systems before they go to the customer. I was thinking about using an Arduino control board.

The measurement:
The voltage which gets generated by a linear motion of 0,4 seconds of a rack. Connected to this rack there are a bunch of gears and so a magnet starts to spin. This causes the energy and I want to measure the voltage that gets generated and the force that is needed to move the rack during this 0,4 seconds.

There is just one quality of which I do not know if the Arduino is able to handle it.

  • I need a sample rate of around 125 samples per second.
  • During the measurement there is a program running that is controlling both of the signals the
    force and both signals have to be between X and Y..
  • This samples need to be stored in one kind of database.
  • The Arduino has to be able to do 1000 measurements without being connected to a pc.
    When connected it can store its data in the database on the pc.

So my questions are as following:

  • Does the Arduino have enough processing power for measuring those two with 125 Hz
  • Can it store enough data (1000 x 250=250.000 samples of 3 digits) or can I connect one external
    memory device?

Any help appreciated. Thanks.

Well,
0.4 seconds x 125 samples/second = 50 samples for each channel. Let's say you'll use 64 samples per channel per measurement.

Analog values require 10bits . Or if you use unsigned int (16bit) for simplicity, 2 bytes x 64 = 128 bytes.

3 channels x 800 = 2400 bits or 384 bytes.

So you should be able to simply store the values for one measurement in memory then save the whole array on a SD card between measurements.

I assumed you use analog (ADC) readings for this

Thanks for your quick reply!
Oké so than I will simply buy an SD card and format this to a FAT16 with my computer and than connect it to pins 11, 12 or 13 on my Arduino. Than I will program after the loop (after the high intensity part of the measurement) that the memory will be transferred to the SD. :slight_smile:

I forgot one more thing, about the actual processing power of the Arduino.

  • There will be taken 125 samples every second by two sensors. (1/125= 0,008 seconds per sample)
  • So there will be a loop in the code which must be completed every 0,008 seconds.
  • In this loop I was planning on running the check if the sample result meets the requirements.

That makes my question:

  • Will de cycle time be fast enough to run this loop including the check 0,008 seconds.

// Or even better how do I check how complicated this loop can be if it needs to repeat every
0,008 seconds. With a processor lik 16MHz, its like this can proces 16 million bytes every second.
So this would mean that inside this loop you can use 16M * 0,008 = 128.000 characters?
(I obviously do not exactly know how this works)

Any help appreciated. Thanks a lot!

The analogRead() limit is almost 10000 reads/second on a 16MHz arduino. Unless you do something very wrong, no need to worry with processing details. Just pack the data blocks and store them on SD, you can do whatever complex processing later, on recorded files.


You need a SD card module or shield, and follow their usage instructions... I doubt connecting directly sd card pins to arduino pins will work.

Oké that was about everything. :slight_smile:

Thanks a lot for your quick help blimpyway!

I second the idea of fixed size records, written to a SD card.

The data acquisition deserves some more thoughts. Force measurement (strain gauges) requires some external circuitry, usually combined with their own ADC. If your signals require smoothing, this will require a higher sample rate (and software) or low pass filters (hardware). The limiting factor will be the time required for A/D conversions, not the processing power.

"buy an SD card and format this to a FAT16 with my computer "
No. Use this:

"connect it to pins 11, 12 or 13 on my Arduino."
No:
(1) You are missing chip select.
(2) CS, SCK, MOSI need to be buffered from 5V levels to 3.3V levels. cd74HC4050 works great for that. Power it with 3.3V.
(3) MISO will work better if buffered back to a 5V level. 1 gate of 74HC125 works great for that, use CS to control its OE pin. Power it with 5V.
(4) SD cards need more 3.3V current than the 150mA supplied by the Arduino regulators.

It may be overkill, but one of the new Teensy 3.5/3.6 boards with built in SD card slot may work nicely in this application.

I'm not sure when full production is going to start, but the Kickstarter project is complete.

Ian.

1 Like