Use Automation HAT to monitor 12V wire


I have a 12V phone entry system for my flat and I want to monitor when someone rings my buzzer.

For the first stage I have connected the buzzer wire into one of the 12-bit ADC inputs on the Automation HAT on my Raspberry Pi. Once I have finished testing I will then add a wire from the input terminal and connect it into the buzzer terminal so my buzzer is functional again.

As soon as I connect my buzzer wire to any of the three 12-bit ADC inputs the three 12-bit ADC input lights start to flash. Assuming this was normal I continued to monitor the analogue input from a python script.
(I also found it odd that when I connected a single wire to one of the analogue inputs the light turned on even when the wire wasn’t connected to anything.)

Even when the buzzer was not being pressed the values went from -2 for a few cycles then up to 30. Since documentation says that the inputs are reduced to a range of 0 to 3.3v I assume that 30 represents 3v and is therefore switching between a high and low voltage.

This made me believe I was dealing with a PWM yet when I tested the buzzer wire with a multimeter there wasn’t any sign of modulating current.

In the off chance, I had misunderstood the readings I decided to see if I could determine if there was a difference in the waves when the buzzer was pressed but no pattern emerged between the two states.

At this point I am starting to think my Automation HAT is broken or I have some misunderstandings that need cleared up.


Did you hook in a ground reference for your buzzer? If the two systems - Buzzer and Pi - are electrically isolated then it’s possible they could have wildly offset grounds, and thus the Pi has no reliable idea of what “0v” is in respect to the 12v system. It will likely then just be reading low level electrical noise on the line (coupled in from who knows where).

You’ll definitely get analogue readings from a single wire connected to an input, since environmental noise, and your own body, will induce currents in that wire. It’s effectively an antenna.

The 24v-tolerant ADC inputs should give readings from 0v to 25.85v. It’s only the 3.3v tolerant one that reads 0v-3.3v.


I don’t think my phone has a ground reference, though there does seem to be a negative connection (Terminal 6):

The rest of the connections are as follows:
[1] Audio
[2] Audio
[6,11,10] Negative
[9] Door Lock
[7] Buzzer

My multimeter did read some electrical noise from the buzzer wire but it eventually calmed down.


Connecting the negative into the ground connection got the readings to be a lot more accurate.



Sorry for the delay responding. I was not 100% sure it would work without frying anything, so I was trying to find someone else to weigh in on this thread. Glad you found it worked in the interim!