Category Archives: Electronics

A DIY piezo pickup for double bass and other acoustic instruments

Here I’d like to share my version of a piezo-pickup for a double bass (and most other instruments). Those pickups can be quite expensive if you buy them at a music store but actually there is not much to them. The same transducers build into professional pickups can be bought at your local electronics store for less than a buck.

The big advantage of piezo-pickups compared to microphones and magnetic pickups is their sensitivity and linear frequency-response. This is especially important for double-bass pickups in the low 20 to 600 Hz regime which is notoriously difficult to capture well. Also they don’t require magnetic strings which is nice for all you friends of nylon and gut strings.

The tricky part about a piezo-pickup is designing a good amplifier to go with it. If you use a piezo-pickup with an ordinary instrument amplifier you will often hear a shallow metallic tone, lots of fretboard noise and very little low frequencies. This is because piezos have a very high impedance. If you connect an amplifier with a lower input impedance to your pickup, you will get selective reflection of some frequencies (mostly the low ones) and that doesn’t sound well. So be sure to only use amps with a high input impedance (>1MΩ, better >10MΩ) or put an impedance matching (more precisely: impedance bridging) circuit in between. How to build one yourself will be described in a later post.

All you need to build the piezo-pickup is:

  • a passive piezo-disc (I used a FT-36T), if you have an instrument in a low frequency range pick a large one, generally try to avoid a disc that has its resonance frequency in the range of your instrument, because this frequency will otherwise dominate all the others
  • shielded, flexible, single channel (copper braid works best), coaxial cable
  • a 6,3 mm audio jack socket (or 3.5 mm if you prefer to keep it small)
  • tinfoil
  • duct tape
  • double sided tape
  • wax/blu tack/glue
  • a soldering iron and solder

And this is how you build it:

Solder the center wire of the coaxial cable to the white center area of the piezo-disc. Solder the shielding of the coaxial cable to the yellow (or sometimes silver) colored part of the disc. Make sure there is no short-circuit and maybe put some glue on the solder for stability. On the other end of the cable solder the shielding of the coaxial cable to the outer contact of the audio socket (GND) and the center wire to the inner contact (signal).

To minimize noise by induced external fields I added some shielding to the piezo-disc. This was done by covering the white part of the disc completely with double-sided tape and adding a layer of tinfoil on top. The tinfoil should have electrical contact to the yellow part of the disc but none to the white part. Because I didn’t like the color of the tinfoil I added another layer of black duct-tape on top of that.


On the other side of the piezo-disc (the just yellow or silver side) I stuck a thin film of blu tack. This is the side you stick on your instrument. Alternatively wax should work fine too. For the best sound use hard glue (i.e. epoxy) but only if you have no intention of ever removing it again. Try to use a thin layer so that no sound waves get muffled when they travel from the corpus through the blu tack/wax/glue to the piezo-disc. It is useful to know that piezo-discs primarily pick up sound waves through a bending deformation of the disc and much less through linear pressure on the two sides. Thus it is important that the whole area of the disc is connected to the corpus of your instrument. Hence sticking the pickup onto your instrument using a peg probably won’t sound very good. It also bears the danger of resonant buzz between corpus, peg and pickup. The same buzzing occurs when the cable touches parts of the bass and is allowed to swing freely. Thus avoid letting it touch the bass or tightly attach it to the tailpiece.

I’ve tested variants of this pickup with several piezo-discs connected in series or parallel. What I found was that they are inferior in sound and amplitude compared to a single large piezo-disc. I guess this is because of interference effects when combining the slightly phase-shifted signals of the individual discs that pick up the signal at different positions on the corpus or bridge.

Positioning of the pickup:

Now you should consider where to stick you brand new pickup. For the double bass I experimented a little, asked around and tried to come up with some explanations why the sound is so different at different positions.

On stringed instruments the bridge transmits the vibrations of the strings onto the corpus. The left foot of the bridge (see image on the right) transmits primarily low frequencies since the thicker (lower frequency) strings press on it. The corpus of stringed instruments is usually made of a soft-wood front and a hard-wood back. This is because soft wood resonates better in lower frequencies while hard wood resonates better in the higher frequency range. Hence below the left foot of the bridge there is a piece of wood glued to the front inner side of the corpus. It helps to spread the lower frequencies from the left foot of the bridge across the entire front of the corpus. So If you are interested in capturing primarily low frequencies stick it on position 2. Similarly below the right foot of the bridge transmitting higher frequencies from the thinner strings there is a piece of wood (the sound post) connecting the front to the back of the corpus. It transmits the higher frequencies from the left foot of the bridge to the back of the corpus. If you are interested in the higher frequency range stick the pickup on pos. 4 then. However the bridge also transmits sounds from the movement of your fingers on the strings and slapping noises very well. If you are a Rockabilly bass player and you want to capture slapping sounds stick it on pos. 5 or directly on the inner side of the fretboard. If not, I don’t recommend placing the pickup too close to the bridge. Finger and fretboard noises are primarily of higher frequencies and thus don’t transmit well onto the bass-corpus. If you want a base-heavy, very clear sound try pos. 1 close to the f-hole. There resonance is strong and you are pretty far from the bridge. My favorite position is no. 3. This is the one people in recording studios prefer because it gives a good balance between low and high frequencies, no exaggerated resonances in some specific ranges like you find close to the f-holes and a diminished but not inaudible slapping response.

Of course you can always stick one pickup on each position that interests you, amplify each signal individually and mix them together as you please.




Leave a comment

Filed under Electronics

burnig bootloader and uploading sketches onto an ATMEL Atmega328P-PU using an Arduino UNO SMD

Now there is a great manual on the Arduino page on how to burn the Arduino bootloader on an Atmega328P-PU:

  • You just upload the ‘ArduinoISP’-sketch which you can find in the examples-section of the Arduino Software onto your Arduino Board (in my case it was an Arduino UNO SMD)
  • connect the Atmega chip as follows:


    source: (connections are the same for Atmega328P-PU)

  • Set: Tools -> Board to Arduino Uno (or Arduino Duemilanove w/ ATmega 328 or Nano w/ ATmega 328 for that matter). It does not have to match the Arduino board you are using to program the chip but rather it determines what bootloader will be installed on your Atmega-chip. You just have to select an Arduino with an Atmega328 onboard.)
  • Set: Tools -> Programmer to Arduino as ISP
  • click: Tools -> burn bootloader

For me it worked like a charm.

Now comes the interesting part: In the Arduino manual they tell you to remove the Atmega chip from your Arduino and to wire things differently in order to upload sketches onto your newly bootloaded Atmega-chip.

This is not necessary!! In Fact it isn’t even possible if you have an Arduino UNO like  I do.

Uploading Sketches:

  • leave the connections as shown in the figure above
  • open the sketch that you want to upload onto your Atmega-chip
  • Set: Tools -> Board to Arduino Uno (or Arduino Duemilanove w/ ATmega 328 or Nano w/ ATmega 328 for that matter; has to match the bootloader you installed previously!)
  • Set: Tools -> Programmer to Arduino as ISP
  • click: Sketch -> upload using programmer (This option may not exist in older versions of the Arduino software.)

Again, worked for me like a charm.

If you get error messages that read something like: wrong device id, you may have forgotten to supply the 5V DC to your Atmega chip or your bootloader isn’t installed properly. Try again.

If there is an error message that claims: problems with synchronization, your oscillator might not work. In this case remove the 16MHz oscillator and the two 18-22pF capacitors and install the bootloader for the 8MHz internal timer (as described in the Arduino manual). Then try uploading the sketch again

Leave a comment

Filed under Electronics

A really simple eyetracker

Another project that I wanted to share was a really simple-to-build eyetracker.

OLYMPUS DIGITAL CAMERAOLYMPUS DIGITAL CAMERAIt is basically just an old specs-frame with 3 webcams mounted on it – 2 pointing on either eye, the 3rd pointing ahead capturing the subjects field of view. Excuse the cloggy things wrapped in brown tape. They are the voltage regulator circuits for the (formerly internal) display cams that require 3.3V instead of the 5V that your external USB provides:


The eyetracker can sample at ~30Hz (depending on what cameras you use). A drawback is that you need 3 unoccupied USB-ports and your bus or video4linux might not support 3 simultaneous video streams.


The C++ code I wrote uses OpenCV to capture the image frames. During runtime you can calibrate the algorithm as follows:

Click into the window of either eye and draw a ROI (region of interest = blue square) by holding down the left mouse-button. The program will only search for irises with their center within the ROI. When holding down the right mouse-button you can draw a circle that has the approximate size of the iris so that the algorithm knows what kind of circles to search for. Then by clicking on points in the middle view whilst looking at the same points in the real world you can calibrate the program so that it knows what positions of the iris correspond to what positions in the middle view. I’m only using the last 3 calibration points and a perspective transform that does not correct for the spherical shape of the eye. However by mapping the entire field of view and applying some other co-registration function one could probably improve the result a lot. The iris-detection could use improvement as well since I’m only using the ‘HoughCircles’-function; well it’s work in progress. (It would probably be better to detect the pupil instead of the iris anyway.)

However if the calibration went well the blue dot in the middle-image should show where the eye is looking.

Leave a comment

Filed under Electronics

How to build a cheap 3D-scanner mostly out of spare parts

This paper that I wrote describes how to build a 3D scanner out of parts for less than 60 Euro and parts that were extracted from old printers, notebooks and so forth.

The scanner will be good for scanning a 360° field around its own position at distances of approx. 0.3 to 5 m. So basically this scanner is optimized to scan rooms and objects of a few centimeters up to a couple of meters size. It creates a point cloud that resembles the visible surface of the scanned area as viewed from the position of the scanner.

laser scanner

3D Laserscanner


point cloud of a chair and a mug scanned with the 3D-scanner, the chair casting a ‘shadow’ on the wall behind it


a window board scanned from slightly below with the 3D-scanner


violin on a book scanned with the 3D-scanner


Filed under Electronics