Can arduino Uno read multiple sensor inputs simultaneously?

Can anyone let me know if I can program arduino uno to read multiple sensor inputs (which are analog data) simultaneously? Also can it convert 3 separate analog data to digital data simultaneously using built in ADC?

Sorry, if the question is dumb. Im pretty new to this.

Thanks for any help.

No; there is only one A/D converter and conversions take around 100us to complete.

Yet we can sample at 60Khz plus. Google FastADC. 1/60Khz = 16us Please feel free to correct my math.

Also can it convert 3 separate analog data to digital data simultaneously using built in ADC?

Google "simultaneously" You may also want to google what you should do when switching the ADC mux rapidly.

The JeeLabs analogue plug looks as if it can take multiple A/D samples simultaneously, although I haven't used it myself. So, not just a matter of programming, but with programming plus a little extra hardware what you're asking for may be possible.

The JeeLabs analogue plug looks as if it can take multiple A/D samples simultaneously,

No it can't it uses a MCP3424 and can only sample at 240 samples a second, this is much slower than the built in A/D.

Often many beginners think they have to do things simultaneously, this is almost never done in computing. It is just things are done so quickly that it looks like a simultaneous operation.

I didn't realise the analogue board is also limited to one conversion at a time. Still, it makes it possible to do one conversion using the Arduino's internal A/D and one using the analogue board, doesn't it? Granted the requirement for truly simultaneous sampling may not be fundamentally necessary or sensible, but if it is necessary, could it be done by using the appropriate number of analogue input boards?

but if it is necessary, could it be done by using the appropriate number of analogue input boards?

Yes indeed it could.

the requirement for truly simultaneous sampling may not be fundamentally necessary or sensible,

Yes indeed it seldom is.

Multiple simultaneous sampling is sometimes necessary and then you do need more than one A/D but then you have to have the A/D hold on to the data until the processor collects it one at a time.

My point is that you can sample 5x in 100us. Not simultaneously.

What should we do when switching the ADC mux rapidly? I guess I'm already doing it, because the data is good?

I believe I read here recently that, when switching 'rapidly', one should read twice and disregard the result of the first read.

I appreciate your answer. I guess nobody else knew it, or they were challenging or quizzing us by bringing up the topic, then ignoring the questions about it?

The issue is that the A/D converter has a relatively low impedance and high capacitance and requires a finite time to settle at the voltage of the new input before you can get an accurate reading. Since the standard library only sets the MUX at the point you start taking a reading, this time all comes out of the AD conversion time. If you clock the A/D too fast, the cycle will complete before the analogue components have settled at the new voltage. By taking two samples on the same input you are effectively using the first sample just to switch the mux and trusting that by the time you have completed the second sample everything will be ready. Simply dropping the A/D clock rate would give a similar benefit, although of course you'd suffer a performance hit on every sample whereas the 'read it twice' hack would only be required where you were changing input and you could take advantage of the faster conversions if you were taking consecutive samples from the same input.

If you wanted to be clever you might look for ways to switch the MUX to your new input as part of the previous conversion, so that your processor can be thinking about other things while the analogue side gets its act together. Throwing half your samples away seems like a rather crude solution if your goal is to push the limits of the sampling frequency.

Analog Devices makes 4-channel and 6-channel simultaneous sampling ADCs. http://www.analog.com/static/imported-files/data_sheets/AD7865.pdf Conversions still done 1 at a time thru a mux, but incoming voltages are all sampled at the same & held for conversion.

http://www.analog.com/static/imported-files/data_sheets/AD7656_7657_7658.pdf This one has 6 ADCs, no muxing. SPI output

http://www.analog.com/static/imported-files/data_sheets/AD7606_7606-6_7606-4.pdf

I believe I read here recently that, when switching 'rapidly', one should read twice and disregard the result of the first read.

You read that right but misunderstood the context. That was when you are switching between inputs with greater than the optimal 10K source impedance. There is no need to do anything special on the arduino when switching rapidly as there is enough settling time built into the read function.

If your sensors direct controlled a grid of leds and you took a picture of that, you'd have simultaneous data.

I have small cheap DVI that records onto micro-SD and does control via USB. Would it be possible to make a plug that makes an Arduino look like a slow SD chip to the camera? Have it snap a pic and the Arduino gets the file data to do with as pleased?

GoForSmoke: If your sensors direct controlled a grid of leds and you took a picture of that, you'd have simultaneous data.

I have small cheap DVI that records onto micro-SD and does control via USB. Would it be possible to make a plug that makes an Arduino look like a slow SD chip to the camera? Have it snap a pic and the Arduino gets the file data to do with as pleased?

I think it should be possible, but it might depend what USB driver you use. The documentation for the UNO mentions that the Atmega8U2 chip used to drive the USB is programmable and can be configured to look like a keyboard, mouse or whatever. The way this was described made me think that the previous FTDI chip didn't have this capability. If your USB driver supported that I imagine it would be possible to emulate a storage device. You'd need to deal with the file system access protocol, and I have no idea how that works. Somebody'll know, though.

A USB memory stick is a diffrent sort of USB interface than keyboard or mouse. These are HID devices that are characterised by their slow data transfer rate. I doubt if you could make the arduino look like a USB stick.

True. But it can do PTP or Picture Transfer Protocol with many camera models.

Not memory stick but micro-SD in the case of this DVI camera. It's likely the Arduino UNO can't keep up. The camera also has a USB port and through that it works as a webcam. It can be commanded and it can transfer pictures and MP4 back. I really doubt that the Arduino UNO can keep up with that either. But maybe I'm wrong!

There are a lot of devices that do have SD slots. For a controller that can keep up, a faux-SD-card jack would open up a whole new can or worms.... errrr... possibilities.

GoForSmoke: It's likely the Arduino UNO can't keep up.

If we're throwing opinions around, I'll add mine. Since we know that SD cards come in different speeds, I suspect the electronics is asynchronous, that is, after it receives a command to read or write, it then replies saying it is ready for the next command. I suspect it is not synchronous, that is, needing to have the data appear on the bus after a certain number of clock ticks. If one were to make an Arduino impersonate an SD card as fast as it could, it might only appear to the device as a really slow card. So I think it might work.

However, to impersonate a card, you would also have to impersonate the whole file system, such as FAT32, and then be able to pick out which bytes form a file. This might not be as easy.