200V piezo crystal driver

Spoiler alert: I got the driving circuitry to behave as planned, but I could not feel the crystal vibrate.

The idea is to use the tiny crystals used in piezoelectric motors to create an array of dots that can be made to vibrate under the area of a finger tip. This will be used to create a tactile display that can be felt. The initial aim would be an array of these crystals under an area the size of your fingertip. This would enable things like a Braille or Moon display that can be felt under your finger and that updates real time.

The crysals came from pcbmotor. These crystals are polarised, so I soldered the gold side to the where the +ve signal will come from. I could measure the capacitance of the crystals through the pins on the adapter board (disconnected from the breadboard, as breadboard has lots of capacitance) at around 10pF. Measuring capacitance this small is difficult with my cheapo eBay sourced meter. But it is a sanity check that I have something soldered down that has the electronic characteristics I expect.

A single crystal soldered to some flying leads can be seen in the photo below. The green adapter board allows the crystals to be mounted on a breadboard for experimentation.

Piezo transducer mounted on flying leads.

Two of these crystals can be seen soldered onto the bottom row of pads at the left of an adapter board below.

Two piezo electric crystals mounted on the bottom left of an adapter board.

I checked on the piezo crystal polarity by connecting the pins that they are connected to on theiradapter board to a Tektronix DMM 4050 6 1/2 digit precision multimeter. When I pressed on top of the crystals with a pencil rubber, I could see an inital potential of around +10mV when the cables were connected with the positive and negative the way I think that the crystal is polarised. This deflection is reversed when I connect the cables with opposite polarity. This verifies that the crystal is alive and that it has a connection to the pins.

These crystals are designed to resonate at around 40-42 kHz. Now, you won't feel something vibrating at this high a frequency. Your touch is sensitive to vibrations of around 10-100 Hz. So the crystals need to be driven with a frequency of around 40 kHz, which is then switched on and off (modulated in engineering speak) at around 30 Hz. All of this with a voltage amplitude of around 100 V RMS (200 V peak to peak for a square wave). How hard could that be? Errrr....

I built a 100 V power supply in another post here. To get a higher voltage I used two Rohde & Schwarz HMP4040 adjustable power supplies I found in the lab. I read the supply's manual online to check that the outputs could be connected in serial safely. I ended up with an output of around a 220 V. The power supplies allow for the current output to be limited, which is a good safety feature when prototyping.

How to create a 40-42 kHz output signal which is then switched on and off at about 30-50 Hz? I used an N-channel MOSFET (FET) to switch a low voltage signal, with the gate of the transistor operated by an operational amplifier (op amp). The op amp input comes from an external microcontroller. I thought of lashing something up to create this input using a BBC micro:bit. Then I hosed money at the problem until it went away and bought an Analog Discovery 2 gizmo with a built in waveform generator. The software for the Analog Discovery allows for signals to be modulated, so I could easily create got the driving signal I was after. There are a range of YouTube videos to get you started with the Analog Discovery 2.

Why use an op-amp to switch the gate of the FET? A FET needs a certain amount of charge applied to the gate before it will fully open. An op-amp has the 'oomph' to supply the necessary charge to fully open the FET quickly.

Top tip. Run the Analog Discovery from a laptop and disconnect the laptop from the mains when connecting the Analog Discovery 2 to your circuit. I measured the potential difference between the ground on the Analog Discovery 2 and my circuit and it was around 0.06V with the laptop connected to mains power. When running on battery, the potential difference was a magnitude lower. This means there is less chance of a 'ground loop' cooking off your laptop when you connect the ground of the Analog Discover 2 waveform generator to the ground of your circuit board.

I simulated the circuit using the Falstad and ltspice simulators. Simulate twice, build once as my Grandma used to say. I tried the qucs simulator as well, but could not get it to 'converge' with my design. Probably something I'm doing wrong.

Falstad is not as accurate or configurable as Ltspice but is more interactive. The two packages are designed for different applications, but their functionality overlaps. Falstad runs through the browser. I found a downloadable version of Falstad called Circuit Simulator here. This is useful for me as when I am travelling to and from survey ships on supply vessels, the internet access is often limited. I'm grateful for these simulators being made available.

A screen grab from Falstad/Circuit Simulator can be seen below. I use a CA3140 CMOS op-amp as I found a few of them in the lab and they are fit for purpose. The FET is a 450V rated N-channel SSN1N45B (farnell p/n 2454128). This FET can handle the voltage that I need to use and can be switched on and off with a reasonably low voltage swing to the gate.

Falstad simulation of the piezo driver. The piezo crystal is represented by the 20pF capacitor.

