Posted on Leave a comment

Raspberry Pi – NodeRED Button

This simple experiment will demonstrate using a push button to light a LED.

Adding a Push-Button to an LED in Raspberry Pi doesn’t get much easier than with NodeRED, two nodes, and you are done.

The Fritzing Diagram is availble for download

Wire the LED and Button as shown in the Diagram

  • Pin 1 – Left side of button
  • Pin 11 – Right side of button
  • Pin 6 – Led Cathode ( Short Wire / Flat Side )
  • Pin 7 – Led Anode ( Long Wire )

If you simply want to try this Flow, you can import this:

[{"id":"60410dd4.757164","type":"rpi-gpio out","z":"308cfa1.ad68d06","name":"","pin":"7","set":true,"level":"0","freq":"","out":"out","x":253.4615135192871,"y":348.46156311035156,"wires":[]}]

To run this experiment we will use only two nodes rpi-gpio In and rpi-gpio out. Drag one of each onto the Flow edit pane.

When you drop the Nodes the Labeling is updated to reflect the configuration. The two Nodes before wiring will look like this. There has been nothing done to them other than dropping them onto the flow.

Wire the Nodes together

Configure the Input Node

  1. Double Click the rpi-gio In ( it is marked PIN:tri ).
  2. Set the Pin to 11
  3. set the resistor to pull-down
  4. Click Done

The node Should change to PIN 11

Configure the Output Node

  1. Double Click the rpi-gio out ( it is marked PIN: ).
  2. Set the Pin to 7
  3. Check “Initial pin state?”
  4. Select “initial level of pin -low(0)
  5. Click Done

The Output Node should now be labelled PIN: 7

Deploy the Flow

If you have done everything correctly you should now be able to press the button and the LED will light.

Leave a Reply

Your email address will not be published. Required fields are marked *