Arduino LCD via I2C

Hello Everyone,

I have a "Arduino Nano w/ATmega 328", connected with a "Clock" and and LCD screen 4x20.

The LCD is the "JHD 204A" and there is a chip connected on it with code "BV4218"
(I guess it is a I2C chip, please do correct me if I'm wrong).

What I want to do is to print "Hello" on the LCD using the SCL and SDA, but I don't know how
to do it!

I read a lot about the SCL SDA (I2C tutorial)
and I understood how it works in theory but I don't know what code I have to write in order to
send the sequences (Start, Address, Transite Data, Stop) to the LCD.

I would be really greateful if somebody could help.
:slight_smile:

Arduinakias,
Have you read the "How to use this forum" at the top of the page?
Depending on which version of Arduino you are using (1.0.3 up) there are examples included for using I2C LCDs.
Do you have the datasheet for the display, what is it's address, link to the retailers page/examples?
It is very easy to program once you get some basic parameters right, I think it is called a constructor, that has to be initialized at the start of the sketch.
If you have an older version of Arduino, search here for NewLiquidCrystal to find the new library for LCDs, with lots of help for installing and using.
You will also need the relevant library for the RTC.
You also might try searching the playground for more examples.
Google is your friend, lots of tutorials out there.
TomJ

Tumbleweed:
Depending on which version of Arduino you are using (1.0.3 up) there are examples included for using I2C LCDs.

Really?
I don't see any examples for I2C LCDs.
All I see is the LiquidCrystal library that uses 4 bit parallel mode.

Where are the i2c LCD examples?

--- bill

A backward compatible LCD library can be found at

https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

Handles all sorts of serial LCDs.

marco_c:
A backward compatible LCD library can be found at

https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

Handles all sorts of serial LCDs.

fm's released library has support for using 4 bit mode, i2c, and shift registers using 2 or 3 wires
to talk to a HD44780 based LCD.
i2c is not a generic interface for an LCD. (There are different ways to use I2C to talk to an LCD)
The i2c support in the released library is for using a PCF8574 i2c chip to drive the LCD.

Arduinakias, the LCD & module you have appears to be using a i2c backpack,
the ByVac BV4218.
www.byvac.com/downloads/datasheets/BV4218%20DataSheet.pdf
While it does have an i2c interface on it, it does not work the same
as when a PCF8574 chip is driving the LCD.
So unfortunately, fm's currently released newliquidcrystal library does not have support
for the BV4218.

However....
Last summer (2012) ByVac added support for the BV4218 to fm's library.
There were some issues with the early code (it broke the library), but it looks
like the code was updated in sept of 2012.
I glanced at it and for sure it won't compile with pre 1.x Arduino core.
So not sure if it works with Arduino 1.x, but it is probably worth trying it.
Since fm has not created a release since this code was added,
there is no download zip file that includes the 4218 support.
To get the code you will have to go to the download section, then go to the [Tags] tab
and then download the "tip" tag.
The direct link to the zip file for that is here:
https://bitbucket.org/fmalpartida/new-liquidcrystal/get/tip.zip

To install and use it is just like the other downloads.
You have to move the existing liquidcrystal library directory off somewhere else.
Then extract the files in the zip image and place it in the liquidcrystal library directory.

--- bill

This isn't your LCD, but I have a page about graphics LCD, and I2C:

And I2C in general:

You don't need to worry about start/stop stuff, the library does that.