The full experimental set up can be seen below. The breadboard with the piezo crystals, FET and op-amp is in the foreground. The Analog Discovery 2 which generates the modulated driving signal is the green box to the right of the breadboad. The Analog Discovery 2 is powered and controlled by the laptop, running the Waveforms software to control the Analog Discovery 2. Behind the laptop are two beige Rohde and Shwarz HMP4040 power supplies. The outputs from these are connected in serial to create the 220+V high voltage power rail. The two sockets on the top left power supply are separate from this and output around 8V to power the op-amp with. In the background there is a Tektronix TBS1104 oscilloscope. You can see the mess of 4mm banana plug red, black, blue and green cables needed to power the circuit and feed signals from the Analog Discovery 2. It is hard to find enough of these cables in any lab, so I keep a stash of my own.

Piezo driver breadboard circuit, power supplies, signal generator and 'scope.

A photo showing the breadboard assembly is shown below. The op-amp is on the bottom left. The FET is to the right of this. I added a diode to protect the FET from back EMF. There are mutiple resistors instead of the single resistor shown in the Falstad schematic. The resistors are each rated to 0.25W. Daisy chaining several smaller value resistors instead of using a single large value ensures that the power rating of the resistors is not exceeded. Otherwise they emit magic smoke and don't work any more. I added a couple of LEDs to show when the op-amp is powered on and when the high voltage rail is live. A couple of black oscilloscope probes connected to the FET gate and to the input to the piezo crystals can be seen on the bottom of the image. Having the 4mm sockets for the breadboard is useful - otherwise you end up with a mess of crocodile clips which inevitably touch and short each other.

Piezo driver breadboard circuit. The piezo crystals are on the green board.

An example 'scope grab from a Tektronix TBS1104 is shown below. The orange trace is the signal from the Analog Discovery 2 board used as the input to the non-inverting port of the op-amp. The output from this op-amp switches the FET on and off. The green trace is the voltage at the high side of the piezo crystal. In this display, the driving voltage is 212V peak to peak, which is 106V RMS for a square wave. The dense bursts of signal are the 40kHz driver, the larger gaps show that this is being switched on and off at around 30Hz. The signal frequency on the 'scope is shown as 6.250kHz, with a question mark, as the modulation of the 40kHz with the 30Hz signal confuses the 'scope's frequency measurement.

piezo driver signal, 40kHz moudulated at 30Hz

The 'scope grab below shows a close up of the gate driver where I try 41kHz as driving frequency for the piezo crystal. We can see that the FET gate is being driven with a 7.6V peak to peak square wave, which enables the 226V high voltage rail to be switched to generate the piezo driver signal. I tried a few frequencies to try and get the crystal to resonate. The gate of the FET needs around 7.5V peak to peak to 'open' the FET enough for the full 226V to switch through it. With a lower high voltage supply, a lower FET gate voltage is needed. I spent a few years trying to study physics, so did at one time have a good understanding of all the semiconductor shenanigans that go on inside the transistor. That was a long time ago.

piezo driving signal, 41kHz

We can see that when the FET gate goes high, the piezo driving voltage goes low. This is as the FET is opened by the gate going high, which connects the drain to source to ground through the 300Ohm resistor. This pulls the voltage low. When the gate signal is low, the FET is closed, so the high voltage rail is measured at the piezo crystal.

I messed around with some transformers to generate the piezo driving signal with limited result. I could wind a transformer of my own, but would rather use something off the shelf. I tried a few from coilcraft but without success. You need to be careful with transformers, as their impedance changes with frequency, meaning you can end up putting more current through them than their windings are designed for if you're not careful, as shown by Electroboom.

I am waiting on a couple of high voltage op-amp samples from analog devices to play with. However, if I can't feel the crystals vibrating with the FET circuit, I don't see why I should feel them shake with a high voltage op-amp circuit either.

Something I could try - the Analog Discover 2 has the facility to sweep a range of frequencies. I should try this from say 38kHz to 45kHz. It could be that the resonant frequency of the crystal has such a narrow band ('high Q') that I'm missing it by testing at 40, 41 and 42kHz only. I tried testing with a 10Hz modulation as I'm informed that we are quite receptive to this frequency of vibration.

I tried soldering a crystal onto some flying leads made from wire wrap cable. This setup allows me to feel more easily if the crystal is vibrating with my fingers. I wear disposable gloves as there will be a tingling when using a bare finger otherwise -from the current passing between 220V! I suspect that initial reports of feeling a vibration using a demo board made by a PCB motor manufacturer were in from feeling current, not the crystal vibrating.

There's only so much time I want to pump into this. I've spent too much time over the years holding onto projects that were never going to work with hindsight. On t'other hand, you don't want to miss finding your pot of gold by not digging the last hole at the end of the rainbow. This may not be a good analogy.

Skills I revised during this project: basic transistor and op-amp circuit design. I got to grips with the basics of LTSpice as well, something I've wanted to do for a while.

April 2019 Update

I bought a 0.001mm resolution micrometer to see if I could measure a change in size of the crystal when I hit it with the 220V peak to peak signal. I could convince myself there is a 0.005mm deformation, but this may be 'confirmation bias' as the experimental arrangement is not ideal. Trying to use a micrometer gauge on a crystal with flying led to the leads being torn off by the micrometer plates. So I soldered a crystal down. Then I realised that the micrometer plates would short out the two sides of the crystal. So I painted the crystal. Still conductive. So I coated it in clear nail varnish. This seemed to do the trick. But getting an accurate measurement is not easy.

I also rejigged the circuit so that one side of the crystal is held at +100V, while the other side is pulled from 0 to 220V. This means that the crystal plate connected to the varying voltage will see a swing of -100V to +110V compated with the side held at+100V. I hoped this would make the crystal expand and contract in a more tactile manner. No joy. The Falstad circuit simulation for this is shown below. The code for this can be found at the end of the article.

Modified piezo crystal driving circuit simulated in Falstad.

I created a driving signal that sweeps from 38kHz to 42kHz (which I call a 'chirp'), modulated at 10Hz, to increase the chance of the crystal resonating at some point in the sweep.

The Analog Discovery 2 from Digilent can be set up to produce this modulated chirp signal. One of the two waveform channels on the Discovery 2 board creates a 'chirp' that sweeps from 28kHz to 42kHz. This is set to start on an external trigger. This external trigger is generated by using the second waveform channel, which is configured as a 10Hz square wave. Be sure to DC offset the waveform signals to be above ground, as by default they are symmetrical +/- around ground. As the FET circuit only works for signals above ground, the negative signal don't do much. I learned this the hard way. 'Why is my transistor not turning on'. <Homer Simpson> D'oh <\Homer Simpson>.

The experimental arrangement can be seen below. The yellow crocodile clip is the +100V rail applied to the negative of the piezo crystal. This crystal is on the small board just above the yellow clip. The red plug supplies the +220V rail voltage. The black plug is ground. The green plug going into the yellow socket is +9V for the op-amp. The green plug going into the blue socket is the output from the waveform generator. The nest of resistors just below the green LED are in series with the LED, to indicate when the +220V rail is live. A number of resistors were needed to get the power per resistor below 1/4W. The resistors are only rated to this power. I found this out by wondering why I could smell something burning.

You can't really see the FET on this photo, it is hidden under the looping red wire on the photo. The op amp is the old-school chip on the bottom left of the breadboard.

Piezo crystal driving circuit. The crystal is on the small board on the right of the breadboard.

Still no tactile response from the crystal. A Tektronix screen grab of the driving signal to the gate of the FET (top trace) and the voltage measured between ground and the positive side of the piezo crystal is shown below. The scale is too coarse to see that the frequencies are sweeping through a range. The display is highly aliased at the timescale shown.

Tektronix 'scope screen grab of the chirped signal. Top is the FET driver, bottom is the signal on the piezo crystal.

What I need is the piezo crystal's demo board. The lecturer who started this project claims he felt a tactile response when driving this kind of piezo crystal, which is mounted on that board . If this board can be found, I will see if I can replicate the tactile sensation and take it from there. I suspect that the sensation was from the current running through the crystal, not from the crystal deforming. The amount of deformation is tiny.

Falstad simulator code for the piezo crystal driving circuit

Just copy and paste the code into the box that comes up when you click on 'File', 'Import From Text' in the Falstad circuit simulator.

$ 1 2.5e-9 21.593987231061412 50 5 50
w 448 288 560 288 0
w 560 480 560 496 0
f 448 464 560 464 0 1.5 0.02
R 448 288 400 288 0 0 40 200 0 0 0.5
g 560 560 560 608 0
r 192 560 192 624 0 1000
w 320 464 384 464 0
w 192 384 192 448 0
w 96 384 192 384 0
a 192 464 320 464 9 9 0 1000000 3.999920001599971 4 100000
w 192 480 192 528 0
g 96 528 96 576 0
v 96 528 96 384 0 2 40000 2 2 0 0.5
w 384 464 448 464 0
r 560 336 560 400 0 22000
w 560 288 560 336 0
w 560 400 560 448 0
c 608 400 608 496 0 2e-11 -97.19155019928473
r 192 528 320 528 0 1000
c 240 560 288 560 0 1e-11 -3.999920001256246
w 288 560 320 560 0
w 320 560 320 528 0
w 240 560 192 560 0
w 192 528 192 560 0
g 192 624 192 672 0
w 608 400 560 400 0
r 560 496 560 560 0 300
w 320 528 320 464 0
R 672 560 736 560 0 0 40 100 0 0 0.5
p 672 400 672 560 1 0
w 608 400 672 400 0
w 608 560 672 560 0
r 608 496 608 560 0 300
x 740 487 838 490 4 24 voltmeter
x 621 430 754 433 4 24 piezo\scrystal
o 16 64 0 4099 320 0.05 0 2 16 3
o 6 64 0 4099 10 0.00009765625 1 2 6 3
o 29 64 0 4098 160 0.1 2 1