Hi everybody,
my Name is Fabi and I am working in a Research Lab in Germany. We are studying the physiology of the brain. I developed an cognitive experiment, where the proband has to react to a stimulus with a keypress on a keyboard with two buttons. The Stimulus and the keypress are logged with a software and a trigger is also sent to a computer which loggs the vital data (EEG, EKG, blood preasure and much more). The experiment is working and we want to proceed to next level and test the proband when they are doing physical exercises. The easiest way for us is to let the person use a home trainer bike.
Now my problem:
I want to put the two keys on the bike, they should be connected to the PC and recognized as keys, so i can logg the keypresses and timings with the stimulus software. Do you think it is possible to use arduino for this purpose.
Yes it is possible. Yyou should take into account that there is some latency in the USB connection. If you need to log only two keys and Arduino is absolute overkill. There are many simpler and cheaper devices for this task:
Hi,
i don`t want to programm the whole test for the arduino, because that would take me a lot of time and i would loose some of the features which the implementation with the stimulus delivery and experimental control program offers me.
You need to tell us how exact the measurements need to be.
It is possible to compensate for latency if you know what you are doing.
You do not need to program the whole test for the Arduino. It is sufficient to pick up one additional signal: the stimulus. That is you just record the stimulus and the time for the response.
PCs make lousy measurement devices. If you relied on a PC for measurements so far chances are that your measured results have somewhat poor precision. Or did you calibrate the setup?
The measurements should be as exact as possible. Our setup is pretty good. I am using a software called "Presentation" which runs on PC1. It is a special enviroment for test implementation, stimulus presentation and response measurement. PC1 is connected over the parallel port with a self made cable to the measuring amplifier. Every time a stimulus is shown or a keytroke is detected by the presentation software a trigger signal is send to the amplifier. The amplifier gets as input diverse vital parameters and send them together with the trigger signals over the output port to Pc2. The software of the amplifier loggs everything.
I calibrated and tuned the system with some packages which were provided by the company who build the amplifier. Judging from the test result and the measurements which we have done so far seenms the system quite reliable.
Then using an Arduino to start and stop the measurements will be much more precise than any PC. Even with a parallel port (where on Earth did you find a PC with one of them these days?) a PC still has to piss around with layers of OS (unless it's really old).
"as exact as possible" still doesn't say what you need. As I said if that is the criteria then you can't do better then the bare-metal Arduino unless you go to hardware. If you are happy with the current PC setup then I guess it doesn't really have to be that accurate (by embedded computing standards).
What sort of numbers does the current system show?
The measurements should be as exact as possible. Our setup is pretty good.
You are working for a research lab, so "as please quantify as exact as possible". Maximum time resolution with a modified Arduino would be 50ns. However with such a resolution clock instabilities come into play. Also interrupts must be considered.
So my first question would be:
is 1ms sufficient?
0.1ms?
10us?
1us?
Or do you really need to go down as far as possible (femto seconds)? I you measure reacting times I would expect that 0.1ms is more than good enough but I have no idea what you are really after.
Did you ever verify your "pretty accurate" setup against some precise measurement equipment? I would strongly recommend this. Unless you know how much accuracy you need and how much accuracy your equipment actually supports you may be measuring the wrong stuff.
For example if you PC accepts keyboard input during measurements this will most definitely impose some kind of jitter into the measurement.