Pages: [1]   Go Down
Author Topic: 16 x 2 lcd garbled  (Read 4571 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,
Iam trying to come out with a water totalizer, dispenser with preset quantity levels measured in literes, using arduino uno r3 board.
I have a standard 16x2 LCD display, hooked to an Arduino Uno using 4 data pins, as described here,
In short, RW is wired to ground, and RS, Enable, and Data4-7 are connected to Arduino pins, while Data 0-3 are floating.

I have other things (water flow sensor, an optoisolated 5vRelay module, a mains (220v AC) solenoid valve connected to the relay module and some momentary switches) connected to the pins on the Arduino as given below.
LCD PIN No.       ARDUINO PIN No.
1            GND
2            +5V
3            TO GND THROUGH 10K POT
4            PIN 9
5            GND
6            PIN 8
7
8
9
10
11            PIN 7
12            PIN 6
13            PIN 5
14            PIN 4
15            +5V THROUGH 330OHM RESISTOR
16            GND

I have connected the sensor to arduino pin 2 and the relay module’s line to pin 3 and three momentary switches to pins 10, 11, 12.
The code I use writes text to the lcd display, the flow rate, total flow and preset quantity, and normally, the display works perfectly.
However, sometimes the LCD becomes garbled. It remains garbled usually after a few more cycles of open/close to reset. The garbling always starts and stops at the same time as the relay either opens or closes.
By "garbled", I mean that every time I write to it following it becoming garbled, rather than writing english characters, I get a string of characters, that I usually cannot identify in the datasheet. This string of garbled characters tends to move left along the screen.
I am confident it's not the Arduino itself getting confused, as I write the same text to the Serial monitor at the same time, and it is not garbled and the code loop works finely even when the lcd remains garbled.
I've since experimented with wiring the RW pin to an Arduino output, and Data0-3 to ground, but this doesn't help. I've powered the whole device with a 9V battery or with USB, and it doesn't help. I've replaced the battery... no change.
I tried to take the load (the solenoid valve) connected to the relay away from the whole setup…no change,
I even tried after disconnecting the load (the solenoid valve) from the relay (but the 220vAC mains remained connected to the relay contacts, without any load)…no change
I can confirm that, the electro magnetic interference caused by the solenoid valve is not the reason for this garbling.
The only thing that seems to work fine is when, I disconnect the 220vAC mains from the relay contacts, but that defeats the purpose :-),
I am confident that the relay is not making any disturbances to the lcd but the 220v AC mains when connected to the relay even without any load, garbles the lcd.
I mean the lcd only, not the arduino.
I don't have a signal analyser or anything more sophisticated than a multimeter, a laptop and an arduino... Does anyone have any hints for helping me debug this?
Kindly help me…
Regards,
Adal.
I have attached the image of garbled text:
i have posted the same in the general lcd forum also.


* LCD GARBLED.jpg (119.79 KB, 735x551 - viewed 76 times.)
« Last Edit: February 19, 2014, 02:20:25 pm by adalarasu » Logged

Kerala , India
Offline Offline
Full Member
***
Karma: 2
Posts: 100
ELECTRONICS ENTHUSIAST
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What is impedance of 5V Relay?
Logged

- Electronics enthusiast by birth

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Saravanan, sorry for the delay,
I am unable to find anything regarding impedance on the relay,
I am attaching the image of the relay board. as I have said earlier,
I am confident that the relay board, or the relay is not the reason for this garbling,
because, if I isolate the load along with the 220v ac power source, every thing is working fine,
if I just connect the 220v ac source to the relay switch even without any load, then the lcd garbles.
Still I am unable to find any solution.
regards,
adal.


* DSCF4998a.jpg (188.92 KB, 2328x1200 - viewed 47 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
i want to clarify something with you guys,
 when i went through a site regarding this problem,
 someone answered that " using a shielded wire will solve this garbling problem as this is due to emi generated by solenoid",
is it true?, if so, where i have to connect the shied of the wire, i mean, to the gnd of arduino are the earthe of the 220v ac mains
kindly help me,
regards,
adal
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1531
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That happens very often.You must put a polyester capacitor 100nF  in parallel with the relay coil to suppress the noise caused by the relay when it switches.
Post the results
Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The only thing that seems to work fine is when, I disconnect the 220vAC mains from the relay contacts, but that defeats the purpose :-),
I am confident that the relay is not making any disturbances to the lcd but the 220v AC mains when connected to the relay even without any load, garbles the lcd.
I mean the lcd only, not the arduino.


hi, as I have stated before, if the relay module alone connected to the arduino without the 220v ac mains connected to it , works fine ant not creating lcd garbling. when I connect the 220v ac mains even without the load (solenoid valve) connected to it, garbles the lcd,
this problem is not yet solved,
Iam awaiting for the forum help...  smiley-kiss
regards,
adal.
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 37
Posts: 1531
Pretending you know everything then you will learn nothing.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Read this
http://www.instructables.com/answers/My-Arduino-and-20x2-LCD-is-going-crazy-after-a-whi/
http://electronics.stackexchange.com/questions/34181/debugging-a-16x2-lcd-display-on-an-arduino
« Last Edit: February 27, 2014, 09:20:21 am by HugoPT » Logged

Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B


Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
thanks, i will try this, smiley
regards,
adal.
Logged

Pages: [1]   Go Up
Jump to: