LCD and Arduino board

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Re: LCD and Arduino board

Postby Hidayah » Mon Oct 28, 2013 3:52 pm

now i need to develop the project... before this my proposal i write that im using LCD 16x2 not the LCD keypad shield.. can u see what the problem in my wiring? :oops:
Hidayah
Novice
 
Posts: 30
Joined: Thu Jun 06, 2013 12:12 am

Re: LCD and Arduino board

Postby robosang » Mon Oct 28, 2013 11:19 pm

I don really understand why you don want to share the photo with the power is ON and the program is loaded. This will help us to see how is the LCD output and then help you. Do what you can, and we will do what we can.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: LCD and Arduino board

Postby Hidayah » Mon Nov 11, 2013 8:46 am

sorry sir.... i really want to upload the picture but the quality of my picture is not really good.

here some picture i capture.

1) first picture is not have power because the red led is so light.
2) the power had put on and the coding is burn
3) is the picture that i had draw using word, the wiring that i used.. what wrong with the wiring? because the lcd is not display any word.

thanks....
Attachments
IMG_20131111_082948_0.jpg
IMG_20131111_082420_0.jpg
WIRING PROJECT.JPG
Hidayah
Novice
 
Posts: 30
Joined: Thu Jun 06, 2013 12:12 am

Re: LCD and Arduino board

Postby robosang » Mon Nov 11, 2013 9:32 am

The connection seem to be correct with the sketch.

Is the header pin on LCD being soldered properly? Because I cannot really see any lead on the pad of LCD.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: LCD and Arduino board

Postby Hidayah » Mon Nov 11, 2013 10:01 pm

i not sholder the lcd pin... i just put the pin in the hold of lcd..
did is effect of the output?
Hidayah
Novice
 
Posts: 30
Joined: Thu Jun 06, 2013 12:12 am

Re: LCD and Arduino board

Postby robosang » Mon Nov 11, 2013 10:46 pm

Great! Superb work.... I have nothing to say about this. :o
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: LCD and Arduino board

Postby Hidayah » Sun Nov 17, 2013 12:19 am

i had solder the lcd... and u know.... it work..... :cry:

i spend alot of time to display the word in lcd,
because i not solder the pin, it not work.. after i solder it... it is work.... :oops:

now i need to display the value of my sensor to lcd..
i used this code to read value from my sensor
CODE: SELECT_ALL_CODE
#include <SoftwareSerial.h>      //we have to include the SoftwareSerial library, or else we can't use it. 
#define rx 2                     //define what pin rx is going to be.
#define tx 3                     //define what pin Tx is going to be.

SoftwareSerial myserial(rx, tx); //define how the soft serial port is going to work.



char ph_data[20];                //we make a 20 byte character array to hold incoming data from the pH.
char computerdata[20];            //we make a 20 byte character array to hold incoming data from a pc/mac/other.
byte pc_debug=0;                  //if you would like to debug the pH Circuit through the serial monitor(pc/mac/other). if not set this to 0.
byte received_from_computer=0;     //we need to know how many characters have been received.                                 
byte received_from_sensor=0;       //we need to know how many characters have been received.
byte arduino_only=1;               //if you would like to operate the pH Circuit with the arduino only and not use the serial monitor to send it commands set this to 1. The data will still come out on the serial monitor, so you can see it working. 
byte startup=1;                   //used to make sure the arduino takes over control of the pH Circuit properly.
float ph=0;                      //used to hold a floating point number that is the pH.
byte string_received=0;            //used to identify when we have received a string from the pH circuit.


void setup(){
     Serial.begin(38400);       //enable the hardware serial port
     myserial.begin(38400);     //enable the software serial port
      }
 
 
 
 void serialEvent(){           //this interrupt will trigger when the data coming from the serial monitor(pc/mac/other) is received.   
        if(pc_debug==1){       //if pc debug is set to 0 this function will be bypassed. 
           received_from_computer=Serial.readBytesUntil(13,computerdata,20); //we read the data sent from the serial monitor(pc/mac/other) until we see a <CR>. We also count how many characters have been received.     
           computerdata[received_from_computer]=0; //we add a 0 to the spot in the array just after the last character we recived. This will stop us from transmiting incorrect data that may have been left in the buffer.
           myserial.print(computerdata);          //we transmit the data received from the serial monitor(pc/mac/other) through the soft serial port to the pH Circuit.
           myserial.print('\r');                  //all data sent to the pH Circuit must end with a <CR>. 
          }   
        }
 
 
 

void loop(){
   
  if(myserial.available() > 0){    //if we see that the pH Circuit has sent a character.
     received_from_sensor=myserial.readBytesUntil(13,ph_data,20); //we read the data sent from ph Circuit untill we see a <CR>. We also count how many character have been recived. 
     ph_data[received_from_sensor]=0; //we add a 0 to the spot in the array just after the last character we recived. This will stop us from transmiting incorrect data that may have been left in the buffer.
     string_received=1;                //a flag used when the arduino is controlling the pH Circuit to let us know that a complete string has been received.
     Serial.println(ph_data);         //lets transmit that data received to the serial monitor.
     }   
 
  if(arduino_only==1){               //if you set arduino_only to = 1. 
     if (startup==0){                //if the arduino just booted up, we need to set some things up first. 
         pc_debug=0;                 //make sure pc_debug is set to 0. You will no longer be able to write commands to the pH circuit in the serial monitor. 
          myserial.print("e\r");     //take the pH Circuit out of continues mode.
          delay(50);                 //on start up sometimes the first command is missed.
          myserial.print("e\r");     //so, let’s send it twice.
          delay(50);                 //a short delay after the ph Circuit was taken out of continues mode is used to make sure we don’t over load it with commands.
          startup=1;                 //startup is completed, let's not do this again during normal operation.
      }
   
 
   
  delay(800);                         //we will take a reading ever 800ms. You can make this much longer or shorter if you like.
   myserial.print("R\r");  {         //send it the command to take a single reading.
   if(string_received==1)            //did we get data back from the ph Circuit?
     ph=atof(ph_data);              //many people ask us "how do I convert a sting into a float?" this is how...(pretty tough)
     if(ph>=7.5){Serial.println(ph);} //This is the proof that it has been converted into a string.
     if(ph<7.5){Serial.println(ph);}  //This is the proof that it has been converted into a string.
     string_received=ph;     }       //reset the string received flag.
  }   

}     
     


and this code to display the word "hello" to lcd..
CODE: SELECT_ALL_CODE
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7,8,9,10,11,12);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}


i try combine the code... but it not work....
Hidayah
Novice
 
Posts: 30
Joined: Thu Jun 06, 2013 12:12 am

Re: LCD and Arduino board

Postby yonghui » Thu Nov 21, 2013 12:11 pm

How do u combine the code?
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Previous

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 29 guests