Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Adding LCD code display on my arduino project(clothes dryer)

Status
Not open for further replies.

vinamarie

New Member
Hi Everyone,

Please help. I would just like to ask regarding my build (attached is the schematic). How to edit/write an additional code for my program displaying on the LCD if sensor is NOT sensing "DRYER(1st line) VACANT(2nd line)" and if sensor is sensing "DRYER(1st line) ON GOING(2nd line)" (attached is the sample display ).

Here is my initial working code without the LCD code display yet.
int MotorPin = 13;
int inputPin =2;
int val = 0;


void setup() {
pinMode(MotorPin,OUTPUT);
pinMode(inputPin,INPUT);
}
void loop() {
val = digitalRead(inputPin);
if (val==HIGH)
{
digitalWrite(MotorPin,LOW);
delay(500);
}
else
{
digitalWrite(MotorPin,HIGH);
delay(500);
}
}


Thank you very much! Hope to hear from anyone. :)
 

Attachments

  • schematic.png
    schematic.png
    84.3 KB · Views: 372
  • display.png
    display.png
    349.4 KB · Views: 377
First you need to connect your LCD to your Arduino. Google is your friend.

Mike.
 
Hi Vinamarie

If you open up your IDE, look under File - Examples - Liquid Crystal - Display

There are some examples there of the connections and the required libraries / code required which should integrate quite nicely with your own code.

MM
 
The standard (parallel) 16x2 lcd requires a lot of I/O lines in 8 bit mode, so opt for the 4 bit mode program code.
Even better, if you have yet to buy a LCD, purchace one of the types that have an I2C interface using just 2 i/os +power.
You can buy just the I2C converter to add on to an existing parallel LCD.



000268.jpg
000269.jpg
 
If the OP googles "Arduino LCD" then the very first page is this page which describes how to connect it and get example code working.

I also like the I²C LCDs but it does add another layer of complexity. Edit, plus they're very slow ~1mS per character.

Mike.
 
I'm just saying that the first problem he faces is connecting the LCD display. Whilst the examples do have a list of connections, seeing how they are actually made may help the OP.

Mike.
 
If the OP googles "Arduino LCD" then the very first page is this page which describes how to connect it and get example code working.

I also like the I²C LCDs but it does add another layer of complexity. Edit, plus they're very slow ~1mS per character.

Mike.

I don't think the speed matters a deal, as LCD displays are very slow devices anyway, so it makes very little difference. I did a test a few years back, using a PIC with one LCD attached as 4 bit , and three I2C ones of various sizes and different addresses - I send the same data to all of the displays sequentially, and gradually increased the speed at which the displays were updated. All the displays were able to update fast enough to make the displays unviewable, due to their slow response times, and all occurred at the same time.

However, I fully agree that it adds a further layer of complications - easiest to use 4 bit mode, even if only initially - you could always move to I2C later if pin count becomes an issue.

To be honest, while I've got plenty of I2C back packs in stock, and LCD's with them pre-fitted, I've yet to use one other than for 'playing' with them - I always just connect them as 4 bit.
 
I bought STONE STVC070WT-01 a few days ago, it has a free GUI design software I think it is very friendly to me as a novice so I bought it, in addition, I also bought the Arduino Uno board.

Well thats whats normally referred to as a TFT screen rather than the basic two line LCD displays mentioned above.

Seems its similar to the Nextion screens which are not the easiest to program along with the Arduino, but you will have to follow the few examples you can find on Stones site and the web.
http://www.instructables.com/STONE-STVC070WT-01-HMI-Screen-ARDUINO-Musical-Metr/

As a beginner, you might find it easier to start learning the basics with a cheap 16x2 LCD as detailed in this thread before using a much more advanced TFT screen like that which uses a much more powerful inbuilt micro that the humble Arduino.
 
Well thats whats normally referred to as a TFT screen rather than the basic two line LCD displays mentioned above.

Seems its similar to the Nextion screens which are not the easiest to program along with the Arduino, but you will have to follow the few examples you can find on Stones site and the web.
https://www.instructables.com/STONE-STVC070WT-01-HMI-Screen-ARDUINO-Musical-Metr/

As a beginner, you might find it easier to start learning the basics with a cheap 16x2 LCD as detailed in this thread before using a much more advanced TFT screen like that which uses a much more powerful inbuilt micro that the humble Arduino.
Ok, thank you very much for your advice, I will buy a 16x2 LCD in the near future, I used to use a 16x2 LCD when I first started learning arduino when I was still in college.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top