Could one of you tell me a simple way to sample a 2kHz signa

Could one of you tell me a simple way to sample a 2kHz signal (sine) with an arduino, with a sample rate of 6kHz. And to write the signal through the DA-converter to an oscilloscope.

I am using a Arduino Mega 2560, i am looking for the simplest solution, with as few hardware components as possible. The signal is given by a signal generator and can be set to what ever voltage is needed. And am thinking to just write the signal to one of the pins so that an oscilloscope can read it, doesn\'t really matter what voltage it reads and it doesn\'t have to be smoothed or filtered.

I know I should probably first use the build in ADC to get the signal into a buffer and then use the DA-converter to write the signal. But I don\'t really know how to do those things.

Some pseudo code would also help alot.

I am new to arduino and am not sure where i should put protective resistors an what the capabilities are of the arduino.

Thank you.

Solution

output voltage = Vn/2n * analog voltage

for full signal

analog voltage is given as 1111

output voltage = 8 + 4 + 2+1= 15 V

= Vn = 5V

output voltag = 5/24 * 15 = 75/16 = 4.72V

Could one of you tell me a simple way to sample a 2kHz signal (sine) with an arduino, with a sample rate of 6kHz. And to write the signal through the DA-convert

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site