Category Archives: Sound

Hydrophones

With the EEGsynth we are not only working with EEG data but occasionally also with data from trees, from microbes and from cod fish. For the cod fish project we collaborated with Rebekah Oomen and John Andrew Wilhite-Hannisdal on the sounds that cod make during the mating season, using recordings of the “grunting” and “drumming” that were made in previous years at Flødevigen Research Station.

For the Science Festival in Gothenburg we are considering to take it one step further and integrate live video and possibly also sounds from the cod fish that are swimming in the large basin in the Sjöfartsmuseet Akvariet. Recording the sounds to use them live requires hydrophones, i.e., underwater microphones. Commercial hydrophones that are commonly used for marine research purposes are rather expensive, but luckily it is not too difficult to make a hydrophone yourself from a piezo element. I largely followed the process described by Felix Blume. Below I will detail some specific considerations, design steps, and modifications that I made to the original.

I ordered a bunch of 27 mm diameter piezo elements from Amazon. Since I did not have nicely fitting bottle caps, I designed a small round housing that exactly fits the piezo elements. I used my Prusa to 3D-print the housing in PLA, a bioplastic made from corn starch. Copper tape on the inside helps to prevent pick-up from electromagnetic interference. I found out experimentally that the copper tape needs to have a good connection to the copper of the piezo element so that they together form a Faraday cage, otherwise there was still a lot of 50Hz hum.

I ordered two instrument cables of 9 meter each (one red, one blue) and cut them into a 3 meter and a 6 meter section. The stripped cables were then soldered to the Piezo elements.

To ensure that the hydrophones will properly sink, I placed two nuts in the housing and completely filled it with silicone gel. As the hydrophones are to be used in an aquarium, I bought special Seachem silicone sealant in the local tropical aquarium fish store.

I had planned to use a coat of Plasti Dip Multi-Purpose Rubber Coating according to the instruction, but a review of the safety sheet revealed that Plastidip is made from petrol derivates and contains substances that pose a safety hazard to water and marine life. I don’t know whether that is in the solvents which evaporate during the drying process, or also with the remaining solid coating itself. Given the intended use in an aquarium with a closed water recycling system, I don’t want to take a risk and decided to keep the hydrophones bare with the PLA bioplastic and the copper of the piezo element exposed.

With the four hydrophones we will be able to do a four-channel recording of the sound that we record inside the fish tank and play it back spatially on a quadrophonic speaker array.

12 Volt trigger for audio amplifier – PCB version

Previously I wrote how I designed and implemented a 12 Volt trigger for an NAD audio amplifier. Some time ago I also designed a PCB version of it. Here you can find some photos and the Eagle schematic.

There is one error in the design: the GND pin of the Wemos D1 mini board is not connected to the ground plane. I solved it with an air wire.

Some of the differences to the previous version are that it now has a button, a 12V input trigger, and a status LED. The button allows to manually switch it on and off without having to use my mobile phone. The 12 V input trigger allows the amplifier to be switched on by and off by the Sonos Port that is also connected to the amplifier.

I am using Tasmota as the firmware which – besides the button to switch it on and off – allows control over a web interface and over MQTT. The Tasmota template for the configuration is the following: {"NAME":"12V trigger", "GPIO":[1,1, 1,1,32,288,0,1,256,1,160,1,1,1], "FLAG":0, "BASE":18}.

The MQTT interface makes it easy to implement some automation with Node-RED that I have running on a Raspberry Pi. The automation is the following: whenever the smart TV or the MacMini (used for music) are switched on, as detected by them returning a network ping on their IP address, then the amplifier switches on, and vice versa.

I also have it configured using Homebridge in my Apple Home environment, which allows the Home application on my iPhone or iPad to manually control it, besides the Tasmota web interface.

Combining all of these, the NAD amplifier is switched on and off by either

  • the manual button
  • the smart TV (detected by an IP ping)
  • the MacMini (detected by an IP ping)
  • the Sonos Port (detected by its 12V output trigger)
  • the Apple Home application on my iPhone/iPad
  • the Tasmota web interface

However, the automation is not perfect: when after an afternoon of listening to Sonos we switch on the TV and switch off the Sonos Port, the Sonos Port only falls asleep after a minute or so. Consequently, the last action happens to be the Sonos Port 12V output going low; the amplifier therefore switches off after a minute or so, whereas we just switched the TV on. A quick press on the manual button switches it on again. Also, whenever we switch between MacMini, TV, or Sonos, we still have to walk to the amplifier to toggle it to the right audio input. An idea for the future is to mount an IR blaster that switches between the audio inputs automatically.

Mixing multiple microphones for hybrid meetings

Behringer MX400 as summing mixer

During the last 1.5 year I have been working mostly from home, as all of my direct colleagues. Initially it took us some time getting used to doing our group meetings online, but by now we know how to make those pleasant, inclusive and efficient. Now that many people are vaccinated, we expect/hope that we’ll soon be able to get back to the university for work. However, there are a few aspects of online meetings that I value and hope to can maintain. The travel time is much less, making it easier to quickly join a meeting that otherwise would be held on the other side of campus. It is rather trivial to have people join from abroad, e.g. previous colleagues that want to keep their connection and contribute to the Donders knowledge and culture. Everyone can share their screen much easier. The chat is used to post background material, links to relevant papers, etc. Consequently, I expect that we will not all of a sudden switch back to in real-life meetings, but rather we will have a (possibly infinite) period in which some people attend in real-life, and others online.

In our MEG meeting and the hackathon we have experimented with different aspects of hybrid meetings and documented our findings. We quickly learned that to ensure lively discussions, real-life and online attendees should be able to hear each very well. Spontaneously talk between live participants is easy, but the online participants should be able to hear everything without extra strain and be able to chime in.

Continue reading

Wireless classroom conference microphone system – #5

This post is part of a series on designing a wireless microphone system for hybrid online meetings, i.e. with some people present in person and others present online. See also the previous post in this series.

So far I have built and experimented with 4 wifi microphones, including an on/off switch and a rechargeable LiPo battery. I also added a magnetic name tag holder like this to the back of each of the microphones, allowing them to be mounted on a shirt or the the lapel of a jacket. The most relevant parts comprise an INMP441 microphone connected to a Lolin32 lite board. I have a few more wired up with just the Lolin32 board and the microphone to allow testing a larger number.

I have also implemented a Python based server that is running on a Raspberry Pi zero W, which also functions as Wifi access point. The audio server buffers and mixes the incoming signal from the different microphones and plays it on a HifiBerry DAC+ zero audio card. The output is a line level voltage, strong enough to drive a headphone, and with some attenuation also suitable to feed into the microphone input of a low-cost USB headset adapter. The whole system works as expected, although the noise level of the microphones is higher than I had hoped. My guess is that it is in part due to the microphone being so close to the ESP8266 antenna. Also, the wires between the microcontroller and the microphone run over the Lolin32 board without any shielding, probably picking up EM interference.

The Arduino source code, the Python audio server code, and the Fusion360 CAD design files are available from the wifimic repository on Github.

The fact that it works with an USB headset adapter like this, i.e. a miniature external sound card, demonstrates that the device can also be connected to the standard Windows laptop “pink” microphone input.

My MacBook has a TRRS combined audio input/output and the TRS (stereo) cable that comes from the HifiBerry DAC audio card is not recognized as microphone when I plug it in, but over the USB headset adapter it works fine. There are Y-adapters to split the TRRS input into TRS for the headphone and a TS for the microphone that would allow connecting it. However, the Python audio server also works fine on macOS, which has the advantage that I can investigate the microphone audio signals in full quality. Rather than first converting the sound to a analog line-out on the Raspberry Pi, and then back into a digital representation by the USB headset adapter, I can use BlackHole or Soundflower to get the digital audio stream as it is generated by the microphone. A cool feature of BlackHole and Soundflower is that they support many channels. With some modifications to the Python server script, it will also be possible to stream the audio output of each microphone to each own channel, and record them with Audacity.

Wireless classroom conference microphone system – #4

This post is part of a series on designing a wireless microphone system for hybrid online meetings, i.e. with some people present in person and others present online. See also the previous and next post in this series.

I want to design a wireless clip-on “Lapel” microphone based on the LOLIN32 lite board and the INMP441 I2S microphone module (not to be confused with the INMP 411, which has analog output). Given the size of the board (about 25 by 50 mm), an 802040 or possibly an 802540 Lithium Polymer battery would be a nice match. These LiPo cells are 8 mm thick, 20 (or 25) mm wide, and 40 mm long. In a few iterations, I designed a simple enclosure in Fusion360 and 3D printed them.

ESP32 wifi microphone enclosure

ESP32 wifi microphone enclosure

The box has a port in the top for the microphone; on the inside are two rails to keep the ESP32 board in place. The microphone is mounted in a small holder that clips perpendicular onto the antenna-side of the ESP32 board. The micro-USB connector is exposed at the bottom, this allows charging the LiPo battery. I expect that this design will also allow making a docking station for charging multiple microphones at once, for example, using these male micro-USB connectors. The first versions (red and blue) did not have an on-off switch; I added these in the later versions of the design (green, yellow).

The ESP32 wifi microphone enclosure is about 57x28x18 mm in size. For mounting the microphone on a lapel or in the neck of a shirt, I considered 3D printing a clip. However, I know from experience that 3D printing a clip with exactly the right flexibility is not so simple, since that depends on the properties of the filament. The clip would also make the 3D printing and assembly more complex. I think that a magnetic name badge holder will be a good alternative to a clip for mounting the microphone to your clothing; it has the advantage that the microphone can be positioned more flexible, especially for informal clothing such as t-shirts. Using double-sided adhesive tape the magnetic name badge holder can be attached to the recesses at the back of the 3D printed microphone enclosure.

magnetic name badge holder

magnetic name badge holder

Wireless classroom conference microphone system – #3

This post is part of a series on designing a wireless microphone system for hybrid online meetings, i.e. with some people present in person and others present online. See also the previous and next post in this series.

I evaluated various small ESP32 and ESP8266 development boards for use in a clip-on microphone. The requirements are that it should be cheap, it should be small, and it should include a charger circuit for a LiPo battery. The most suitable candidates are the WEMOS D1 mini pro and the WEMOS LOLIN32 lite.

LOLIN32 lite versus D1 mini pro

The first is based on an ESP8266 and the advantage is that it is officially available from the WEMOS store. The second is based on the ESP32, has the advantage of a faster MCU, includes Bluetooth (although I don’t have plans for that at the moment) and is even cheaper (about €2.50, whereas the Wemos D1 pro is about €5.00). The disadvantage of the LOLIN32 lite however is that according to the ESP32 page on Wikipedia it is retired and hence not available through an official WEMOS channel. There are many clones of the LOLIN32 lite board available on AliExpress as LOLIN32 lite or as LOLIN32, however, the quality of these clones may vary.

I removed the battery connector from the WEMOS board (that is on the right in the photo) to reduce the height. Furthermore, using a Dremel tool I made a small indentation in the board: this allows passing the wires from the battery cables. Both boards feature a JST-PH-2.0 battery connector that points along the axis of the board in the same direction as the micro-USB. This arrangement of the connectors makes it impossible to plug in a battery, while at the same time having the micro-USB connector flush to the side of an enclosure. To keep the assembly as simple as possible, I want external access to the USB connector for charging, so instead of using the battery connector, I will solder the wires from the battery straight onto the board. The JST-PH-2.0 connector comes off easily with a pair of pliers and a little force.

Continue reading

Wireless classroom conference microphone system – #2

This post is part of a series on designing a wireless microphone system for hybrid online meetings, i.e. with some people present in person and others present online. See also the previous and next post in this series.

Pondering about wireless microphones for a classroom or for a larger scale conference/meeting room, I identified some requirements:

  • it has scale to a classroom with 20 or 30 attendees
  • it has to be cheap per microphone, rather in the range of €10 than €100
  • it has to be simple to use, as there is no sound technician to control a mixing console
  • it has to integrate with online meeting software as if it were a regular micophone
  • it has to be portable, so that I can take it to any class or meeting room
  • it has to be DIY and easy to build with already available components

Imagine that you would have a number of rechargeable clip-on microphones that all transmit their audio wirelessly to a single base station. The base station could also act as a charging station, i.e. when not in use the microphones would be docked in it. The base station would be connected to the central laptop/computer as if it is a single external microphone. Bluetooth lapel microphones exist, but Bluetooth does not allow connecting a lot of microphones to the same computer. Proprietary radio systems such as used by audio companies like Sennheiser are not DIY friendly. There are easy to use RF modules, but those are more suited for IoT applications and not streaming audio. This actually sounds like an ideal application for a 5G device-to-device network, but components for those are not easily available yet.

