Which board to use?

Hi Everyone - this is my first message here,

I am new to arduino - had some experience with PIC microcontrollers in the past. I have a project that involves a number of digital inputs (photodiode-phototransistor - up to 24 of them) . The input data has to be timed really accurately, based on this data some 3d numerical calculations have to be executed (lots of sin, cos, tan, squares and square roots) then a simple output has to be generated. The calculation should not take more then 0.5 seconds ideally. The output can be, depending on the version - some lights, spoken messages, led display or even data through wifi to a computer program.

The project's purpose is to develop, produce and sell an industrial quality product.

What micro-controller and board (boards) should I use?
Do I have to use floating point math or 32 bit integer would do?

Thanks,
Andrew

The digital inputs you could handle with a shift register (eg. 74HC165) or 16-bit port expander connected to I2C or SPI.

lots of sin, cos, tan, squares and square roots

How many, specifically? If you give a sample calculation, I could time how long it would take (as could you, if you already have an Arduino board).

I have a project which calculates prime numbers. It is doing one every 500 mS.

http://forum.arduino.cc//index.php?topic=192209

For each prime number I reckon it has to do one square root, and over 1000 divisions. For non-primes it will probably stop dividing sooner (because it hits a zero remainder).

I did not work out the numerical method to solve my rather complicated system of equations - it also depends on how powerful the processor is - might be able to use some brute force method it it is.

kacago22:
Hi Everyone - this is my first message here,

I am new to arduino - had some experience with PIC microcontrollers in the past. I have a project that involves a number of digital inputs (photodiode-phototransistor - up to 24 of them) . The input data has to be timed really accurately, based on this data some 3d numerical calculations have to be executed (lots of sin, cos, tan, squares and square roots)

There's no real information in that statement - "really accurately" could mean anything from
hundredths of a second to sub-nanosecond.
"lots of sin, cos, tan..." could mean dozens or billions. Without some numbers how can anyone answer?

Well if you are heavily using floating point, that pretty much leaves out almost all boards that use the Arduino interface. The Intel Galileo might be the one exception to this, in that it uses an Intel Quark processor (but I am unsure if Quark has hardware floating point). However, the Galileo has some downsides (doing all pin I/O via I2C which is slow, and needing 5v 3a power input).

Alternatively, if don't have lots of real-time I/O requirements, it may be better to use one of the Linux SOC (system on a chip) systems that are popping up, such as Rasberry Pi, Beaglebone Black, pcDuino, etc. I believe these have the hardware floating point support, but they are weak on doing general purpose I/O.

A middle path would be doing most of the calculations on a machine with floating point support (such as the pi), and using an Arduino to read sensors, and interact with hardware. It complicates things a bit, having to program in two different environments (linux and Arduino), but it may be simpler to do it that way.

If you don't need the results fast, the Arduino machines do have floating point emulation in software. Where it might take 10,000 cycles to do a complex operation that you might do in a 100 or less on a PC. Note, that AVR based Arduinos (i.e. not the Due, DigiX, or Teensy 3.0) treat double as 'float' and int is 16-bit. This might given you different results, if you really are expecting to use full double precision and/or 32-bit integers.

I'll write my solver/algorithms in Visual C++ and test/debug them there first. I'll let you know how it goes in some time.

In your case go for the mega as the Uno only has 20 i/o pins. 0.5 secs for any calculation is huge even at 16MHz.

Mark