Serial I2C LCD 1602 Module (HCARDU0023)

LCD, TFT, OLED, LED modules
colubridae
Posts: 12
Joined: Thu Jan 14, 2016 3:36 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by colubridae » Fri Jan 15, 2016 11:52 am

Hi Andrew

In answer to question.

I deleted the library called "HCARDU0023_LiquidCrystal_I2C_V2_1" and just to be sure I recompiled the sketch form the first post at the top of this topic. the compile failed with a "no such library" message.

I then redownloaded the zipped file from the first post at the top, extracted the zipped files into the arduino libraries folder and recompiled and uploaded the sketch from this first post. It compiled and loaded ok; but only the "H" appeared on the top line and only the "*" appeared on the bottom line of the LCD. :)

Have you any other ideas? or should I ask for an LCD replacement?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by andrew » Fri Jan 15, 2016 2:03 pm

If we can't get to the bottom of it we can certainly arrange for a replacement.

I've never seen this type of problem before. The fact that you are seeing something happen does mean there is some form of life but it sounds like it's losing the connection during data transfer for some reason. The only thing left I can suggest is to check the connections, especially the power and ground pins. Make sure you have a good ground connection to your Mega. Also what voltage are you driving the module at and how long are the cables to the module?
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

colubridae
Posts: 12
Joined: Thu Jan 14, 2016 3:36 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by colubridae » Fri Jan 15, 2016 3:56 pm

Hi Andrew. Thanks for the prompt reply.


FYI. The cables and connectors have been cannibalised from an old keyboard.
They are approx 30cm for SDA/SCL and approx 10cm for VCC/GND

I have disconnected each one separately and tested the LCD/arduino setup.

With the GND disconnected the screen flashed at approx 1Hz very dimly.
With the VCC disconnected the screen was as dead as a dodo.
With SDA disconnected the screen simply showed the topline as solid characters (i.e. every dot in the matrix switched on. Same thing with the clock line.

Also FYI, my intention is to run the screen maybe 1.5m from the arduino. It will be part of signalling on a model railway. In combination with the signalling programming I plan to measure track power and arduino power with hall effect transducers and output the measurements to the LCD.

Thanks for your help so far.


also driving the LCD from the 5v VCC.

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by andrew » Fri Jan 15, 2016 4:49 pm

I've just taken one out of stock and I can replicate your problem. It's not an issue with the LCD itself, it looks like something in the new version(s) of the Arduino IDE has broken the library. Please bear with me whilst I look into it and figure out a permanent fix.

As temporary fix, if you download one of the older versions of the Arduino IDE (https://www.arduino.cc/en/Main/OldSoftw ... s#previous) it should work fine. I've checked it with V1.05 which is quite old but a newer version like 1.5.x should work too. Just download the ZIP version and you can then run it along side whatever version you have installed version. I'll post here when I have a fix.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

colubridae
Posts: 12
Joined: Thu Jan 14, 2016 3:36 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by colubridae » Fri Jan 15, 2016 7:35 pm

andrew wrote:I've just taken one out of stock and I can replicate your problem. It's not an issue with the LCD itself, it looks like something in the new version(s) of the Arduino IDE has broken the library. Please bear with me whilst I look into it and figure out a permanent fix.

As temporary fix, if you download one of the older versions of the Arduino IDE (https://www.arduino.cc/en/Main/OldSoftw ... s#previous) it should work fine. I've checked it with V1.05 which is quite old but a newer version like 1.5.x should work too. Just download the ZIP version and you can then run it along side whatever version you have installed version. I'll post here when I have a fix.
Hi Andrew thanks for prompt reply.


I am underway with re-install. I will keep you posted :)

colubridae
Posts: 12
Joined: Thu Jan 14, 2016 3:36 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by colubridae » Fri Jan 15, 2016 8:02 pm

Hi Andrew

Success! :D


re-install of IDE was a bit of a pain. Had to have two runs at it. Mea Culpa.

The old IDE is missing the recent sketch option. :roll:

FYI I had done some strange coding to solve my single character problem.
When I tried to recompile my sketch on the old IDE version it threw up all sorts of compile errors.
In fact the code I wrote did not seem to match the arduino coding reference pages.


However you are my new hero.



I have one last question. In one of your replies you mentioned cable length from arduino to LCD. This has spooked me a little as I was planning to make my cable approx. 1.5 meters. Is this a problem?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by andrew » Sat Jan 16, 2016 10:10 am

I've now updated the library in the first post. It's working fine with the latest Arduino IDE (1.6.7). Just delete the old library and install this new one. Note that in your sketch to initialise the LCD you need to use lcd.begin() instead of lcd.init().

I have one last question. In one of your replies you mentioned cable length from arduino to LCD. This has spooked me a little as I was planning to make my cable approx. 1.5 meters. Is this a problem?
1.5M should be fine.
re-install of IDE was a bit of a pain. Had to have two runs at it. Mea Culpa.
Just for information if you download the ZIP versions of the IDE you can run them directly out of the unzipped folder without having to install them. It's very convenient if you want to run multiple versions along side each other.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

colubridae
Posts: 12
Joined: Thu Jan 14, 2016 3:36 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by colubridae » Sat Jan 16, 2016 3:27 pm

Thanks very much Andrew. Very pleased with outcome.

Have not re-installed IDE yet.

Thanks for tip about running from zip file.

:D

colubridae
Posts: 12
Joined: Thu Jan 14, 2016 3:36 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by colubridae » Wed Jan 27, 2016 10:32 pm

Hi Andrew.

Work proceeding on my arduino on my model railway.

I'm not sure if I asked this, but I'm planning to run my LCD off a separate power supply (5V of course), do I need to tie the ground of this power supply to the ground of arduino?

Is this a good thing to do anyway, viz tie all grounds together?

I ask because I'm planning to connect Hall effect transducers to the analog pinss to measure the amperage through my arduino and through my train controller and I seem to recall a youtube video of someone saying that the ground of the transducer had to be tied to the arduino ground. Is this correct? Please.

Regards TJ

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Serial I2C LCD 1602 Module (HCARDU0023)

Post by andrew » Thu Jan 28, 2016 9:27 am

Yes, the digital signals from your Arduino to the LCD need to have a ground reference. Similarly your power supply for the LCD needs a ground return path. As both the Arduino and the power supply will then be both grounded to your LCD, their grounds are effectively connected together.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “Display”