How to attach a LCD 20x4 I2C to a Raspy A+ with Pi-DAC+

Started from the following post on by ‘arginine’ to display MPD information on a 20x4 LCD

Then there is a link to a github project named “Raspberry Pi LCD library for the widely used Hitachi HD44780 controller, written in Python”:

That library is useful only to connect the LCD pin2pin by 4 or 8 bit and I have the I2C interface…

So I googled for I2C and founded this link: with explanation on how to use
20×4 LCD character display on a RaspberryPi with I2C interface. This is a generic discussion and not focused on MPD but many
comments down… bingo! User ‘supra’ posted a link very focused on MPD and I2C:
This is a project not very well documented, but with some help in forums and googling I finally obtained the necessary information
to show MPD info on my LCD!
Download the zip and put it in a local directory on your Raspberry. This will be the start source path for the whole project and the will be used to test the MPD2LCD.

Now, the instructions step by step:

Enabling I2C in Raspbian - The I2C ports need to be enabled in Raspbian before they can be used.
Edit the modules file

sudo nano /etc/modules
Add these lines:
i2c-bcm2708 i2c-dev
Exit and save the file
Now edit the modules blacklist file:
sudo nano /etc/modprobe.d/raspi-blacklist.conf
Add a ‘#’ character to this line so it commented out (ignore if your file is empty):
#blacklist i2c-bcm2708
Exit and save the file.
​Finally install the I2C utilities:
sudo apt-get install python-smbus i2c-tools
Enter sudo reboot to restart the pi and now the I2C pins will be available to use.

Checking for connected devices
At the command prompt type one of these depending on whether you are using the I2C0 or I2C1 port:

sudo i2cdetect -y 0
sudo i2cdetect -y 1

Could be necessary to setup the I2C environment on your Raspberry. Instructions for Raspbian are here.
Create a folder for the project and change directory to it. To create one in your home folder:
[code]mkdir ~/myproject
cd ~/myproject[/code]
Install the Quick2Wire libraries and setup the environment.

git clone
The following two steps will have to be done every time you login:
export QUICK2WIRE_API_HOME=~/myproject/quick2wire-python-api ### ATTENTION: Replace myproject with your real directory ###
To easily setup the environment every time without a login shell, put the two export lines above at the end of /etc/profile:
sudo nano /etc/rc.local

Install now the i2c libraries. Move into the directory you are going to create your python code and type:

git clone

The Think Bowl I2CLibraries require python3. If python3 is not installed, perform the following

sudo apt-get install python3
Install the python setuptools
sudo apt-get install python3-setuptools

Install the python libraries to interface with MPD. The new version of python-mpd libraries is located on github and
it's not backward compatibles with the original python-mpd packages, but this isn't a problem:

git clone git://
Install it
python install

Adding the "pi" user to i2c group

sudo adduser pi i2c

Finally, run the script to show info on LCD


To run the script automatically without opening any shell, put the above command into the rc.local below the previous two export commands

sudo nano /etc/rc.local
it should contains the following lines:
# Start MPD 2 LCD export QUICK2WIRE_API_HOME=/home/pi/raspi-mpd-lcd/quick2wire-python-api export PYTHONPATH=$PYTHONPATH:$QUICK2WIRE_API_HOME (sleep 10; python3 /home/pi/raspi-mpd-lcd/

Very interesting. Can you tell me what hardware (display) and connections you used?