LCD for Raspberry pi HD44780 via PCF8574 I2C openelec

Why, the hell, would you need alphanumeric LCD connected to your Pi while you have it connected already to 55inch TV via HDMI? No doubts you can survive without this additional gadget, but this is not why you bought RPi, right? (especially when it is only ~10Euro and it can provide very useful information from your pi…)

Below the post you can also find links that helped me figure things out, but they were far from the “easy to follow” tutorial… so here it is…

Hardware:
First of all, you need to buy a few hardware elements:
– HD44780 compatible LCD (preferably 20 characters in line)
– I2C interface (this tutorial is based on popular PCF8574 chip)
– pins to solder above elements together (sometimes you can get I2C board already soldered to LCD)
– 4 gold pin connection wires

You can get LCD working without I2C interface, but it will occupy far more GPIO pins than when I2C is used. When you have Lightberry Or something less fun :) ) connected to GPIO, I2C is the only option.
This are the pins to connect I2C interface board to. It =makes it quire easy to connect as I2C board usually has pins described in the same was as on the picture below:

I2C GPIO

I2C GPIO

And here are I2C board pins:

I2C board pins

I2C board pins

Round white thing is potentiometer for backlight – once you have everything set up it makes sense to adjust it to your personal preference.

We have the hardware set up so let’s take care of the software…

Software:

Frankly speaking I thought it would be easier :), especially when I saw that in openelec settings you can enable LCD support and select hd44780 driver.

First of all, on Openelec and RPi2 you must enable I2C in /flash/config.txt

First make the partition editable:

mount -o remount,rw /flash

Then add this line to /flash/config.txt:

dtparam=i2c_arm=on,spi=on

Next step is to create LCDd.conf file in /storage/.config folder, that would contain at least the following lines (please see this file to see full version with comments/descriptions):

## Server section with all kinds of settings for the LCDd server ##

[server]

DriverPath=/storage/.config/raspdrivers/

Driver=hd44780

Bind=127.0.0.1

Port=13666

User=root

Foreground=yes

# Hello message: each entry represents a display line; default: builtin

Hello=" Welcome to"

Hello=" OpenElec"

# GoodBye message: each entry represents a display line; default: builtin

GoodBye="Bye bye"

# Sets the default time in seconds to displays a screen.

WaitTime=5

# set title scrolling speed [default: 10; legal: 0-10]

TitleSpeed=1

## The menu section. The menu is an internal LCDproc client. ##

## Hitachi HD44780 driver ##

[hd44780]

ConnectionType=i2c

# Port where the LPT is. Usual value are: 0x278, 0x378 and 0x3BC

Port=0x27

# Device of the serial interface [default: /dev/lcd]

Device=/dev/i2c-1

# Bitrate of the serial port (0 for interface default)

Speed=0

# Specifies the size of the LCD.

# In case of multiple combined displays, this should be the total size.

Size=16x2

CharMap=hd44780_default

DelayMult=4

There are few very important parts of this config. First of all, you need to define a folder where you have the driver (you need this (RPi model 2) or this (old RPi model) customized file to have it working with RPi2 with this hardware setup). Secondly you must define connection type (I2C), port (0x27) and device (/dev/i2c-1 in my case, but see /dev folder, if it is also the case for you). Full version of LCDd.conf can be found here or here.

In Kodi you need to do two things:
– Go to System -> Openelec -> Services -> LCD support (turn it on) and select hd44780 driver from the list.
– install XBMC LCDproc addon (Add-ons/Services)
After installing make sure that the addon is active and configure it. Settings are rather self explanatory (you can simply play with it so see what they will do to your LCD), but there is one “Use remote LCDproc” that keeps turning on even, if I turn it off and I have no idea what that is :)

That’s it! You can easily customize what is being displayed on the display in /storage/.kodi/userdata/LCD.xml All options and list of possible parameters can be found here: http://kodi.wiki/view/Userdata/LCD.xml

Links:
http://sourceforge.net/p/lcdproc/discussion/312/thread/00298b2f/

Continue reading here: Control Hyperion from your remote

Was this article helpful?

0 0