Hello all! I've been working on a simple thermometer to use in my house. I wrote some code for it, simulated the circuit on AutoDesk, built the circuit part for part anddddd.... the LCD is flickering. I have read other forum posts that didn't really help me out either. I checked my connections numerous times and even went through the trouble of rebuilding the circuit again. Twice. I am kind of new to this, can anyone help?
delay(5000);
//someone said that the refresh rate of the analog signal (coming off of A1)
//should be less than a few times a second for the LCD to "catch up"
//changing the delay didn't really help, although I'd like to keep it
//around 1000 ms.
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
A picture of your project would also help.
Are you using the PC USB to power the Arduino, what model is it.
What is your temperature sensor?
Do the LCD characters flicker, or the backlight flicker?
If you remove the temp sensor code from the sketch, does the flicker stop?
#include <LiquidCrystal.h>
#define aref_voltage 3.3
int tempPin = 0;
int tempReading;
LiquidCrystal lcd (12, 11, 5, 4, 3, 2);
void setup()
{
lcd.clear();
//someone from another forum said that I should do this
Serial.begin(9600);
analogReference(EXTERNAL);
lcd.begin(16, 2);
lcd.print("Temperature: ");
}
void loop()
{
tempReading = analogRead(tempPin);
float voltage = tempReading * aref_voltage;
voltage /= 1023.0;
float TemperatureC = (voltage - 0.5) * 100;
float TemperatureF = (TemperatureC * 9.0/5.0) + 32.0;
lcd.setCursor(0, 1);
lcd.print(TemperatureF);
lcd.print(" F");
delay(5000);
//someone said that the refresh rate of the analog signal (coming off of A1)
//should be less than a few times a second for the LCD to "catch up"
//changing the delay didn't really help, although I'd like to keep it
//around 1000 ms.
}
This is the link to the simulation that I am working on.
The LCD backlight seems to be flickering. No visible sign of any of the 32 characters. I played around with the contrast potentiometer (10 K) and added resistance to the VCC, nothing seemed to work.
Hope this helps, thanks!
Hi,
If its the backilight that is flickering then it has nothing to do with your code.
The backlight is just a LED light that is powered from the arduino 5V, or do you have it connected to the 3.3V.
Check what you backlight voltage should be.
While that is all true, I assumed something could have been wrong with the code because the characters that should be there are not. The backlight is flickering, but no text is being displayed. Do you think I wired it wrong? I also added a 220 Ohm resistor between the LCDs backlight positive header and the 5v coming from the Arduino. I should mention that my sensor is running off of the 3.3v, and that both have separate GNDs. I have tried to switch them up, but nothing has seemed to work, thus far.
First write and get the code for the display working and debugged.
then,
Write code for the temperature sensor, get it working and debugged.
then
Combine the two, get them working..
Have you tried the Example codes in the IDE for the LCD display?
Please a circuit diagram of what you have and a picture of your project so we can see your layout.
The LCD seems to be flickering slightly faster, and the backlight is much brighter (it was relatively dim on my Thermometer sketch). I think that the sensor might be causing a problem, but I am still trying to test it all.
I used a very simple sketch. Also, the variation in the Analog Value was noticeable. When I touch the sensor it increased, when I opened a window in my room it decreased a bit.
If people keep asking for pictures of the setup, the logical conclusion is that it is because they want to see pictures of the setup. They're not asking for drawings or diagrams. Diagrams don't show the wrong things being hooked up.
The LCD seems to be flickering slightly faster, and the backlight is much brighter (it was relatively dim on my Thermometer sketch). I think that the sensor might be causing a problem, but I am still trying to test it all.
It would be helpful if you could be a lot more helpful. What do you see with this sketch? What do you see when you take out that junk in the loop?
To properly "test it all" and not waste everyone's time, including yours, the very first step is to make your LCD show static text. Prove that everything is wired up correctly.
Sorry, I do not have a camera to take any pictures with. The best I can do right now is show you what it should be, and maybe give you a description of where I have the pins plugged in. Thank you for taking the time to help me out, I'm sorry if I need to be more descriptive.
ConstantineM:
No more flickering, however the screen does not print "ANYTHING". Just a blank screen (with the backlight on).
If you look at INTPs photo above and compare it to your display, do you see the darker non lit pixels that build the letters? If you don't see them the contrast setting is most likely way off and is a very likely to blame.
I grabbed a second breadboard and I spaced things out a bit. Everything seems to be working fine! Thanks for all of you're help, it seems that my project is complete.