Geration and sensing of very high frequency waveform

Hello, I am beginner to arduino. And using arduino uno.

I need sine waveforms (voltage waveforms) generated by arduino at around 1 MHz frequency. I hv tried but it can generate upto only few kHz.
And also need to record it at 1 MHz frequency using may be commands such as analogRead() does. But using analogRead() it can only take 10000 readings in 1 sec means 10kHz.
This things i need to excite and sense waves using piezos.
Can anybody please help me with this. Maybe any other hardware , or programming cammands capable of doing this.

The Uno doesn't have a DAC so without additional hardware sinewaves are out of the question.

I'd look for some different hardware, maybe you can find a digitally-controlled oscillator chip that you can control with the Arduino.

What time duration do you need to record and how much accuracy do you need? The Nyquist theory says you need a sample rate of at least twice the signal-frequency (one sample for the top-half of the waveform and one sample for the bottom-half of the waveform). So, one second of 1MHz signal would require at least 2MB of memory. If you need "oscilloscope type" resolution, you'll need more like 10 samples per cycle, and of course if you need more than 8-bit resolution you need more memory.

I'm not sure what kind of ADC works at those frequencies, but it's "difficult".

The standard way of generating high frequencies is with a voltage controlled oscillator and a synthesiser chip.

Typical VCO's have a range of an octave or less. At 1MHz you could probably do rather better.

Are you worried about the purity ? harmonics ? phase noise? and do you want a variable level?

You may be better buying a cheap signal generator -save you a lot of work.....

As for measuring what do you want to know - frequency - to what accuracy? amplitude ? - ditto.

We'd have to know a bit more about what you're trying to achieve to help you



Thank u DVDdoug and allen for ur reply.

Actually slight error in in measurement of frequency Will work.
I am working on the project of damage detection in plates using lamb waves.
And trying to build the system which can excite, record and process data ( wave data). By itself so it can be used in real time applications.
For that i need to replace signal generator and oscilloscope with some other system like maybe some kind of electronics. Where i can generate, read, waveforms and also able to process it. Actually i am mechanical engineer and really dont know much about electronics and microcontroller

Also anything which will record for around 0.5 -1 sec will also work. But this cycles of exciting reading and processing needs to be repeated after certain time interval maybe 5-10min.

Yes, I've seen those ultrasonic crack detectors.... ( I've got a steamboat, and the boiler inspector often uses one)..

I reckon you need a gated power oscillator to drive your piezo, then a fast detector which will tell you
about reflections... what's the speed of sound in eg steel? ie how soon after you turn off your excitation source will you get an echo?

I fear this may be too quick for an arduino..



I am not using pulse echo method. I am using one piezo as actuator and another as sensor to read received waveforms these two are located at some distance from each other.
Thank u

And i dont want to just detect the waves . i need the data of about their frequency, amplitude, etc. So i can further process this. Ultrasonic testing is little bit different than lamb waves testing.
Can u please tell me exactly what is gated power oscillator or voltage controlled oscillator.?
Can i controll this using arduino to send the waveforms of specific kind and for specific duration?

I thought you wanted to do radio frequency work - sorry.

So basically you need to send an ultrasound signal through your test piece from point 'A' and detect it at point 'B'.

The 1MHz generator should not be too difficult. Obviously I'd need to know the characteristics of the transmit transducer.

A fast detector is certainly possible , but you presumably want to detect both the 'direct' path ( which will arrive first) then the various reflections..... which may be very much smaller than the direct signal.

So : what resolution in time do you need? - as you say, the arduino can only process about 5000 samples a second. Even in air, that amounts to about 2.5 inches of distance - and I guess you want far better resolution than that! And the reflections, if a lot smaller than the direct path, may need something like a logarithmic amplitude detector with considerable dynamic range.

SO to acheive all that a fairly sophisticated bit of external electronics would be required.

It's not just an arduino with a couple of cheap bolt on goodies.


ps is this just for curiosity, or do you want to develop a serious product ?- could be an interesting challenge! But definitely not a 'knock it up over the weekend ' job......

Thank u allen
For ur curiosity. Yes i wanna develope a product. But it will be in testing phase. Currently i am not thinking about commercialize this. Only working in lab.

And about transducer.
Transducer is piezoelectric wafer. A small patch of around 10mm dia and 1 mm thick. This piezo is pasted on plate with epoxy adhesives like araldite. & When the varying voltage is applied across its leads the piezo expands and contracts in its dimensions proportional to voltage applied. So producing waveforms in plates(strain waves). These waveform travels and when other piezo is subjected to these strain waves it produces voltage which is need to be sensed. This is i need to know how to sense such a high frequency.

Without overwhelming of all this. u can think i need something which produces voltage waveforms on any of pin(pins) or some further hardware attached to this output pin (pins) doesnt matter. All this on excitation side.

On sensing side i need to sense voltages in very small intervals and record this voltages along with the exact time of sensing. using this data i can reproduce a waveform sensed by piezo sensor( means i can plot something like voltage v/s time plot this can be done with excel. Or i just need data of time instance and amplitude so that i can perform certain mathematical operations on it maybe within microcontroller only, or on pc by sending this data to pc.) But currently i am not bothered about the processing of this data. I only need this data of voltage amplitude along with time instances.

And all this sensing and excitation i need around 1 MHz frequeonly. Also, I am not restricted to use only arduino. If u know any other things better then suggest.

Again thank you for ur valuable reply.

how many volts at 1MHz do you need? and what is the capacitance of the piezo? How big is the signal the receive piezo generates?

