File Exchange

image thumbnail

Simulink library for Arduino Liquid Crystal Display

version 1.0.1 (117 KB) by Madhu Govindarajan
The Simulink block allows you to display text on a 16x2 character LCD screen connected to an Arduino


Updated 18 Apr 2019

View Version History

View License

The files include:
The Simulink Library containing the LCD block and supporting files
Example Simulink model that demonstrates how to use the block
The .m setup file for adding the folder to the MATLAB path
The two input ports of the block are the two strings you wish to display on the top and bottom row respectively cast to their uint8 ascii value.
The block parameters are the connected pins to the Arduino: in the order RS, EN, d0, d1, d2, d3

Visit this page for wiring the LCD:

Cite As

Madhu Govindarajan (2021). Simulink library for Arduino Liquid Crystal Display (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (13)

can it be use in 20x4 lcd?

Ahmad Swati

I am unable to display words or numbers on the display screen. Gives an error with string blocks although using a "uint8" converter block. Tried the matlab code function block using switch command as well but nothing works. Need help.


I am getting error on both Mac OS and Ubuntu. The library is working only on Windows


hi, im having this issue "/Documents/MATLAB/SupportPackages/R2019a/3P.instrset/arduinoide.instrset/libraries/LiquidCrystal/src/LiquidCrystal.cpp' "
im using OSX mac whit matlab 2019.

kenjiro sugaya

Madhu Govindarajan

@Tony Koki: To display numbers, I would recommend passing the number through a MATLAB function block wherein you just have a switch case statement outputting uint8('0') for 0 input and so on. If you do this for all 10 numbers, 0 through 9, then you should be able to display any number. Using the same techniques you can display pretty much any character.

Tony Koki

When i display words it works great. However when i display variable values and number it does not display. I use the data conversion block and set it to uint8. For exmple i want to display a Analog value on the LCD from a sensor. How can i do this ?

david asijm

Madhu Govindarajan

@Darren Page I think this is only compatible for releases R2018a and later. Will edit the submission to reflect that.

Darren Page

Hi, the links wont load on my R2017 version although says it is compatible.

Ahmed Nawara

I need some help to make it display 16 characters and 4 lines... as my LCD is 16*4 and I need it for a project.

MATLAB Release Compatibility
Created with R2018a
Compatible with R2018a to R2019a
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!