Close

Differential drive for the ultrasound transmitter

A project log for Standing waves of sound

An ultrasonic interferometer is assembled from optical drive components, 3d-printed parts and an ultrasonic range-finder.

andrew-fergusonAndrew Ferguson 01/02/2016 at 20:350 Comments

I had been driving the ultrasound transmitter in a single-sided way, using the tone() function to output a square-wave to one side of the transducer while keeping the other side grounded. Using the Uno, this gives a 2.5 V amplitude square-wave drive to the transmitter. However a single-sided drive doesn't make the most of the microcontroller and instead of grounding the other side of the transmitter we can drive it with the complement of the other pin. This yields a 5 V amplitude square-wave, winning signal on the detector side.

I spotted the toneAC library after I had written code to implement these waveforms using timer1. It should do the trick nicely.

It seems to have worked, the graph below shows the change in signal size at the detector between single-sided and differential drive. I was expecting exactly a factor of two gain in signal size, but there is a little more than this and I will have to figure out why. You never quite get what you expect! Anyway, this is all good and I will be using differential drive from now on.

Discussions