I’m really new to Raspberry Pi, so please forgive me if this is a noobish question.
I have a very simple setup: Raspberry Pi 3 running Home Assistant with a switch connected to GPIO12 and 3.3v. The pin is configured to be pulled up.
Inside HA I have this config:
binary_sensor: - platform: rpi_gpio pull_mode: DOWN ports: 12: Motion
but this doesn’t matter. When I press the button (or connect GPIO12 to 3.3V directly) HA and PI are detecting that I turn on the switch.
Now I’ve replaced the switch with a 12V OMRON mechanical Relay.
Relay is turn on or off by external power source and it works fine (I can hear it clicks)
I’ve connected 3.3V and GPIO12 to relay with help of an electrician.
The problem is that even I hear relay works the Pi isn’t detecting anything.
If I connect wires directly (without the relay) it works, when using the relay it doesn’t.
The best part is that the electrician took a screwdriver and shorted the relay legs (the ones that have connected 3.3V and GPIO 12) and Pi detected the switch is turned on.
It looks like the relay is “not sending” the full 3.3V and because of that Pi isn’t detecting anything.
The relay is only used to connect 3.3V to GPIO12, it isn’t controlled or powered by Raspberry Pi.
I’ve searched a bit over the internet about relay coil resistance, but this got me even more confused.
My question is: how can I make input relay work with Raspberry Pi 3. Any materials and hints are more than welcome.
Here is the Schematics of what works:
and this is what doesn’t
Sorry for a very basic schema, but I hope that now You get my point. I want to replace the momentary switch from picture one with a 12V relay. I’ve connected 3.3V from Pi to NO port of relay and GPIO12 to COM. I want the relay to control Pi I hope this is now clear.
How to read GPIO 12 using HA?
I don’t know HA. I think I can first write a python program and let the OP to translate it to HA. This way we can learn together! 🙂
Appendix A – Home Assistant Getting Started
The documentation covers beginner to advanced topics around the installation, setup, configuration, and usage of Home Assistant.