Page 1 of 4

LCD (20x4 made in China)

Posted: Friday 15 May 2015 10:36
by pepijn
This week i received one of my latest Chinese investments.
A Blue 20x4 LCD display with I2C interface.

Hooked it up to my (test) Raspberry i did not want to blow my production Banana Pro.
Some Pyhon coding, mostly cut and paste.

The result:
https://vimeo.com/127908552

Re: LCD (20x4 made in China)

Posted: Friday 15 May 2015 10:46
by tlpeter
That looks nice.

Re: LCD (20x4 made in China)

Posted: Friday 15 May 2015 12:18
by rtna
Can you write a how-to?

Is it this one?

http://nl.aliexpress.com/item/Free-ship ... 17726.html

Re: LCD (20x4 made in China)

Posted: Friday 15 May 2015 13:08
by pepijn
That's the type of display i used. You can find them on EBay for arround 6 euro's

Re: LCD (20x4 made in China)

Posted: Friday 15 May 2015 14:06
by ThinkPad
Looking good! That's nice to combine with this housing: https://www.sossolutions.nl/raspberry-p ... dinrail-2b (DIN-rail) so you can fit it into your meter cabinet.

Maybe you can share your code here :) ?

Re: LCD (20x4 made in China)

Posted: Sunday 17 May 2015 16:49
by D'rMorris
Posting the code would be great, with this I'm gonna build my own security system

Re: LCD (20x4 made in China)

Posted: Sunday 17 May 2015 16:58
by u01pei
Sharing the code Would be great!

Re: LCD (20x4 made in China)

Posted: Sunday 17 May 2015 17:01
by pepijn
Yes I will share the code, but need to clean it up a bit.

Re: LCD (20x4 made in China)

Posted: Sunday 17 May 2015 17:02
by u01pei
Great! Thanks Pepijn.... Goed bezig!

Re: LCD (20x4 made in China)

Posted: Sunday 17 May 2015 22:51
by pepijn
This is a nice tutorial (in Dutch) on how-to connect the screen.
http://www.gejanssen.com/howto/i2c_disp ... index.html

I also attached my Python scripts.

Re: LCD (20x4 made in China)

Posted: Monday 18 May 2015 15:47
by D'rMorris
Thanks Pepijn!

My next project :).

Re: LCD (20x4 made in China)

Posted: Monday 18 May 2015 22:50
by schmm
nice work!

I will try this!!

Re: LCD (20x4 made in China)

Posted: Monday 25 May 2015 10:24
by lrybak
Nice work pepijn. Have you tried to operate domoticz switches via ex rotary encoder?
It would be very nice fature to turn on/off switches directly w/o turning computer or smartphone

Re: LCD (20x4 made in China)

Posted: Monday 15 June 2015 15:51
by mariusvanderwerff
Hi there,

I'm a noob in this, can you tell me how to install the scripts on my Pi?

Regards, Marius

Re: LCD (20x4 made in China)

Posted: Monday 15 June 2015 21:05
by u01pei
Hello Marius,
Since you're Dutch, as are most of the people here, read this:
http://www.gejanssen.com/howto/i2c_disp ... index.html

Re: LCD (20x4 made in China)

Posted: Monday 15 June 2015 23:01
by mariusvanderwerff
Hi u01pei,

thnx for the reply,

did everything but got only a nice blue screen,

from lcd_display import lcd

my_lcd = lcd()
my_lcd.display_string("Hello World", 1)
my_lcd.display_string("YwRobot LCM1602 IIC V1 display", 2)
my_lcd.display_string("aan de Raspberry Pi", 3)
my_lcd.display_string("via gejanssen.com", 4)

This didn't work also.. any idea's ?

Re: LCD (20x4 made in China)

Posted: Monday 15 June 2015 23:19
by u01pei
Perhaps your address is wrong? try this:
enter this command on your pi:
i2cdetect -y 1
if it doesn't work, enter:
i2cdetect -y 0

Check the number in the table, this is your address. If there are more devices on your I2c bus, there will be several addresses visible. To be sure, unplug all other devices and the address left will be the LCD (or try them all)

To use the correct address in the python script:
open the script named lcd_display.py
on line five you will see 0x27
change the 27 into whatever you found in the I2c table. (leave the 0x as is).

Good luck

Re: LCD (20x4 made in China)

Posted: Monday 15 June 2015 23:32
by mariusvanderwerff
Hi u01pei,

the address is correct:
pi@raspberrypi ~/domoticz/scripts/lcd $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

import i2c_lib
from time import sleep

# LCD Address
ADDRESS = 0x27

Checked that already....

Re: LCD (20x4 made in China)

Posted: Tuesday 16 June 2015 11:58
by u01pei
Sorry Marius,

I am a noob myself, so I don't have any clue on what you could do next.

Re: LCD (20x4 made in China)

Posted: Tuesday 16 June 2015 13:47
by lrybak
Marius,
Double check wiring and try another simple "hello world" program to be sure that everything is ok