How to recognize doorbell sound

I would like to connect my doorbell (see picture) to the internet.

... but I would like to do that in a bit special way.

The idea:

In my living room I am having a AIY Voice Kit (= raspberry pi with micro and speaker) that is also running Node-RED. I would like to extend this raspberry with a kind of "recognize my doorbell" service. So this service is constantly listening to any sound (using microphone) and once it recognizes the typical sound of my doorbell it publishes a message to my MQTT broker.

Extra requirements:

  • limited CPU power (let us says that it should be able to run on max 50% of the available CPU capacity of a raspberry pi 3)
  • responsive : the mqtt message should be posted within 2 secs after the person has rung
  • also works when there is ambient sound (television, radio, people, dishwasher).
  • also works when door to the living room is open / closed.
  • also works when the bell rings very shortly.
  • all bell rings must be detected
  • the number of false positives should of course be limited

So what is the best way of doing this ? I have no idea how I can best tackle this problem.
And of course I am especially interested in any ideas linked to Node-RED.

1 Like

You could put an accelerometer near the bell to detect vibration. Connect this to an ESP8266 board with an MQTT client and you are set to go!

2 Likes

or a magnetic switch on an esp in deep sleep mode to save battery power, and put the magnet on the clapper.

6 Likes

If you can run a wire, you could simply link direct to the bell ringer. It looks like an old electric bell so you could easily detect voltage or current when the bell-push is triggered.

If you can't run a wire then, as Dave mentions, an ESP would work but then you have to provide power to that. Possibly, you could rig up a simple 433Mhz repeater and put a 433MHz receiver on the Pi. That wouldn't have to be powered until the bellpush was triggered and quite possibly the bell ringer would have sufficient capacity to run the sender. An Arduino nano or similar could provide the processing. 433MHz has the advantage that it doesn't need the processor to be alive for a long time to make contact with Wi-Fi, it can simply wake up and send immediately. As you only need the simplest of data - just 1 bit would be enough - the processing should be trivial.

1 Like

An esp in deep sleep - woken by interrupts only should last for ages (months) on a tiny battery. (or indeed you could probably parasite power from the bell itself.)
eg https://www.youtube.com/watch?v=nbMfb0dIvYc

2 Likes

Just pointing out that some times the "old ways" may be the best :smile:

I think that you could probably hack an old, cheap 433MHz bell or door opener to send a coherent signal without a processor at all. I say you could because I doubt my electronics skills are up to the task :upside_down_face:

3 Likes

true dat.

@TotallyInformation can!

I think you're all missing that @janvda doesn't want to connect anything to it :slight_smile:

3 Likes

Ah, a quantum tunnel!

5 Likes

If you really don’t want to connect anything you could probably take a wake word listener like precise and train the recurring neural network it uses to trigger on the bell sounds. The rnn doesn’t care what it gets trained to listen for.
Once you trained a model you could use the voice2json nodes as voice2json uses precise as the wake word engine.
Training a good model is the actual hard part. You will need more than a hundred (or more) distinct samples of your doorbell ringing with and without background noises, door open and closed, different ringing length and than also a lot of random audio that includes everything but the bell. Especially the random audio that is not the sound you train on is very important.
Not sure how good the success rate would be as training wake word models and trimming data sets for them to get the best results is kind of like a witchcraft and involves a lot of trial and error but it should be possible. The bigger the training data set the better.
But that sure is one complicated option :wink:

2 Likes

@cymplecy, I am sure he said in the first line he wanted to connect the internet to it, or vice versa. LOL

Edit/
looking at the doorbell sounder, it looks like it would work with a 12v dc transformer. Also if wired correctly(+/- to sounder and button to sounder) Then a simple Shelly 1 connect to MQTT, should work.

2 Likes

Thanks, original idea.
Not sure if I put an accelerometer near the bell that it would be sensitive enough.
Of course this solution also needs power (or batery power).

another original idea :-).
Seeing how the bell rings, I am not sure if a magnet sticked to the clapper will last long.
It will also require precise positioning to assure that reed switch swiches.

... but maybe I don't need an extra magnet as the clapper itself is triggered by a magnetic field.

... that was an option I was initially thinking of. To measure the current in the low voltage circuit.
But this also requires a powered ESP device.

... very polite people seem to press very shortly on the bell. Not sure if this would last long enough to wakeup a deep sleep device and get it send a message. I understand that 433 MHz would require less energy than Wifi. But 433 MHz would add another component to the solution (ESP comes with wifi out of the box).

Note also that the low voltage circuit is AC (around 8V) and that when the bell is ringing that this circuits is interrupted with high frequency. So it is not that easy to use that power and also not clear that it would provide sufficient power during that short period.

... I also like the youtube video about the smart switch hardly requiring any power. But this would mean that I need to hack my doorbell button so the doorbell button is switching both my existing bell as well as this smart switch.

That is very true. I am indeed looking for a pure software solution.
... but all hardware alternatives posted here are also well appreciated.

:slight_smile: I think you look too far. I was thinking about the sound waves my doorbell makes.

... very very interesting. I will give precise a more precise look.

... I am just wondering if any training could be limited as my doorbell is making a very specific ring sound. I would somehow expect that it is possible to define a "specific filter" for that sound based on the recording of a single ring where there are no background noises.

No, it is an AC transformer (I think to 8V) in my case. So I guess this means that using Shelly 1 connect is not an option for me.

You can change the transformer to dc or use a bridge rectifier, as i do believe that type of sounder works ac or dc. also the sounder will work with 12v, just may be a bit louder.

1 Like

You could, I think, feed a large capacitor to provide enough power, especially if you ditched the microprocessor and hacked an existing low-cost 433MHz bell unit, it only needs a second of power if that. Most likely only a fraction of a second. Not like using WiFi. 433Mhz units last for years on a single button battery.

2 Likes

If you fancy something a bit different then you could take a look at this: https://docs.edgeimpulse.com/docs/audio-classification

These guys have made machine learning as simple as it can get and have a video demonstrating listening for a running tap/faucet. It requires training which means recording about 10 minutes of sound.

I have got myself a Nano 33 BLE Sense and am having great fun teaching it the difference between fridge alarm, washing machine finish, dishwasher finish,kitchen timer.

Other hardware is also supported.

4 Likes

Very interesting link to edge impulse (allthough I must say if your faucet makes as much noise as in the video I think it is better to start calling a plumber :slight_smile: ).

I am wondering to what extent it can be run in a docker container on my intel nuc device or on a raspberry pi.

2 Likes

No explicit mention of Pis but have a poke around the documentation (which is pretty good). There is a page on running it in Node+Webassembly: https://docs.edgeimpulse.com/docs/through-webassembly

And they do offer to help with porting: https://docs.edgeimpulse.com/docs/porting-guide

1 Like

I have recorded a 1 minute period during which I have rung the bell 9 times.

The spectogram (produced by audacity) clearly shows the 9 times the bell rang:

Here below I have zoomed into a single bell ring

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.