Sending data to 1602 LCD with node-red

Introduction

node-red is a great platform to visually code up applications for the Internet of Things. The PiShield not only allows you to get sensor data into node-red, but you can also control output devices. This short example shows you how to talk to a 1602 LCD display connected to the digital pins of the PiShield!

Hardware Setup

First, connect the LCD to the digital pins of the PiShield.

Software Configuration

If using our preconfigured PiShield Raspberry Pi image, the addon is preconfigured with the node-red distribution. If not, you can install it manually from the repo here.

Once configured, you should see the node appear under the “output” section:

node-red-toolbar

Next, import the following flow by copy and pasting:

[{"id":"c706851e.e23518","type":"i2clcd","z":"39bc22f3.6c1f7e","name":"1602 LCD","addr":"0x3f","x":435.5,"y":98,"wires":[[]]},{"id":"4e90177d.4789a8","type":"inject","z":"39bc22f3.6c1f7e","name":"","topic":"line1","payload":"Hello node-red!","payloadType":"str","repeat":"","crontab":"","once":false,"x":235.5,"y":67,"wires":[["c706851e.e23518"]]},{"id":"2106a7cb.8ab688","type":"inject","z":"39bc22f3.6c1f7e","name":"","topic":"line2","payload":"from RPi","payloadType":"str","repeat":"","crontab":"","once":false,"x":216,"y":130,"wires":[["c706851e.e23518"]]},{"id":"badc56e5.939b68","type":"inject","z":"39bc22f3.6c1f7e","name":"","topic":"init","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":198,"y":190,"wires":[["c706851e.e23518"]]}]

When imported, this is what it will look like:

Screen Shot 2016-07-14 at 2.26.33 PM

If all goes well, you should see the following when injecting the messages:

node-lcd

1 thought on “Sending data to 1602 LCD with node-red

  1. Pingback: MIDI in node-red – Infusion Systems

Leave a Reply