Basic polling a push button questio

Sorry about this! It’s been so long since I messed about with electronics I’ve forgotten how to deal with this situation.

Basically I’d like to monitor the status of a doorbell push button. The kind of thing that wireless sends a signal to a paired speaker. I’d like to make a Particle Core aware when the doorbell button gets pressed. I realise I’m going to have to solder on some wires to the pads on the doorbell but is it OK just to then hookup the button to the Core? Given that it’s also connected to another separate circuit? Won’t there be grounding issues and voltage issues to bear in mind? Or not? I can’t remember!

Sorry…

If your button is close enough to your Core and hasn’t got anything else attached, you’d just connect GND to one side of the switch attach the other to your sensing pin.
With pinMode(sensePin, INPUT_PULLUP) (or an external pull-up resistor in conjunction with INPUT) in order to enable reading the state of the pin.

With longer wires between Core and switch you might have to account for signal noise due to inductive pickup of the wires acting as antenna.

But if you already got some other things connected (e.g. doorbell trasnformer, any voltage source, …) things will get considerably trickier.

I would be tempted to at least put a opto-isolator between the photon and the doorbell button, unless the button is particularly noisy then polling it every 100-200 millis should be slow enough to be safe from an bounce and fast enough it will catch a fast doorbell jabber.

If I did that, would that mean their ground wouldn't need to be tied together?

That’s the plan.

Sorry to be going back and forth. If I was happy to tie the grounds together would an optoisolator still be a good idea?

I’m just trying to understand the logic rather than blindly follow :slight_smile: