I would like to make an ultrasonic sensor. For reciever part I have found this scheme: (source: www.kerrywong.com/2011/01/22/a-sensitive-diy-ultrasonic-range-sensor/) http://www.kerrywong.com/2011/01/22/a-sensitive-diy-ultrasonic-range-sensor/

Instead of LPC662 I would use LM358 dual amp. What values should I use for resistors and capacitors? Could I use 3.3V for Vcc (I am using ESP8266, which runs on 3.3V). There is no application example for serial use of the LM385 in datasheet.


What about transmitter? Is this scheme ok?enter image description here Would it work on 3.3V?

  • \$\begingroup\$ I don't see why it wouldn't work. The 358 can operate on 3V, so 3.3V is Ok. The circuit isn't doing anything exotic. I'd build as is. It even looks like the pinout is the same for both parts. All of the given values should be pretty much independent of the opamp. Still, I'm not an expert so I may have missed some gotcha - that's why this is a comment instead of an answer. \$\endgroup\$ – JRE Aug 13 '16 at 13:17
  • \$\begingroup\$ Both amplifiers seem to have a rather low gain-bandwidth product; with a gain of 66.7, the LPC662 (GBW typical of 350kHz) would have a bandwidth of 5.25kHz and the LM358 of 10.5kHz. This does not mean the circuit will not work - it will just take a while to respond (and would be slightly inaccurate). For the 24kHz transducers used, a more suitable amplifier would need a GBW of at least 1.6MHz and the output stage needs a slew rate of 0.7 V/μs for a linear output. \$\endgroup\$ – Peter Smith Aug 13 '16 at 15:30
  • \$\begingroup\$ @petersmith: The circuit with the LPC662 is a (presumably functional) circuit in use else where. So, the LM358 can only be an improvement in terms response and accuracy. \$\endgroup\$ – JRE Aug 13 '16 at 16:25
  • \$\begingroup\$ @JRE - I agree and I never said it would not work :) I just think it could be better \$\endgroup\$ – Peter Smith Aug 13 '16 at 16:25
  • \$\begingroup\$ @petersmith Thanks for your replies :) I have a 40khz transducer. Would this circuit work with it? \$\endgroup\$ – user74857 Aug 13 '16 at 18:02

I'm not sure if this should actually be a comment, but here goes:

I just recently needed to make a custom ultrasonic sensor running at 40khz, though my setup was quite different. Here are some little tricks I encountered:

  • I had serious issues with low GBP. If you're doing ultrasonic ranging, you want a very sharp and fast response if you want accuracy. Just how much gain you need really depends on how powerful your transmitter is, and how far your object will be, but at about 1 meter with a 15v output drive, I got about a 5mv signal from the transducer. You do have a two-stage system, which is very good. I personally used a 8mhz single stage op amp.
  • Sample rate. You have a 40khz signal going into an arduino input. Arduino has a max sample rate + conversion time of 10khz. This means you very likely will never catch the first rising edge. This is very bad. Say you miss, on average, three pulses. If my math isn't wrong, then you have an inaccuracy of about +-0.0001 seconds. Speed of sound is 340 m/s, so you have an accuracy of ~ 3.5 centimeters. And that's sampling at the fastest possible speed. That might not be accurate enough for you. What I did was tack on a comparator at the end, set just higher than the noise, and fed that to a digital input. Digital inputs have no conversion time, and are much faster to poll; you can also set up an interrupt.
  • Filtering. I didn't need it, but I did have it; I had a bandpass with a 10k resistor + 430pf cap in series , and a 10k resistor + a 360pf cap in parrallel. Unless you are going to be in a situation where you have a lot of noise, you can probably leave it out.

None of this might be an issue in your case, but it's all, as Dave says, a trap for young players.

  • \$\begingroup\$ I don't really need accuracity. I will be using the sensor only for obstacle detection. IR sensor would be ok for that but I need reliable obstacle detection also in sun where IR works bad. So I probably don't need 2 op amps, right? \$\endgroup\$ – user74857 Aug 17 '16 at 14:34
  • \$\begingroup\$ Then this should be fine. \$\endgroup\$ – 0xDBFB7 Aug 17 '16 at 14:35
  • \$\begingroup\$ Could you please take a look also at transmitter part in post edit? \$\endgroup\$ – user74857 Aug 17 '16 at 14:51
  • \$\begingroup\$ @mbostic Looks pretty good, a typical h-bridge driver setup. Do you have a higher voltage available, say, 9 or 12v? \$\endgroup\$ – 0xDBFB7 Aug 17 '16 at 14:58
  • \$\begingroup\$ Also, are you going to be driving this from an arduino? I'm not confident in the arduino's ability to produce 40khz pwm signals. I know I never got it higher than like 10khz. \$\endgroup\$ – 0xDBFB7 Aug 17 '16 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy