Skip to main content

ATmega-8 based serialLCD module

ATmega-8 based serialLCD module
(Also provided my ready-to-use Arduino library & firmware sources)

In every electronic system, it is necessary to provide information in visual form for convenient user interface. So the display technology is one of the important subsystem in every electronic system like computer, cell phones etc..
If any kind of display is used in embedded control system then it will be very helpful to provide a human readable output. It can be also used for debugging for system designers. The most commonly used displays in embedded systems are as follow:
  1. LED
  2. LCD
  3. TFT
Out of this displays, the LED displays are easy to handle, but it requires large amount of input current & multiplexing to control each LED in the panel. TFT display provides good resolution & colorful graphics, but the main disadvantage is its cost & it requires a special kind of display controller / graphical processing unit to handle complex mathematical calculations to provide rendering to display.
The LCD displays are cost-effective solution for embedded system as it can display alphanumeric characters along with special user-defined symbols. The LCD display also contains a refreshing controller integrated in LCD unit which free up main microprocessor from task of refreshing the display & improves overall system throughput. But the disadvantage LCD display is it requires large no of pins for interfacing with system. So it is quite difficult to build a PCB of such LCD based systems practically.
Lets consider, we have a 16x2 alphanumeric LCD display which is to be interfaced with Arduino board. So for this design, we require 8/4 data lines to carry data signal to LCD along with 3 control signals i.e. RS,R/W,E. This large number of interfacing pins produces bulky system & increase the system & coding complexity which may cause sever errors like displaying unwanted characters on LCD or even up to display failure.
Basic idea of serialLCD:
The main objective of serialLCD is to control any kind of alphanumeric LCD display using a single signal line which communicates with LCD controller using serial communication technique. My serialLCD prototype consist of 2 major blocks:
  1. LCD controller:
It is ATmega8 microcontroller @ 8MHz internal osc. Programmed in Arduino IDE. It uses no-xtal bootloader which provide arduino compatibility without 16Mhz external crystal & also it is open-source. Using 8Mhz internal osc. Reduces hardware & improves power efficiency. ATmega8 uses its native serial port (USART) to communicate with master microcontroller. It acts as bridge between master controller & LCD. ATmega8 can be replaced by mega168/328 without changing code. (You must change bootloader.). The source file is provided as Firmware file in attachments.
  1. LCD display:
It’s a regular 16x2 alphanumeric display. There are no more customizations in LCD.
Features of serialLCD module:
  • 1 wire UART based Serial LCD
  • Arduino library is ready-to-use which provides easy commands & compatible with LiquidCrystal library. The serialLCD library uses SoftwareSerial library internally (on pin 6, 7) which free up native serial port for communications with other devices or PC.
  • LCD backlight brightness control through PWM.
  • Automatic line changing if text size is larger than 16 characters.
  • 9600 slandered baud rate which is compatible with all mcu’s.


    All source files are hosted on following page:

                                          Fig. : Schematic is designed in fritizing. It is open-source designing tool.

ATmega-8/168/328 Arduino pin mapping:
Carefully check the schematic. Compare arduino pinouts with ATmega8/168/328 pinouts. The table given following describes pin mapping. (NOTE: ATmega pin numbers are pin number of IC, NOT arduino)
Pin mapping:

ATmega-8/168/328 pins                   LCD pins
15 (PWM)                                             15
16                                                         D7
17                                                         D6
18                                                         D5
19                                                         D4
24                                                          E
25                                                        R/W
26                                                         RS

Firmware File: (Firmware-8/168/328.ino sketch file)

Prototype Images:
ATmega8 is placed under LCD to save space, wires & easy soldering..

Solder side of general purpose PCB (only required pins of ATmega are soldered. Other remaining pins are not soldered.)

Arduino Library:
serialLCD using ATmega8 (arduino compatible)
Type: Source File / library
Author: Pranjal Joshi
Date: 7-12-2013
License: GNU GPL v2 (Relased in public domain as open-source).


  • The serialLCD library uses SoftwareSerial library internally
  • So please DON'T INCLUDE SoftwareSerial.h in your sketch.
  • But you CAN use all the functions & features of SoftwareSerial to create other virtual serial ports in sketch.
  • So use it as you wish without including header file.

Extract the downloaded file & copy the serialLCD folder to arduino/library & restart arduino IDE to use this library.

There are 3 examples which are included in library. Once, you installed library as per above instructions you can find examples in arduino IDE File->Examples->serialLCD->

All source files are hosted on following page:

Video Demonstration:


New python library is available for Raspberry Pi. Download from

#Featured in EFY may 2014

Thank you,
Pranjal Joshi.


  1. Nice blog relevant to lcd and home decoration and i want to suggest that aaica provide more beneficial lcd unit to produce to more relevant things like home decore.

  2. Good work mate.. I might use your library for RPI


Post a Comment

Popular posts from this blog

Let's make an Arduino T-copter from scratch!

STEP-1 Starting up...Hi people, I am back after few months.. I decided to build something "productive" from ATmega chips laying around in my drawer, collecting dust. Still my final exam is not completed, i am busy in my studies.. but i am updating my idea as early as possible on this blog. From the first day, when i saw a multi-rotor UAV i was passionate to build my own multi copter.. And yes, build it from scratch rather than building it using ready made flight controllers like multiwii, kk multicopter etc... I am going make my own RF remote control rather than using a ready made multichannel  transmitters & receivers.. Hope my tricopter will fly as early as possible..
Basic Design (just created in paint):
I am going buy require components after my final exam... lot of work to do.. software, hardware & calculations...!!
so stay tuned to build your very own tricopter with me... 
(PS. I am trying to understand mathematical algorithm for flight stabilization and error dete…

ESP8266: Super compact WiFi Snipper for DeAuth attack

Introduction: Hello world! Few years ago, a new chip came to the market which started a new revolution! Yes, i am talking about the ESP8266. This chip is  way more powerful in terms of CPU architecture, clock frequency, flash size and power consumption if we compare it with existing arduino boards that usually contains Atmel's AVR controllers.
Actually i bought this ESP-01 modules few years back which was originally flashed with good old serial AT command firmware. Over the time, I figured out that the same chip can be directly programmed through the Arduino IDE. This feature is so amazing that you can practically use all existing arduino libraries and the same IDE to program the ESP8266 according to your need by flashing your own arduino sketch. (Word of caution: It will remove your existing AT commands firmware from the chip)
Okay, but why DeAuth?[ First of all you must read this, if you don't know anything about deauthentication attack. ]
After experimenting a lot with typical…

Wireless gesture Controlled Robot Using AT89S52

The gesture controlled robot is a special kind of robot which works with your hand gestures. It is possible to control the movement of robot in desired
direction just with your hand gestures. You just need to wear a small transmitting
device in your hand which included an acceleration meter. This will transmit an
appropriate command to the robot so that it can do whatever we want.
This robot is mainly divide into 2 parts:

1. Transmitter – The gesture device.
2. Receiver – The Robot.

Now let’s discus about transmitter first.
The transmitter consist of following analog and digital components:
1. Analog accelerometer ( motion sensor )
2. Comparator (LM324 OP-AMP)
3. 4-bit Encoder (HT12E)
4. RF transmitter (remote control )


THE TRANSMITTER PCB: The accelerometer: An Accelerometer is a kind of sensor which gives an analog data while moving in X,Y,Z dir…