Go Down

Topic: sine wave generator (Read 4968 times) previous topic - next topic

aphy

Hi. I just want to know if it is possible to output 25 kHz sine wave using arudino Duemilanove? I will use it to drive my ultrasonic sensor. Thanks! :D

AWOL

Does it really need a sine wave?
How clean does it need to be?
Do you have a spec for the transducers?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

aphy

I'm using Murata MA40E7r/s transducers. I'm really not sure if it will work on square waves, because i need the + and -

AWOL

Quote
I'm really not sure if it will work on square waves, because i need the + and -

Lots of designs use RS232 drivers for this purpose.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

AWOL

NB 40kHz (25us cycle time)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

aphy

so what's the simplest way to do?

AWOL

Well, depends what you're trying to do. (you haven't said)
The spec says 85V full-whack, but only with a 10Hz repetition rate.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

aphy

what I'm trying to do is just to use arduino as replacement for function generator. so I just need to output sine wave using arduino with frequency of 25 kHz.

AWOL

#9
Jun 22, 2011, 01:58 pm Last Edit: Jun 22, 2011, 02:02 pm by AWOL Reason: 1
These devices tend to be very resonant, and 25kHz is a long way off the spec of 40kHz, so it won't be very efficient at 25kHz.
Can you tell us what you want to do with this transducer/sensor pair?

The spec says you can drive it up to 85V, but only with 16 cycles of 40kHz (0.4ms) every 100ms. It will probably ring for at least as long (up to maybe a millisecond) again.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

aphy

Honestly, I just thought I would use 25 kHz because I need ultrasound to penetrate wood. Do you know someone who's done something like this before? I mean, I really need help. and what I'm trying to do is a hand-held device and so the first thing that I'm trying to do is make arduino act as a function generator.

Grumpy_Mike

Quote
I just thought I would use 25 kHz because I need ultrasound to penetrate wood

Ultra sound doesn't  penetrate wood.
Hit it with a square wave at 40KHz, it is going to go off at that rate anyway no matter what you hit it with.

AWOL

Quote
Honestly, I just thought I would use 25 kHz because I need ultrasound to penetrate wood

So why pick a 40kHz transducer?

These things are not like loudspeakers with a roughly flat response across part of the audio spectrum - they peak massively at their resonant frequency; that's what they're designed for.

Generating 40kHz is relatively simple (a simple for loop with some padding will need a little tuning and experimentation), it just depends what else you need to be doing at the same time, but you seem to be avoiding the question.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

aphy

ULTRASOUND PENETRATES WOOD.

why are you saying that i'm avoiding your question? i mean what question anyway?
what i am doing may be too simple for you so I just need to know how to generate sine wave using arduino? that's all. thank you

AWOL

Are you saying that the Arduino (which doesn't need to generate a sine wave; you can prove this by switching your sig-gen to square) just needs to generate 40kHz?
You could do that with a 555 and save yourself money.
Do you need continuous 40kHz (in which case you won't be able to use full power), or do you want bursts of maximum power at a PRR of 10Hz?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up