in cubieboard

cubieboard I2C display


connecting a four line I2C display with the cubieboard is not very difficult, but still it took me some hours. So here I will describe how I got everything working nicely.


I bought a SainSmart 20×4 display on ebay for 12€.  Of course you need some wires to connect the display with the cubieboard. I am using 4 jumper cables. The problem is that the cubieboard’s pins are not in the normal 0.1″ raster. So maybe you want to buy something like the “Cubie Proto Board” or the “Cubie Baseboard”. I bought the Cubie Proto Board, because I do not need the additional features of the Baseboard and it is cheaper.

Connecting the display with the cubieboard

The display has four pins: GND, VCC (5v), SDA and SCL. According to the extened pins definition of the cubieboard pin #6 is SCL and pin #7 is SDA (U15 – the pin array near the USB-Ports). I choose to use pin #1 for the 5v and pin #25 for GND (U15 again).

cubieboard i2c wires


You need Linux running on your cubieboard – android won’t work. I am using cubian. The i2c-dev kernel module needs to be loaded.

With python3 and the quick2wire-python-api it is easy to talk to the LCD, so you need to download and install the api – and python3.

I’ve written a small class that makes it easy to display strings on the LCD (the first argument of the display method is the string, the second the line number). You can find the class here and some demo code here. In the demo you need to change the address to the one of your LCD.  You can get the address by running the following command (i2c-tools are needed):

i2cdetect -y 1

When everything is working the result should look like this:

cubieboard lcd


Write a Comment


  1. Hi, I have a problem. My i2c bus is 0, so I need to scan “i2cdetect -y 0” to get address of 0x34. I tried out your code but it keeps repeating “display powerd off”, my log has this entry repeated continously “incomplete xfer (0x20)”

    Would appreciate some help. Thanks

  2. Thanks for your help. Just to add on in case anyone reads this in future, cubieboard uses bus 0 for its internal PMIC. The bus exposed on headers is bus 1. So in my case, my hardware is defective since i2cdetect on bus 1 is blank.

  3. Hi, Can your method be used to interface a touchscreen display with the cubieboard? Is there a way to sidestep the baseboard approach to hook up a touchscreen display with the cubieb?