Audio file identification question - Page 1
Forum section: electronics / beginners

author: jerryk
author_rank: Regular Contributor
timestamp: April 29, 2021, 06:27:11 pm
content: I have a motion PIR detector system that consists of 4 wireless PIR sensors and a base receiver. The system uses a selectable audio ring tone along with zone led indicators as it's identification scheme.I am trying to somehow attach a unique identifier to each ringtone via a raspberry pi and an MCP3008. I only have one input open on the MCP3008.Ideally I would like to put an audio out jack on the base receiver and run a signal to the MCP3008 then via python code sample the signal and give it some unique identifier such as "Back door", "Front door", "Gate" etc.The output to the speaker is around -3.6V to 3.6 (on average for each ring tone) powered by an SSM2211.Is this a possibility with this hardware arrangement? If not, are any better ways to go about accomplishing this task?Any hints or general direction is greatly appreciated.Jerry

author: Renate
author_rank: Super Contributor
timestamp: April 29, 2021, 06:49:05 pm
content: Huh? Your base station knows which sensor it is but only outputs unique audio?And you're trying to reverse engineer the audio to figure out which one it is?Wouldn't it be better to either dive into the master receiver and get the sensor ID directlyor else bypass the master receiver and receive it yourself?Does this system use XYZ MHz or Bluetooth or WiFi?

author: ledtester
author_rank: Super Contributor
timestamp: April 29, 2021, 07:21:56 pm
content: Search for "audio fingerprinting", i.e.:https://willdrevo.com/fingerprinting-and-audio-recognition-with-python/

author: Renate
author_rank: Super Contributor
timestamp: April 29, 2021, 07:33:39 pm
content: Connect to the LEDs, ignore the audio.

author: jerryk
author_rank: Regular Contributor
timestamp: April 29, 2021, 08:13:21 pm
content: The system I'm using is Guardline GL5000 and it uses the SI4432 receiver. I considered trying to look at the sensor id's but this is an area that I'm not that familiar with and was looking toward a simple solution if available. It's looking like establishing a unique id from audio inputs to the MPC3008 is not that simple.I have attached a picture of the circuit board and the receiver layout. I'm not sure where or how to tap into the receiver input or how I would go about receiving the data myself.I do have a couple RF69 modules that I used for remote temperature sensors. I have used them with the sparkfun redboard. It's been a while so I would have some relearning to do. Also coding in C is something I struggle with but I have done a small bit. I'll look into using the SI4432 with the pi and see if that's a direction that would fit my end goal.The pi is the foundation of my security system so I would like to use it since it is set up to send text alerts to my phone.I have already used the led's on two other systems to identify specific sensor units via an r2r ladder network. With the Guardline I can expand out to 16 sensors, 4 per zone. The led's indicate the zone and not the specific sensor. This is the reason to look beyond the led scheme for identification.Jerry

author: Renate
author_rank: Super Contributor
timestamp: April 29, 2021, 11:25:25 pm
content: I'd much rather eavesdrop and decode the SPI coming out of the SI4432 than do something clever like identifying audio.What is generating these tunes?The website says 30 melodies.What is the tone generator chip?It might have 5 control lines or serial or SPI or whatever.It would be easier to tie in there.

author: jerryk
author_rank: Regular Contributor
timestamp: April 30, 2021, 01:44:40 am
content: My guess is the tone source is on the board that is soldered in to the left of the microcontroller in the photo above.You can see the connections but the tone source board is on the back side and the chip that powers it is potted. I probed the pins at this connection and can find the individual audio signal output here too. There are some other square wave output on a couple of pins that vary with the ring tone selected but I'm not sure I can say that they have a unique pattern yet.As far as eavesdropping on the SI4432 goes, I assume I cannot do this with the RF69 modules that I have. I know they support 433mhz but not sure if I need to get an SI4432 to accomplish this. I also probed the test points around the SI4322. When I activate a specific sensor I get some square wave pulse that seems to coincide with the sensors transmission to the base. If this is the avenue to solve this goal, I have a fair bit of study ahead of me.Thanks - Jerry

author: Renate
author_rank: Super Contributor
timestamp: April 30, 2021, 11:03:38 am
content: The SI4432 is a complicated chip, I didn't mean for you to use another one.I just meant connecting onto the 4 wire SPI interface and monitoring all the reads from the RX FIFO.In any case, you mentioned a chip-on-board tune generator.Those things are very simple.It doesn't matter that it's glopped on.Are there a bunch of traces going to it? (parallel interface).Or only 3 or 4? (SPI? I²C?)

author: jerryk
author_rank: Regular Contributor
timestamp: April 30, 2021, 05:15:53 pm
content: There are 9 connections to the tune generating board per the attached photo. The microcontroller U5 is an STM8S005. The lead soldered in on the right is what I attached for the oscilloscope probe.Jerry

author: Renate
author_rank: Super Contributor
timestamp: April 30, 2021, 10:00:23 pm
content: Do you have the audio output there?What's more interesting is the 5? traces from the µC to the sound chip. (5, if the two vias connect).Look at those and see if there is data like stuff on any of them or more like a single pulse.

author: jerryk
author_rank: Regular Contributor
timestamp: May 01, 2021, 01:49:08 am
content: I do have audio on pin 1 and signal on pin 4, 5, and 7. The photos are named accordingly.But the bad news is that I can't see any signal change with different sensors or ring tones unless there is something buried in the details that I'm not seeing. I'm setting the trigger to single and this is what I get at each motion activation of the individual sensor.Jerry

author: Renate
author_rank: Super Contributor
timestamp: May 01, 2021, 11:01:48 am
content: This looks like SPI.Pin 4 is clock.Pin 5 is data.Pin 7 is enable.Look closely at pin 5 for different sensors.It should be subtlely different.An Arduino (or whatever) should be able to make short work out of this.

author: jerryk
author_rank: Regular Contributor
timestamp: May 01, 2021, 03:54:51 pm
content: Thanks to you I found it!!I was wrong, in that there was signal present on pin 2. When I advance through the tunes the signal on pin 2 changes to a unique value. These values increment their value by 1 as I advance through them.I have attached a screen shot of two different sensors. The first is playing tune 1 and the second is playing tune 19.Now that we have another data pin is this still spi.If so, can a raspberry pi decode this with spidev. I do have an arduino available two but am less familiar with it. The end result will have to go to my security system panel which is controlled by a raspberry pi 3b. It already has an MCP3008 using spi but as I understand it I should be able to support two spi devices.The next hurdle is getting the result from the PIR receiver to the raspberry pi which is located in a different room and would involve around 20' of cable or so.Any further thoughts on the best direction to head(pi or arduino) and how to transmit the result over that distance? I'll keep reading up on the subject and do my best not to bother with too many questions.What a great help you have been. Thanks for sticking with me here.Jerry

author: Renate
author_rank: Super Contributor
timestamp: May 01, 2021, 06:05:03 pm
content: Well maybe pin 5 is SPI data out from the tone chip indicating busy/playing/whatever.If you don't want to run cables and you have WiFi a RPi Zero W could take the SPI and send something to the master RPi 3B.For wired you could use an Arduino to take SPI in and send a little data out the UART.You'd probably want to put logic/RS232 or logic/RS485 converters on both ends.