16x2 lcd with pic16f690

Thread Starter

gpm

Joined Nov 23, 2011
10
hi all
its my first wisit to this site my project is ac voltmter on 16x2 lcd using pic16f690
my problem is..as
project is working well at my test bench but when i installed it on stablizer few digits of lcd get changed with viltage change(when relay operates) am using 4 bit mode in c, i don't connected remaining 4 free pins of lcd to ground
is my prob. due to not grounding free 4 pins or some other problem
pl. help any one
 

MrChips

Joined Oct 2, 2009
30,707
You have to pinpoint where the error is being made. Try to determine if the error is in the reading from the ADC or the LCD being at fault.

You can begin by writing a test program that slowly displays on the LCD values counting upwards from zero. This is let you know if the LCD is working properly.
 

Thread Starter

gpm

Joined Nov 23, 2011
10
special thanks to Sir
what happend is i wrote on lcd
'' Voltage = xxx V '' (xxx is voltage read by ad & displayed on lcd )
what happend when relay make break
'' Voltage 2 xxx V ''
then
'' Voltage $ xxx V ''
or
'' Voltage 2 xxx w ''
something like that...
 

MrChips

Joined Oct 2, 2009
30,707
As I suggest, forget the ADC reading for now. Can you display numbers incrementing by 1?
You will need to use this feature in order to find the rest of your problem.
 

Thread Starter

gpm

Joined Nov 23, 2011
10
four relays r there for controlling stablizer voltage
before prob. was of resetting controller then i replaced .1 cap to 22uf at pin vcc and vss
 

t06afre

Joined May 11, 2009
5,934
Sorry for asking. But to be sure. Is it the ADC reading (value)that change. Or is it the characters shown in the display that change
 

Thread Starter

gpm

Joined Nov 23, 2011
10
every thing ok at my test bench prob. occurs only when i connect it to field perhap transiant disturbing lcd
 

Thread Starter

gpm

Joined Nov 23, 2011
10
can u tell me is it compulsory to ground free pins of lcd when used in 4 bit mode from preventing malfunctioning?
 

MrChips

Joined Oct 2, 2009
30,707
can u tell me is it compulsory to ground free pins of lcd when used in 4 bit mode from preventing malfunctioning?
The answer is NO.

Please do as I suggest. Anything can change from one test situation to another. I suspect that your problem is in the ADC/analog/power supply filter/ section.

But before we go any further we have to confirm what is working. We will need a working LCD to test any further. Have faith in me. I have been doing this sort of thing a few days longer than you have been.
 

Thread Starter

gpm

Joined Nov 23, 2011
10
i think prob. not in adc nor in analog it is in power filtring cos lm7805 is aprox. 10 cm away from pic16f690' s vcc pin it was resetting earlier when relay make break, then i put 22uf cap at pin 1 and 20 of microcontroller resetting prob sorted but lcd prob starts....
 

John P

Joined Oct 14, 2008
2,025
Re the unused pins of the LCD, you can leave them unconnected. It's standard for the pins to have built-in pullups to Vcc.
 

Thread Starter

gpm

Joined Nov 23, 2011
10
sorry if u mind my any word, actually it is my 2 project first was of ammeter (aprox. 50 pcs. ), that is working well, i dont change either adc or software setting except volt insted of ampere ,
i made changes in pcb design according to fitting, then resetting of controller starts than i put 22 uf cap. there now lcd prob starts.
 

thatoneguy

Joined Feb 19, 2009
6,359
Make sure you have a snubber diode across the relay coils, pointed 'backwards', pointed toward V+.

Put a 1k resistor in series between the voltage source and the ADC input pin. Also add a 0.01uF cap on the ADC pin to ground as well to prevent transients from being measured.

This is, of course, assuming the LCD is functioning without issues in the field, as MrChips has pointed out. At this point, we don't have enough information, and can only throw guesses out, and if you don't act on them, it makes it extremely difficult to assist you.

So make a loop to run the LCD through it's paces, both fast and slow, and look for any glitches in the field/wherever the problem shows up, using strings and counts from code, not from the ADC.

If not, try adding the cap and input resistor to protect the PIC from surges and to filter out high frequency noise (the capacitor isn't large enough to filter frequencies the PIC can distinguish at 15μS-30μS (roughly) total sampling & read time and only 10 bits.
 
Top