I am trying to connect my raspberry pi to my hardwired doorbell in order to send a text message when the doorbell button is pushed. I have successfully sent the text message using a button connected to the breadboard but I am unable to do so when connecting the breadboard with resistors and raspberry pi to the cables wired to the doorbell itself. I believe this is due to the circuit and not the software.

My thinking was that since the doorbell has its own button, I should be able to replace the button on the breadboard with the doorbell button itself. The difference however, is that the doorbell button emits its own voltage.

I am currently using this example (minus the LED): circuit

How should I be wiring my doorbell to the rpi, which emits a voltage of approximately 3V when the doorbell button is pushed after the current has passed through the resistors?

If interested, here is my code:

var Gpio = require('onoff').Gpio,
button = new Gpio(4, 'in');

button.watch(function (err, value) {
  if (err) {
    throw err;

//Twilio credentials required to send text message omitted

process.on('SIGINT', function () {

I am using onoff and writing this in JavaScript.

  • Can you determine if the doorbell uses AC or DC? – linhartr22 Oct 10 '17 at 18:33
  • the doorbell uses AC – Matt Oct 10 '17 at 20:15
  • Is this still an open question? – Ingo May 14 '20 at 11:48

If it were me, I'd be looking to connect the door bell power to a relay then replace your pushbutton using the relay contacts. Much safer and isolates your rpi from any nastiness on the doorbell power. You'll need to know the doorbell's voltage and if it is AC or DC to get the correct relay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.