Pages: [1]   Go Down
Author Topic: High speed data collection project  (Read 629 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm researching what would be needed to do the following:
1. Collect 8 discrete inputs and one analog input every 1 millisecond, along with a millisecond timestamp, for about 1.5 seconds total collection time.
2. After collection, dump to a PC for analysis (USB or Ethernet)?
3. Discrete I/O is 24vdc, Analog is +-10vdc.
This process would re-occur once every 6 seconds.

My questions would be:
1. which piece of hardware.
2. programming method, IDE or gcc.
3. I assume i'll have to use a sheild with opto couplers for the discrete inputs, and a voltage divider for the analog?
4. Method to move the data to the PC (VB .NET)
5. is there anything else to consider?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Surely you only need a time stamp for one of the samples, if they're collected at regular intervals?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Earth (I think)
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm researching what would be needed to do the following:
1. Collect 8 discrete inputs and one analog input every 1 millisecond, along with a millisecond timestamp, for about 1.5 seconds total collection time.
I think the Arduino is fast enough to handle this, although outputting it to the computer might be a bit slower.
Quote
2. After collection, dump to a PC for analysis (USB or Ethernet)?
I generally use USB, but it depends on the application. If the Arduino is near the computer, USB will work fine, but if the Arduino is some distance away Ethernet would work better.
Quote
3. Discrete I/O is 24vdc, Analog is +-10vdc.
You'll want to wire in some opto-couplers and a voltage divider to step this down to the Arduino's 0-5v. If you want values between +10 and -10, the Arduino has a map() function which will allow you to map 0->5 onto -10->+10.
Quote
This process would re-occur once every 6 seconds.
The Arduino can probably handle this timing by itself, although it tends to drift by a few seconds every hour (depending on a variety of factors).

Quote
My questions would be:
1. which piece of hardware.
Any Arduino should do just fine.
Quote
2. programming method, IDE or gcc.
Your choice; the IDE converts your code to C++ and runs it through GCC.
Quote
3. I assume i'll have to use a sheild with opto couplers for the discrete inputs, and a voltage divider for the analog?
Correct; the Arduino can't handle voltages in the range you specified.
Quote
4. Method to move the data to the PC (VB .NET)
Serial should work, although you may find that you need to store the data for the 1500ms and transmit it after the readings are done, as Serial will slow down everything else. You'll need 1500*2 bytes, or 3K of RAM. I think the Mega has enough memory for this.
Quote
5. is there anything else to consider?
Not that I can think of.
Logged


UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11159
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like you'll be collecting about 3 bytes per millisecond. I think you may be able to transfer that over the serial port in real time if you wind the baud rate up, but with that approach you would be vulnerable to anything that stopped the receiver from handling the serial input promptly. It would be worth trying, anyway. If that doesn't work you'd need to buffer about 4500 bytes in total which is too much for a standard UNO but would fit easily into the 8KB of a Mega.

I would have thought you could use a voltage divider for each digital input too, as long as you remember to connect the grounds.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your datarate requirements sound doable on an Arduino. This is not really
very high-speed. I don't think it was mentioned, but you can pack the 8 digital
signals into a single byte for compression during transmission. Then you only
need to send 3-bytes with each transfer, 1 for digital, 2 for analog [10-bit data].
You need baudrate = 38,400 or faster.

I'm not sure it was explained completely, but if the ground on the system you're
monitoring is safe to connect the Arduino gnd to, eg, not a floating or AC circuit,
then you can feed in the 24V signals simply using 5:1 voltage dividers. Actually I've
seen appnotes [Microchip, not Atmel] where they connected to 120VAC signals,
but you need to be extra careful in picking the proper ground wire, or you'll blow
the system.

Also, Arduino will only convert positive-going analog signals, so you need to
translate the +/-10V using an opamp or voltage divider with pullup voltage.
If you don't need to read the actual DC level of the analog signal, you can
capacitively couple it.



Logged

Pages: [1]   Go Up
Jump to: