Fast circuit for microsecond timing

Thread Starter

Stubby5000

Joined Sep 11, 2018
6
First let me just say that I’m a physician, not an electrical engineer, so I recognize that I’m way out of my league when it comes to the technical aspects of this forum. However, I’m eager to learn so if you’ll indulge my ignorance, I’d like to explain my project and you tell me what you think...

Basically I’m interested in creating a fast circuit that is capable of measuring timeframes with microsecond resolution (even as much as 50 microsecond resolution would probably be acceptable). The circuit would need to record the amount of time between when a microphone emits a sound and when that sound wave echos back (essentially echolocation). I’m interested in creating a circuit that is as cheap as possible, while still being reliable and accurate.

I’m finding it difficult to wrap my mind around the technical aspects of this circuit. I think I would need an analog to time converter, and then maybe a 555 timer? This is the part where I need expert assistance, thus why I’m on this forum. ;-)

Thanks for any assistance you might be able to provide.
 

KeithWalker

Joined Jul 10, 2017
3,098
First let me just say that I’m a physician, not an electrical engineer, so I recognize that I’m way out of my league when it comes to the technical aspects of this forum. However, I’m eager to learn so if you’ll indulge my ignorance, I’d like to explain my project and you tell me what you think...

Basically I’m interested in creating a fast circuit that is capable of measuring timeframes with microsecond resolution (even as much as 50 microsecond resolution would probably be acceptable). The circuit would need to record the amount of time between when a microphone emits a sound and when that sound wave echos back (essentially echolocation). I’m interested in creating a circuit that is as cheap as possible, while still being reliable and accurate.

I’m finding it difficult to wrap my mind around the technical aspects of this circuit. I think I would need an analog to time converter, and then maybe a 555 timer? This is the part where I need expert assistance, thus why I’m on this forum. ;-)

Thanks for any assistance you might be able to provide.
Unfortunately there is not a really simple way to do what you want. Discrete circuitry to measure this would be quite complex. The easiest way to do it would be by using a versatile microprocessor like an Arduino. To do it your self there would be a very steep learning curve if you have limited electronic and programming background.
 

crutschow

Joined Mar 14, 2008
34,470
Basically I’m interested in creating a fast circuit that is capable of measuring timeframes with microsecond resolution (even as much as 50 microsecond resolution would probably be acceptable). The circuit would need to record the amount of time between when a microphone emits a sound and when that sound wave echos back (essentially echolocation).
What is the total length of time between the emitting of the sound and its return?
50μs corresponds to a distance of about 0.6 inches for sound in air.
 

danadak

Joined Mar 10, 2018
4,057
The period measurement side of this is trivial. A counter with a known clock
and gate circuit to measure time quite straightforward. 1 uS resolution not a
issue for measurement.



The signal path to the counter more challenging -

1) Rejection of echos
2) Environmental conditions, like sound absorbing materials, materials with
different frequency absorption characteristics.

Some questions -

1) Environmentals, like humidity and T ranges working in ?
2) Range of distances ?
3) Any constraints on freq of sound emitted to initiate measurement ?
4) Environmental noise levels relative to emitted sound pulse (this
you may have to back into by experimentation) ?

https://en.wikipedia.org/wiki/Speed_of_sound

At 20 °C (68 °F), the speed of sound is about 343 meters per second
So 1 uS =~ .343 uMeters.

Regards, Dana.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
I forgot to add...

Several years ago, I tried ultrasonic echolocation for a small latch. Working distance was only a couple of inches or less. Got a sensor from Hyde Park, now Schneider (https://www.schneider-electric.com/en/product-range-presentation/61506-hyde-park-ultrasonic-sensors/). As I recall, the finer the resolution needed, the higher the frequency and the shorter the maximum working range went together -- at least for those sensors. Those sensors give a voltage proportional to distance (open collector output?). Resolution can be quite small. They were easy to use and I suspect there are several competitive products available.

One question is, at what working distance do you want to use this device (e.g., mm to kilometers)?
 

MrChips

Joined Oct 2, 2009
30,824
This is a perfectly doable project and it is not complicated.

Time-of-flight measurements of acoustic waves are usually done at ultrasonic frequencies, commonly known as ultrasonic range finders.
The HC-SR04 sensor is a popular module used to send and receive the ultrasonic wave.



https://www.robotshop.com/en/ultrasonic-range-finders.html

The speed of sound at room temperature is approx. 343 m/s.
It takes 1ms for sound to travel 343 mm. Since this is to be employed in an echolocation application, the distance to the target will be 343/2 = 171.5 mm or approx 17 cm.

1cm resolution would be 1/17 ms = 59μs

Using a 1MHz clock (1μs period) is not difficult to achieve, though you could relax this substantially depending on the desired resolution. A 17kHz clock will give you 1cm resolution. 171.5kHz will give 1mm resolution.

The hardware solution is relatively straight forward.
You have two options:

1) discrete digital ICs
2) use a microcontroller

Either solution is equally viable. The choice is yours.
 

Thread Starter

Stubby5000

Joined Sep 11, 2018
6
Thank you guys so much for the helpful responses. The AAC community rocks! Let me try to answer some of the questions that were asked, and generally provide more information about the project. FYI, this is not something I'm going to try and physically build myself (my skillset is far deficient for that). Rather, I just want to understand the feasibility of the device and get a ballpark sense of what it would cost.

Let me tell you more about this thing. What I'm interested in is a device that attaches via magnet to a sheet of stainless steel between 1.2mm and 2mm thick. The device would have a speaker/transmitter that would shoot off a sonic/ultrasonic wave into the steel. There would be a second medium between 1cm and 60cm away which would reflect the wave back towards the device, which needs to be able to detect the reflected wave and calculate the total transit time, from which it will determine the distance to the second medium. I estimated that the minimum resolution that would be acceptable would be measuring the distance in 1cm chunks. However, there's no upper limit to the resolution, as shorter would always be better. If I could get 1mm, or better, that'd be great. There are no constraints on the frequency of the emitted sound, and the environment should be relatively free of background noise.

It seems like perhaps the ultrasound sensor posted by MrChips would be a good option, especially since it only costs $2.50 (although I'm not sure if ultrasound would pass through steel the way I need it to). What other components would be required? 555 timer? Microcontroller? This is where I get quite lost in the details and my ignorance becomes obvious... ;-)

Again, thanks for the comments. I really appreciate it.
 

MrChips

Joined Oct 2, 2009
30,824
Always remember to present the big picture up front. This would avoid us playing the game of 101 Q&A.

Ultrasonics in air is one thing. Ultrasonics in metal is a completely different ballgame.
Now you are describing wave detection in some sort of metal container with an inner object 1 to 60cm away.
Forget about what hardware is needed for a moment. I think your problem is getting the acoustic wave through the steel wall towards your target object.

Off the top of my head, I would say that this is not an easy problem to solve.

Edit: You are attemping to detect some kind of object in a metal container. What is the medium inside the container? If you have access to the container and can drill holes in the wall of the container you might be able to image the contents using EIT (Electrical Impedance Tomography).
 

Thread Starter

Stubby5000

Joined Sep 11, 2018
6
Yes, this was my concern with the ultrasound route. What about physically banging on the metal with something? This would solve the problem of getting the wave through the metal. Then the device simply monitors the surface of the metal for the returning wave. I want to try and do this without drilling through the metal.
 

nsaspook

Joined Aug 27, 2009
13,315
Yes, this was my concern with the ultrasound route. What about physically banging on the metal with something? This would solve the problem of getting the wave through the metal. Then the device simply monitors the surface of the metal for the returning wave. I want to try and do this without drilling through the metal.
You might get lucky and get a usable signal for simple electronics but likely not something usable for close quarters microsecond timing without specific frequency and timing generated probe signals. One problem is impedance matching. You need to transfer energy from transducer, to the metal container, to air and generate a detectable echo signal that reverses the path back to a transducer. Just banging on the metal will produce a fairly wide-band signal that will need signal processing to separate the sonic energy absorbed by the container that wasn't transferred to air because of a impedance mismatch at the surface boundaries. Abrupt changes in impedance at a boundary between two objects or regions lead to low transmission of energy across the boundary. This energy has to go somewhere so it causes the metallic boundary to 'ring' as the energy is dissipated. This 'ring down' can easily drown out a return echo of a non-specialized signal.

http://assets.press.princeton.edu/chapters/s9912.pdf
 

MrChips

Joined Oct 2, 2009
30,824
Yes, this was my concern with the ultrasound route. What about physically banging on the metal with something? This would solve the problem of getting the wave through the metal. Then the device simply monitors the surface of the metal for the returning wave. I want to try and do this without drilling through the metal.
Your idea of physically banging on the container is the same as sending an acoustic ultrasonic wave.
You can do this with an ultrasonic transducer found in ultrasonic cleaners. They look like this:



What is this metal box and what is inside this metal box?
Tell us more.
 

Thread Starter

Stubby5000

Joined Sep 11, 2018
6
I think I understand what you're saying. A gross simplification would be that the metal will still be vibrating from the initial 'gong' such that picking up the return echo would be difficult, is that right? Wouldn't this ring down be very predictable, such that the microcontroller could say to itself, "The ring down pattern at 213μs should look like this, but instead I'm picking up this, so this must be the ring down + the returning echo."?
 

KeithWalker

Joined Jul 10, 2017
3,098
Yes, this was my concern with the ultrasound route. What about physically banging on the metal with something? This would solve the problem of getting the wave through the metal. Then the device simply monitors the surface of the metal for the returning wave. I want to try and do this without drilling through the metal.
Banging the metal with an automated hammer is a possible way of creating the signal. The transient will create vibrations in the sheet. The properties of the vibrations will depend on the size and shape of the steel sheet. If the frequency is too low, the distance resolution will be poor. If the generated transient is not suitably damped, the vibrations will continue long enough to mask the returning signal which will limit the minimum distance that can be measured.
Some experimentation will be needed to come up with an optimum arrangement.
The distance measuring circuit can be initiated by creating a pulse with the electrical contact of the hammer with the steel. The measurement can be terminated with a pulse from the return signal detector (electret microphone ?)
This could easily be controlled with an Arduino which would make the hardware cost very low
 

Thread Starter

Stubby5000

Joined Sep 11, 2018
6
Your idea of physically banging on the container is the same as sending an acoustic ultrasonic wave.
You can do this with an ultrasonic transducer found in ultrasonic cleaners. They look like this:



What is this metal box and what is inside this metal box?
Tell us more.
It's not my intention to be coy, but I want to avoid talking about the idea in great detail in a public forum. The reflecting medium is something which will return the vast majority of the acoustic energy back in the direction it came. It is not an enclosed space.
 

MrChips

Joined Oct 2, 2009
30,824
We don't know if this has been attempted and solved successfully. What you describe is a research topic at a university undergraduate or graduate level.

If you would like to share more details in private you can send me a PM. Just click on my avatar and "Start Conversation".
 

ebp

Joined Feb 8, 2018
2,332
Just for background, I'll describe briefly what is involved in an ultrasonic system for inspection of welds in pipelines:

An ultrasonic transducer, typically operating at 5 MHz, 10 MHz or 15 MHz is mounted on a "wedge" made of crosslinked polystyrene.
The wedge is spaced very slightly off the surface of the pipe and positioned at a distance of a few centimetres (axially) away from the weld.
Coupling between the transducer and the wedge is accomplished with a continuous flow of water into the gaps.
The transducer is excited with a single pulse a few nanoseconds wide and on the order of 300-400 V at 6-10 A.
Flaws cause reflections which return to the same transducer to produce a signal of a most a few millivolts.
Time of flight allows determination of the fault location. Multiple transducers with different positions and wedge angles are used in inspect the full thickness of the weld.

The transducers in question are several hundred dollars each.

If the ultrasonic signal were to reach an edge, a very large signal would be reflected due to the impedance mismatch between the steel and air.

==
Polaroid used to make some ultrasonic transducers much better suited to ranging through air than the things hobbyists are using. As far as I know, they haven't been made for several years.

==
Transducers that are resonant (like all of those used by hobbyists) take some time to respond to the returned signal as the amplitude slowly increases during the course of several cycles. Determining just when the returned signal has "arrived" becomes a limitation to resolution, especially if there are issues of multiple reflections.
 

Thread Starter

Stubby5000

Joined Sep 11, 2018
6
I have an appointment with an acoustical engineer on Friday, so hopefully I'll get some clarity on that side of things. My main goal with this post was to assess the difficulty in creating a device capable of measuring time in microsecond increments, and it seems like that shouldn't be difficult. Thanks again to all for the helpful comments!
 

panic mode

Joined Oct 10, 2011
2,761
no, that should not be a problem. your problem is describing what you really want to accomplish. i would suggest to not try to lead us with what you think solution should be, just describe desired outcome and let us come up with ideas.

so far i see nothing in the thread that does not suggest thin can with some fruit flies flying inside it. this is very different than detecting something more massive and in contact with the metal wall. and why do you think sound (or ultrasound) is the way to go?

what is the medium behind metal sheet?
what is the volume/mass/material of target?
is the medium homogeneous?
what is size and geometry of the medium and metal container?
 

Kjeldgaard

Joined Apr 7, 2016
476
Using ultrasound for thickness measurement of metal does not look very rare.

The following search gives a lot of hits: Ultrasonic metal thickness gauge
 
Top