Simulator

A 16x2 LCD simulator with real Arduino code

Mokxi is a free online LCD simulator that runs in your browser, with nothing to install and no account needed. An Arduino Uno reads a thermistor and writes the temperature to a 16x2 character LCD over its I2C backpack, four wires in all. Drag the temperature and the display follows.

  • 455parts on the bench
  • 43boards running now
  • 1.00xreal time, on every board
Arduino Uno: I2C LCD thermometerlive0.000 s 0.00x
Click to open it in the editor
Drag the slider on the thermistor to change the temperature, or click anything else to open it in the editor.

What you can do here

In the circuit above, or in the editor it opens.

  • Watch an HD44780 16x2 LCD draw text from a real sketch
  • Drag the thermistor and see the reading and the low and high change
  • Change the I2C address or the contrast in the properties panel
  • Swap in the six-wire LCD1602 or a 20x4 LCD2004
  • Read the same temperature in the serial monitor
  • Edit the code, press Run, and share the circuit by link

What the running circuit shows

A sensor, a sketch and a display, all in one loop.

A 10 k NTC thermistor and a fixed 10 k make a divider on A0. The sketch turns the reading into degrees with a table and a straight line between entries, because the Uno has no floating point to spare for a logarithm, and writes it to the top line of the LCD. The bottom line keeps the lowest and highest it has seen.

In the engine the thermistor starts at 22.5 °C and the serial monitor prints “temp 22 C” while the LCD shows the tenths. Drag it to 40 °C and the monitor prints “temp 40 C” within a second and a half.

How the LCD is simulated

The controller, not a picture of one.

The display is an HD44780 controller behind a PCF8574 port expander at address 0x27, the backpack most cheap modules have. The sketch’s driver sends each character as six port writes, and the part decodes them the way the real controller does: 4-bit mode, the cursor, the character ROM and the backlight bit. So the classic faults are real here. Forget the backlight and the screen shows nothing, and a sketch that talks to 0x3F when the module answers at 0x27 gets only the row of solid boxes the controller shows before anything sets it up.

The parts bin also has the plain LCD1602 on six pins with the LiquidCrystal library, the 20x4 LCD2004 with and without a backpack, and graphic displays (the SSD1306 and SH1106 OLEDs, the ST7735, ST7789 and ILI9341 TFTs and the Nokia 5110).

Questions

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

Does it work with the LiquidCrystal_I2C library?

The editor compiles sketches written for the common I2C LCD libraries, and the six-wire LCD1602 runs the standard LiquidCrystal library. The circuit on this page uses Mokxi’s own small driver, so you can read every byte it sends.

What address does the LCD use?

0x27 by default, which is what most PCF8574 backpacks answer to. Change the address in the properties panel to 0x3F for the other common backpack.

Can I simulate a 20x4 LCD?

Yes. The LCD2004 and the LCD2004 with an I2C backpack are both in the parts bin.

Put text on an LCD

Open the circuit, change the message and press Run. Nothing to install, and no account needed.