Skip to content
Switch branches/tags
This branch is up to date with master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

License: GPL v3


OpenEars is sensor to classify sounds using Deep Learning. It is based on a RaspberriPi and a USB microphone (UMIK). The results of the classfication is send over MQTT tot the Sensemakers IoT Platform. You can find (live) data via our Grafana Dashboard:


SERVAL image (Sound Event Recognition for Vigilance and Localisation) development:

  • Devicehive (Open Source IoT Data Platform): 2017
  • Sensing Clues: Juli 2018
  • Sensemakers and Sensing Clues: april 2019
  • Migrated to Python 3: april 2019
  • First Sensor installed: juli 2021.

Current image versie: 1.2
Initial documentation at: here


Clone the repository and go to the directory install/pi, choose your python version, and follow the instructions in the for this version. When done, return here.

After installation, the user - password should be pi - openears. Change as you see fit.
You can SSH and VNC into the PI, and you should be able to use keyboard, mouse and monitor. If necessary, configure the wifi.


The .gitignore file contains both very large files (>100 MB = too big for GitHub) as a file ( to store the credentials for the Sensemakers IoT Platform.

Configure MQTT

Go to ~/openears/serval. If there is no serval.env file in this directory, do:
cp serval.env.example serval.env

Open serval.env in an editor, and change the settings to your preferred MQTT broker.

Example of a message: {"sid":"xxxxxx", "timestamp":"1532238433096", "class":" Car passing by", "match":" 0.11"}

Configure microphone

If you use the umik, do:
cp ~/openears/install/pi/umik.asoundrc ~/.asoundrc

If you use the trust, do:
cp ~/openears/install/pi/trust.asoundrc ~/.asoundrc

If you use the aiy, do:
cp ~/openears/install/pi/aiy.asoundrc ~/.asoundrc

Check with 'arecord -l' the card number and device number of your microphone and write them down. Then edit the settings (nano /home/pi/.asoundrc) for your microphone and check if you have the right card number and device number. There must be a device with the specifications:

pcm.rate16000Hz {
type plug
slave {
	pcm trust 
	rate 16000
	channels 1
	format S16_LE

The mike can be installed on any USB port on the PI. You shoud be able to adjust it with the alsamixer.

ISSUE: after every reboot you'll need to do this step, since .asoundrc is removed from the Pi (see issue list)

Configure autostart

This has been disabled somewhere in the developmentchain, needs some work to be enabled again.

Change the model

The model is installed in ~/openears/devicehive-dev/models. You can install a new version by copying the files into this directory.

After copying you must adapt the definition in ~/openears/devicehive-dev/audio/ Adjust YOUTUBE_CHECKPOINT_FILE, CLASS_LABELS_INDICES and maybe PREDICTIONS_COUNT_LIMIT. If in doubt about the PREDICTIONS_COUNT_LIMIT, contact the supplier of the model.


If you want to upgrade your installation, goto ~/openears and execute: git pull

Note: we do our best to keep backwards compatible, but please contact us before doing this


To process prerecorded wav file

goto ~/openears/serval and run:

You should end up in ~/openears/devicehive-dev in the (serval) virtual environment, and then:

python path_to_your_file.wav

Note: file must have 16000 rate

To capture and process audio from mic

goto ~/openears/serval and run:

You should end up in ~/openears/devicehive-dev in the (serval) virtual environment, and then:


It will capture and process samples in a loop.
To get info about parameters run

python --help

Note: there is some strange bug that sometimes the first recording will produce a lot of Buffer overflows. In the following recordings everything looks normal. Must be looked into

To capture and send to MQTT

goto ~/openears/serval and run:

After a while, you will see information about MQTT messages on the screen. You can see the messages themselves in your favourite MQTT client.

If you want every wav file logged, uncomment the line with the CAPTUREPARAMS in serval.env. Please do not do it in a situation where the serval is running for a long time, because your SD Card will fill up until it dies.

Useful other info

To train classification model next resources have been used:

The model has been made Open Source by Sensing Clues and it is available here


sensor to classify sounds




No releases published


No packages published