This project makes use of the custom characters that can be generated in an LCD module. The LCD module has two or more controllers which helps in displaying the characters corresponding to the ASCII value which is send by the microcontroller. The ASCII character patterns are stored in the internal CGROM of the LCD controllers. The LCD modules also provide a CGRAM where the user can store the custom characters and display them. The method of generating custom characters is well explained in a previous project on how to create custom characters in an LCD.
In this project the Arduino pro-mini board is used which is then programmed with the help of Arduino IDE version 1.0.3 on windows operating system. The image of the Arduino pro-mini board and the Arduino IDE is shown in the following;
Fig. 2: Typical Arduino Pro-Mini Board
Fig. 3: Arduino IDE Software Window
Another hardware which can perform the USB to TTL conversion is used to upload the program into the arduino board. One has to work out the character of the custom character that needs to be displayed in the LCD screen as explained in the project on how to create custom characters in an LCD. The custom characters which are displayed in this project are shown in the following image.
Fig. 4: Custom Created Characters On LCD Using Arduino Circuit On Breadboard
Fig. 5: External USB to TTL converter board for programming Arduino and serial communication
It is assumed that the reader has gone through the project how to get started with the arduino and done all the things discussed in it. The arduino pro-mini board can have a maximum of eight analog pins which can be configured as analog input pins. The pins are marked in the board as A0, A1, and A2 up to A7. They are actually the input channels to the built-in ADC which can read the analog value and convert them to the digital equivalent. Some pro-mini boards have lesser number of analog pins.
In this particular project the variable pin of a potentiometer is connected to the analog pin;in this project the pin A0. The other two pins of the potentiometer is connected to the VCC and GND so that as the variable moves it can divide the entire supply voltage and provide it as the analog input voltage for the arduino board. An LED is connected to the analog output pin through a current limiting resistor; in this project it is connected to the pin 6. The code continuously reads the value from the potentiometer and writes the corresponding value to change the brightness of the LED connected to the pin 6.The built-in function in the arduino IDE analogRead() helps in reading the analog value from an analog input pin and another function called andanalogWrite() helps in writing an analog value to the analog output pin. The details of the functions and the method of analog read and write are already discussed in a previous project on how to use the analog input and output of the arduino.
The Arduino IDE has a library called <LiquidCrystal.h> which provides lot of functions to access the LCD module. Few of those functions which are very useful is small applications are already discussed in the previous project on how to interface an LCD, how to display sensor value on LCD, how to connect the LCD with the PC and how to make an LCD scrolling display.
The code written for this project has a function lcd.createChar() which helps to create the custom characters in an LCD screen. The details of the lcd.createChar() function are discussed in the following section.
The function lcd.createChar() can be used to write a custom character to the required location in the CGRAM. The function has two parameters in which the first parameter is the location in the CGRAM memory where the character array corresponding to the custom character need to be stored and the second parameter is the character array itself. For example if there is a custom character array called ‘cc’ and it need to be stored in the 5th location of CGRAM one can use the following statement;
The above statement writes the character array to the 5th location of the CGRAM of the LCD controller from where it can be displayed by calling the lcd.write() function discussed in the projects on how to connect the LCD with the PC and how to make an LCD scrolling display.
The code reads the analog calculate the analog voltage from it and then displays that much custom characters in the LCD screen. The code also glows an LED with the brightness which is equivalent to the value read from the analog input pin as discusses in a previous project on how to use analog input and output of the Arduino. Once done with the coding one can verify and upload the code to the Arduino board as explained in the project how to get started with the Arduino and the brightness of the LED can be observed to vary as the variable of the potentiometer moves. The voltage read from the analog input pin will be indicated using the dynamic display in the LCD module.