Go Down

Topic: Can Arduino produce 4 separate Sine Waves simult.. (Read 465 times) previous topic - next topic

diggum

Hi everyone,

I'm just getting started hacking with my Arduino, and have several project ideas.  One that I'd like to explore requires outputting 4 separate sine waves, at different frequencies, simultaneously.  I understand that I'd probably need to output square waves, and smooth them out with an external filter, however I'd like some control over shaping each of the waves.

Primarily, though, I'm hoping the chip has enough horsepower to perform this task.  If not, I'm sure I could accomplish something similar using 4 separate uC's, one for each output, but I'd love to make it clean and require only one processing unit.

Also, does anyone have any experience using lasers with photovaristors?  I'd like to modify my sine waves characteristics my subtly manipulating the amount of laser light the input receives, but am not sure if the standard photo components will work fine with laser light.

Thanks!
Durin

wayoda

Hi diggum ,
this depends very much on the maximum frequencies you need.

Eberhard

kuuk

#2
Dec 11, 2007, 10:55 am Last Edit: Dec 12, 2007, 02:05 am by leKuk Reason: 1
Quote
Hi everyone,
Also, does anyone have any experience using lasers with photovaristors?  I'd like to modify my sine waves characteristics my subtly manipulating the amount of laser light the input receives, but am not sure if the standard photo components will work fine with laser light.

have a look here: http://home.earthlink.net/~lenyr/modlaser.htm
i got real good results until my laserpointer decided not to tolerate me fooling around with it anymore. i think results could be dependant on the wave length of the laser you're using. i used a standard cheap red from a laserpointer (650nm).

the frequency/light thing is exactly what i'm working on. getting multiple different squarewaves out of your arduino is a little tricky as you can't use the built in timers by default (like for PWM). There's a great library called FreqTimer2 in the playground which helps you doing this for one pin / one frequency. it basically takes one timer from the PWM functions and offers a convient way to create squarewaves with a fixed period.

in general this should be possible with more pins if you don't need PWM or other timing, i'm just getting into this timing thing. As Eberhard pointed out, precision depends very much on the maximum freq you need. This is even more true if you do this manually (that is writing arduino code to switch pins on and off). But if you only need to generate different squarewaves (not much more processing) you might want to try this out.

it might get hard though to measure precision in the higher audible range without an oscillograph or a similar professional tool. (my guitar tuner did not help here).

i hope this helped,
kuk

(edited.)

Go Up