Ultrasonic 'chirp' circuit

(Stephen Davies) #1

Had an interesting discussion at the space tonight regarding ways of generating a tone suitable for driving an ultrasonic transducer.

Managed to hack up an example using an Arduino Duemilanove. Signal shape looks good with regards to timing.

#include <SPI.h>

// Ultrasonic sensor ‘chirp’ generator.
// Stephen Davies
// 18 July 2018
// MOSI (11) - enable signal (active low)
// SCK (13) - ‘chirp’
void setup() {

SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));

void loop() {
if (Serial.available()) {

(Stephen Davies) #2

(Stephen Davies) #3

Andrew, google ‘ultrasonic driver schematic’.

(Stephen Davies) #4

TI make a chip that looks capable of driving a push-pull transformer circuit. SN6505B (repeat B)

(Andrew) #5

Making some headway, Steve has been very helpful.

The motivation for this is to measure the speed of sound in a given fluid. Actual timing values aside, my measurements won’t vary much, between 1050 and 1010. I want to use 1MHz transducers because of the shorter wavelength giving greater fidelity over 40kHz variants.

We have a 1MHz push-pull square wave on 2 pins though voltage is low (so will need more playing), this weekend will be to simplify the circuit from Wednesday, remove the diodes and see if that cleans up the signal.

*the chip is a 74LS02 NOR logic gate

Intend getting higher drive voltages through a boost converter and storage caps rather than separate power source.

Next is connecting the receiver to an opamp (or 2),my knowledge gap is running the Tx and Rx through the same transducer and having an effectively timed gate to ensure we don’t overload the opamp while transmitting. Intend standing off for n x ms to open and close a brief sampling window through the microcontroller so that we ignore the transducer ringing and any subsequent echos (given that it is a known distance).

Discussion is open to the floor and thanks in advance.


(Andrew) #6

After minimizing the circuit the setup as-is was not suitable, it appears that the mosfet has too much capacitance resulting in (D0 - signal #1, D1 - mosfet drain signal #2, D2 - signal #2):

Adding a pulldown resistor resulted in:

Finally I reverted to having transistors in a darlington pair, while not using mosfets, 500mA will be more than enough:

(Stephen Davies) #7

Hi Andrew,
am curious about your mosfet test.

  1. Which part did you use?
  2. What did the test circuit look like?

(Andrew) #8

Hi Stephen,

The mosfet (IRF1405) gate was connected directly to output on the NOR gate.

Current configuration is:


(Stephen Davies) #9

From memory the nor gate was a 74LS02. Am not surprised it didn’t work. The various TTL families, I.e. 74xx/74LSxx etc., have bugger all ability to drive high. Output high volts is ~3.3V, high drive current is limited to 0.4mA.

The IRF1405 threshold voltage is 2V min, 4V max. So TTL output may or may not turn it on. A high tie resistor would have helped. A CMOS nor gate like CD4001 would be even better. CMOS outputs drive pretty much rail to rail so a high output would be close to 5V. Much more current, typically 2-3mA.

(Andrew) #10

Had persistent issues driving mosfets at 1MHz so decided to hand wind a small 1:5 transformer - and am pleasantly surprised that it matches the frequency and inverts. It is low current but that will be the next problem to solve.