Continue reading

Wireless classroom conference microphone system – #1

This post is part of a series on designing a wireless microphone system for hybrid online meetings, i.e. with some people present in person and others present online. See also the next post in this series.

Update 22 November 2020 – I split the original post into two pieces to make it easier to follow up and added some information about commercial solutions.

I was chatting with my daughter about the challenges of doing hybrid Zoom or Teams meetings. She was not allowed to go to school for a few days and had to follow lessons online, with the teacher and most students in the class. And I was still stuck in my attic, organizing my own university teaching and meetings remotely. Recently I went to work a few times for meetings, but only a few people came to work in person, and most attended online through Zoom. This is similar to the current school situation for my daughter, where most kids attend in person but some attend online on Teams. I expect that we will have these hybrid online/in-person meetings for quite some time to come; perhaps they might even become the new “normal”.

The challenge with hybrid in-person and online meetings is mainly in the physical room where multiple people are attending in person. The online attendees simply connect to the online meeting the same way as if it were a 100% online meeting. The people present in real life also have their laptops in front of them with the webcam on, but with the speakers and microphone muted. This allows online attendees to see everyone, also those people in the physical room. Only one person in the physical room unmutes the speakers and microphone. This allows the noise- and feedback-suppression of the video conferencing system to do its work and not to amplify the voice of the local attendees through the speakers. If you would have multiple laptops with the speakers and microphones on, you will hear echo’s, and the sound will start feeding back, creating lots of noise.

Continue reading

Using the Bela to measure the frequency response

Bela is a maker platform for creating beautiful interactions. It consists of a Beaglebone black, with a shield or hat that has 2 audio inputs, 2 audio outputs, 8 analog inputs, and 8 analog outputs. It is complemented with a very slick web interface that allows you to write and very easily compile and run your code. And very cool is that the web interface features an oscilloscope.

I am planning to build a purely analog EEC/EMG/ECG amplifier, similar to this design on Instructables. As that involves making choices on the filter settings: a low-pass filter to remove electrode drift, a notch filter for line noise, high-pass anti-aliasing filter matched to audible frequencies. Hence I started thinking on how to determine the combined effect of all those filters, together with the multiple amplifier stages. It occurred to me that the Bela can act both as a signal generator and as a digital recorder and oscilloscope.

Bela and breadboard with fiter

On this GitHub page I am sharing a Bela project that outputs a sine wave on the analog output, which can be fed through an external circuit, and subsequently measured using the analog inputs. The project computes a real-time discrete Fourier transform of the output signal and compares the amplitude and phase to the input signal. Using a LaunchControl XL MIDI controller (or alternatively using a small EEGsynth path for an on-screen MIDI controller), I can select the frequency, and start/stop a sweep over the whole frequency range. The amplitude and phase response at each frequency is logged to disk.

Continue reading

12 Volt trigger for NAD-D3020 amplifier

Update 3 January 2021 – mention that I am now using Tasmota firmware.

Update 26 February 2023 – I have followed this up with a PCB version that also includes a button and a 12 Volt input trigger for switching the 12 Volt output trigger.

The NAD D3020 is a hybrid digital audio amplifier with a combination of analog and digital inputs. I have been using it for quite some years now to play the sound of my Samsung smart TV over the living room speakers and for digital radio, iTunes and Spotify from my Mac mini. The Samsung is connected with an optical Toslink cable, the Mac mini is connected with a USB cable.

In the way the D3020 is placed in our media cabinet, its on/off button is not so easy to access. The D3020 remote control is really crappy and I find it anyway annoying to have to use multiple remotes to switch the power of all devices. Also, the status LEDs of the D3020 are dim and got considerably worse over time, especially for the OPT1 and the USB inputs that are for the TV and the Mac mini, and hence on most of the time. I guess that it uses OLEDs, which have degraded over time. Consequently, it happened quite often that we forgot to switch the amplifier off for the night.

However, the D3020 features a 12V trigger input port which allows the amplifier to be switched automatically on/off along with other gear. Of course, neither TV nor the Mac mini has a 12V output port, but both are connected to my home network; hence it is possible to detect over the network whether these are powered on.

Continue reading