It might be worth measuring an existing device to get these numbers.. have you got an oscilloscope?

You can get very fast a/d convertors - one sampling at 1MHz is easy. The resulting datastream could be stored in memory and displayed on an LCD screen.

you will almost certainly need to pulse your source, then observe echos. If you sent a continuous wave all you would get at the receiver is a sine wave - a linear sum of the direct path and all the reflections. It would be different in phase and amplitude, but you couldn't infer much from that.

do imperfections in your test material generate harmonics ? ie do they behave non-linearly -that could be useful........



apart from seeing one used, I'm completely ignorant of the technique!

You can use AD9850 DDS Module to producing the waveforms and drive by circuit like this

And you need some op Amp like this to amplify the signal to be able to process by fast a/d converters.

Hi BillHo...

Your voltage trebler circuit only increases the dc volts , not ac. What for?

the 100k drive to the drive transistor won't provide nearly enough current . And what's the dc volts at the other end?

The 56k pulldown on the driver means the fall time will be very slow - not good at 1MHz. Better with a complementary driver.

you really need faster and bigger devices to generate much power at 1MHz.

Since the transmit piezo will have a sharp resonance, it would be nice to use it as the frequency determining
element in a power oscillator.

The TL081 only has a gain-bandwidth product of 3MHz - nowhere near enough. Plus I'd use a pretty sharp input notch filter at 1MHz to keep out rubbish. And you'd need to follow it with a fast precision rectifier, and perhaps a log amp stage to increase dynamic range.

edit - the 2SK596 is specc'd as a capacitor microphone preamp, and it's ac data is quoted at 1kHz. No idea how it would perform at 1MHz.

The AD9850 is a versatile widerange generator - well over the top for incorporating in a portable instrument running at one frequency



Thank you allen and billho

Yes i have Tektronix signal generator and oscilloscope.

So i can measure or verify what is happening.

And about the reflections ur talking about is right but i am going to send a pulse after certain time interval of time.

And about the excitation voltage it is ok if it does with 5v because i am planing to use amplifier further connected to this to get higher voltages. And it will be good if u suggest any because i need to for negative voltages also.

And about the voltage generated at sensor piezo it can be in mV also.

And i am not sure what is capacitance of piezo and how to measure it. But reading datasheets of piezos it requires very little current at low voltages to operate.

The measurement of the waveforms at 1MHz is the hard bit. Do you need to digitise it? Do you only want the peak amplitude?
The peak amplitude is best found with a peak detector and is very simple. If you want to study the waveform for things like harmonics then you need an A/D that has a sample rate many times higher than 1MHz, perhaps 100MHz. This takes you out of the realm of hobby electronics and micro processors and into the FPGA realm, which is a whole other level. Several levels in fact. There is a reason why the equipment to do this is expensive.

Thank u Grumpy_Mike

But can u tell little bit more about FPGA.
How to use it or can i program this according to my need.?.......

I know very less about electronics. Sorry for it.

And i dont want only peaks. I need complete information of waveform at least 10 samples per cycle. So that i can read upto 100 kHz waveforms.

An FPGA is a sort of chip, it stands for Field Programmable Gate Array. Google it.
It is way too advanced for beginners, it is too advanced for most experienced professional Electronic engineeres. It is a very specialist component. At one place I worked we had 300 electronic engineers and only 5 of them were FPGA specialists, or indeed could write anything for an FPGA. And that includes me.

Basically what I am saying is that your project is out of the reach of a lot of engineeres and you are wasting your time as a beginner trying to do it.

As a mechanical analogy imagin you had a 12 year old just starting to do metal work for the first time and he wanted to make a mechanical Babbage difference engine. What would you tell him?

The measurement of the waveforms at 1MHz is the hard bit. Do you need to digitise it? Do you only want the peak amplitude?
The peak amplitude is best found with a peak detector and is very simple. If you want to study the waveform for things like harmonics then you need an A/D that has a sample rate many times higher than 1MHz, perhaps 100MHz. This takes you out of the realm of hobby electronics and micro processors and into the FPGA realm, which is a whole other level. Several levels in fact. There is a reason why the equipment to do this is expensive.

I fully second that!

My choice were a fast dual channel scope for recording both the generated and received waves, and transmission to a PC or some portable device, for postprocessing of the data.

Dunno about the feasibility of the generator and piezo driver. But you seem to have solved most of this part of your project already?


I come at this this from a RF background, and it doesn't seem too bad.

eg The LT5537 is a wide range (>80dB) log detector which will work fine at 1MHz. It has a response time well under 10uS.

Other people make fast RF log detectors.

I'd use something like that as my front end , together with a tuned preamp.

The rest is a fastish a/d ( 1MHz would be OK - we're not trying to digitise the source frequency , just it's amplitude.) - memory , display, etc

thanks all of u for ur replies

hello Allen

yes we r trying to digitize only its amplitude not its frequency & trying store it or to display it

i don’t know about RF log detector. i tried google on it but got very little info may be out of my understanding.

I have some questions. about how to use this log detector in my project. Attaching the image below is from the datasheet of log detector LM5537. Also check what i understood is correct or not.
Now if i connect my piezos terminals to +IN & -IN of this log detector along with the capacitor to +CP & -CP as per my frequency requirement. ENBL terminal help me to enable and disable this device. and others Vcc & Vee as suply voltage and grounds respectively. then what it will do?
will it give me amplified output ? or anything else?
and if it is giving me amplified output. then what is its use as we are unable to sense the voltage at that much frequency using arduino?
or their is any method so we can store this data?
or u r talking to use this on excitation side?