Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

i would like to generate Chirp Signal (Frequency Sweep) using Arduino. i have searched a lot in internet but didn't find anything.

Basically, any parameters is also ok. But the concept is what i am searching for. The signal will be sent to the DAC of the Arduino board.

Edit I would like to generate sine wave signal from 3kHz up to 100kHz sweep frequency with amplitude peak to peak 1.5 volt.

thanks for your support.

share|improve this question
1  
That's a potentially complex subject. Providing more detail about what you are trying to do and why will help you to get better answers (or any answers). I assume you mean chirp in the DSP sense - swept-frequency cosine signal with unity amplitude and continuous phase. OR you could mean simply a frequency swept signal - as people sometimes use the term. Or you may be talking about crickets :-).So ...? –  Russell McMahon Feb 4 at 9:52
1  
(1) What frequency range, and what sweep rate, do you want? (2) Why do you want it? ie, what is it for? (3) What "DAC module" do you mean? Some shield? [Please edit your question to answer these items, rather than answering in comments.] –  jwpat7 Feb 4 at 17:27

2 Answers 2

Recommend to use a VCO PLL as external hardware device to get the wanted variable-frequency signal. The DAC output from Arduino can control the voltage to external VCO PLL module. Here is the link for an app note for VCO PLL from Vectron.

http://www.vectron.com/products/vcxo/vcxo.pdf

Hope it helps.

share|improve this answer
    
Thanks a lot. it nice suggestion –  user3213767 Feb 5 at 16:43

If you're ok with starting with square wave signals, this can be done on an Arduino. You need to do the following:

  1. Configure a 16-bit Timer to CTC mode
  2. Select the right prescaling
  3. Add a RC low pass filter to the output and voltage divider

Configure a 16-bit Timer to CTC mode

Assuming I'm using Timer 1 and OCR1A:

TCCR1A |= (1<<COM1A0); // Toggle OC1A on match
TCCR1B |= (1<<WGM12); // Clear to Compare mode
TCCR1B |= (1<<CS10); // No prescale

Select the right prescaling

In case you're wondering, prescales are used when the MCU clock is much faster than the output you desire. Without prescaling, the highest frequency is 16MHz/2 = 8MHz, and the lowest frequency would be 8MHz / 2^16 = 122Hz . Which covers the range of frequencies that we want.

Setting OCR1A value to 80 gives you a frequency of 100kHz Setting OCR1A value to 2667 gives you a frequency of 2.9996kHz

You can then control the chirp like so:

// Linear rise in wave period
int x = 10;
for (int x=80; x < 2668; ++x){
  OCR1A = x; 
  delay(10); // 10ms delay
}

Add a RC low pass filter to the output and voltage divider

Making the perfect sine waves may be too troublesome, so we'll resort to the poor man's sine wave.

Here's the poor man's implementation by TI (still require quite a few parts.)

Personally, I'm cheap so I'd go for the RLC approach. ;-)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.