For a project that I'm working on, I need to sample an analog signal at exactly 1 kHz, preferably for 1 or 2 seconds and send the data via serial (well this, among other things, but this is the biggest challenge). I'm already trying this for a few days, without big success. My first approach was to write signal to memory and then send the whole array, but the memory of the Uno is not big enough to hold all the 1000 samples (this might be easier to do on an Arduino Mega)....Another difficulty is to time the loop. Of course there is the delay() function, but with this function, one iteration will certainly take longer then 1 ms. I've tried to overcome this by using the micros() timer in a while loop (thereby reducing the jitter of one iteration).

Probably, I'm in a complete wrong direction and there is something much easier for this...any tips or tricks are welcome!

If you reduce resolution (byte)(analogRead(A0) >> 3) you should be able to buffer about 1000 and you can send them easily in binary.

I built a kind of oscilloscope that way ( display 1000 values horizontally and 255 pixel high is sufficient resolution for me)With standard analogRead I could chould choose the x resolution to anything above 200 ms.