Skip to content
PekawayPekaway
Digital inputs for switches or sensors

Digital inputs for switches or sensors

What is it about?

In addition to the Zigbee wireless switches, it is of course very advantageous to integrate other switches into the system and this is relatively easy to do via the digital inputs on the relay board (pictured above). These soldering points are connected to the MCP23017 GPIO expansion chip, which sends the signals to Node-RED.

What do you need?

- Your cables (preferably shielded, can be very thin)

- A soldering iron to solder the cables onto the board

- Buttons, switches or sensors.

Can anything go wrong?

On the cable, 3.3V is switched to ground and the current is limited. So you don't need to worry. The configuration is then done in the web interface.

Use inputs, but how?

So how does it all work? There is a voltage of 3.3V on the soldering points shown above. If this is pulled or switched to ground/GND, the system registers a signal input and can react to it.

In VANPI OS from version v1.1.0 there is the button "MCP INPUT" in the web interface (Config->Switches->MCP INPUT)

The inputs can now be assigned to the corresponding relays via this configuration page by selecting the checkboxes. The Switch and Button tabs can be used to configure whether a button or a switch is connected. This means that simple links can now be created that then switch the desired relay. The timers for automatically switching off the water pump, for example, will of course continue to work if you switch the pumps on with a button or, for example, have the pumps automatically switched on using a door contact in the shower.

A look into the backend

You can access the Node-RED backend using a browser of your choice at the address <RPI-IP>:1880. You will find the MCP23017 nodes in the Flow Relay Controller. The MCP23017 is connected to address 0x20 via the I2C bus. If you now want to use the signals from the individual inputs differently, you can tap them from the marked nodes and adapt them to your application. As always, the possibilities are "limitless".

short video about it on Youtube:

https://youtu.be/3hEutQeT3uo

Leave a comment

Your email address will not be published..

more tutorials

Open Source needs support

become Patron now

More projects, more tutorials and more supported devices. Our community is growing and would appreciate your support. So become a patron now to always receive the latest content and support the VAN PI project at the same time.

Become a Patron
Cart 0

Your cart is currently empty.

Start Shopping