Arduino Nano 16×2 LCD Mini Operating System

by devkrishnavhora in Circuits > Arduino

43 Views, 0 Favorites, 0 Comments

Arduino Nano 16×2 LCD Mini Operating System

Objective

The objective of this project is to create a simple user interface (UI) using an Arduino Nano and a 16×2 LCD.

The system allows the user to navigate through different menus using only two push buttons.

The project demonstrates how an Arduino can be used to create a menu-based interface similar to a small operating system.

Supplies

Arduino Nano

16×2 LCD Display

2 Push Buttons

Deshbot Shield

Downloads

Pin Connections


16×2 LCD

LCD PinArduino Nano

RS - A4

EN - A3

D4 - A2

D5 - A1

D6 - A0

D7 - D13

Push Buttons

ButtonArduino Nano

Button 1 - D10

Button 2 - D12

Both buttons are connected between the Arduino pin and GND.

The program uses the Arduino's internal pull-up resistors, so external resistors are not required.

Working Principle


When the Arduino Nano starts, the LCD displays a boot screen.

Example:

DESHBOT OS
Starting...

After loading:

DESHBOT OS
READY!

The home screen then appears:

DESHBOT OS
D12 = START

Pressing D12 opens the main menu.

MAIN MENU
> Games

Pressing D10 moves through the available options:

MAIN MENU
> Stopwatch

and:

MAIN MENU
> About

Pressing D12 opens the selected option.


Main Menu

The Mini OS contains three main options:

MAIN MENU

> Games
Stopwatch
About

Games

The Games menu contains:

GAMES

> Reaction
Guess Number

Stopwatch

The stopwatch displays elapsed time.

Example:

STOPWATCH
00:25

About

The About page displays information about the project.

DESHBOT OS
NANO 16x2


Reaction Game

The Reaction Game measures how quickly the user responds.

First:

REACTION GAME
D12 = START

After pressing D12:

WAIT...
READY?

After a random delay:

GO!!!

The user must press D12 as quickly as possible.

The Arduino calculates the reaction time using the millis() function.

Example:

TIME:
342 ms

This means the user's reaction time was approximately 342 milliseconds.


Guess Number Game

The Arduino generates a random number between 1 and 10.

The LCD displays:

GUESS 1 - 10
NUMBER: 5

Pressing D10 changes the selected number.

Pressing D12 submits the guess.

If the guess is smaller than the secret number:

TOO LOW!
TRY AGAIN

If the guess is larger:

TOO HIGH!
TRY AGAIN

If the number is correct:

CORRECT!
YOU WIN!

The Arduino then generates a new random number.


Stopwatch

The stopwatch uses the Arduino's millis() function to measure time.

Example:

STOPWATCH
01:25

Controls

D12:

Start / Stop

D10:

Reset

The stopwatch can measure time without using an external RTC module.


Software Used

The project is programmed using:

Arduino IDE

Programming language:

C++ / Arduino C++

The main library used is:

#include <LiquidCrystal.h>

This library controls the 16×2 LCD in 4-bit mode.

Downloads

. Conclusion


The Arduino Nano 16×2 LCD Mini OS is a menu-based user interface project designed using an Arduino Nano and a 16×2 LCD.

With only two buttons, the user can navigate through menus, play games, use a stopwatch, and view system information.

The project demonstrates how state-based programming and LCD interfaces can be combined to create a simple embedded-system user interface.

It can also serve as a foundation for developing more advanced embedded systems and interactive electronics projects.