Pages: [1]   Go Down
Author Topic: 16 x 2 lcd garbled  (Read 472 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:


* LCD GARBLED.jpg (119.79 KB, 735x551 - viewed 44 times.)
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4119
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The garbling always starts and stops at the same time as the relay either opens or closes.
You are most likely getting interference from the electromagnetic field produced by the relay coil.

Quote
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.
In spite of your confidence the relay coil is still the most likely cause of the problem.  The 220v ac mains, even without any load, can act like an antenna.

There are lots of previous forum threads on this topic.  Try a google search for lcd relay site:arduino.cc. 


Don
Logged

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

Hi, Thanks,
I have searched for this, but I hardly find any solution till now,
Iam attaching the image of my relay module herewith,
can anyone pls help me regarding this,
regards,
adal.


* DSCF4998a.jpg (188.92 KB, 2328x1200 - viewed 14 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

NSW Australia
Offline Offline
Edison Member
*
Karma: 35
Posts: 2393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

No.

It is very unlikely that the magnetic field generated by the relay (which is in any case, deliberately confined to the magnetic circuit, a requirement to actually make the relay work in the first place), or the electrical field from the impulse on interrupting the current, could radiate any significant distance at all.  It is sufficient to keep the wires separate.

What is more important, is having the "back EMF" diodes correctly connected, preferably immediately adjacent to the relays themselves, ensuring that there are short and sturdy connections connecting the grounds together and preferably radiating from the power supply to the relays rather than from the Arduino board, also that the relays are supplied directly from the power supply and not through the Arduino.  It is the current in the wires that may cause voltage drops, which can cause interference to the operation of the Arduino.
Logged

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-confuse
regards,
adal.
Logged

Pages: [1]   Go Up
Jump to: