## Large Size Bar-Graph Voltage Monitor Using Arduino Mega and 20 Segment 3W White LED

Simple 20 LED  Bar-Graph Voltmeter , each LED display 0.25V, this circuit can measure 5V directly or its can measure higher voltage range using resistor divider.

Example circuit for resistor divider. If choose Z1=10K and Z2-10K it can measure 0-10V.

Turns on a series of LEDs based on the value of an analog voltage input.  This is a simple way to make a bar graph display. Though this graph uses 20 LEDs, you can use any number by changing the LED count and the pins in the array. This method can be used to control any series of digital outputs that depends on an analog input.

The bar graph – a series of LEDs in a line, such as you see on an audio display – is a common hardware display for analog sensors. It’s made up of a series of LEDs in a row, an analog input like a Potentiometer, and a little code in between. You can buy multi-LED bar graph displays fairly cheaply, like this one. This tutorial demonstrates how to control a series of LEDs in a row, but can be applied to any series of digital outputs.

Watch Video Of This Project

Arduino Code

/*
* 20 LED Bargraph Meter , code, schematic, PCB layout
available at our website www.twovolt.com

*/

// these constants won’t change:
const int analogPin = A0; // the pin that the potentiometer is attached to
const int ledCount = 20; // the number of LEDs in the bar graph

int ledPins[] = {
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41
}; // an array of pin numbers to which LEDs are attached

void setup() {
// loop over the pin array and set them all to output:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}

void loop() {
// map the result to a range from 0 to the number of LEDs:
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

// loop over the LED array:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
// if the array element’s index is less than ledLevel,
// turn the pin for this element on:
if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}
// turn off all pins higher than the ledLevel:
else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}

## Dark Sensitive Interactive Light Using 20 Segment Bar-Graph and Arduino

The Project is based on 20 Segment Bar Graph (2X10 LED PCB), Arduino Mega and LDR, The project converts darkness in to number of LEDs, number of LEDs will glow proportional to darkness falls on LDR. Circuit works with 12V DC and draw 4 Amps while all LEDs are ON. Digital pin D22 to D41 of Arduino used to driver LEDs.

Watch Video Of This Project

Arduino Code

/*
* Dark Sensitive interactive LED Light , The project consist 20 segment Bar-graph white LEDs ,
* Driver transistors for LEDs, LDR, Pull Resistor for LDR and arduino mega
* Code writen for arduino mega, Arduino code, schematic, PCB layout
available at our website www.twovolt.com, This also can be used as dark senst

*/

// these constants won’t change:
const int analogPin = A0; // the pin that the potentiometer is attached to
const int ledCount = 20; // the number of LEDs in the bar graph

int ledPins[] = {
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41
}; // an array of pin numbers to which LEDs are attached

void setup() {
// loop over the pin array and set them all to output:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}

void loop() {
// map the result to a range from 0 to the number of LEDs:
int ledLevel = map(sensorReading, 350, 950, 0, ledCount);

// loop over the LED array:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
// if the array element’s index is less than ledLevel,
// turn the pin for this element on:
if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}
// turn off all pins higher than the ledLevel:
else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}

## 20 LED Bar-Graph Voltmeter Using Arduino Mega

Simple 20 LED Segment Bar-Graph Voltmeter , each LED display 0.25V, this circuit can measure 5V directly or it can measure higher voltage  using resistor divider.

Turns on a series of blue LEDs based on the value of an analog voltage input.  This is a simple way to make a bar graph display. Though this graph uses 20 LEDs, you can use any number by changing the LED count and the pins in the array. This method can be used to control any series of digital outputs that depends on an analog input.

Potentiometer is connected to Analog pin A0 of Arduino Mega, VCC and GND

LED Connected to digital pin of Arduino Mega  D22, D23, D24, D25, D26, D27, D28, D29, D30, D31, D32, D33, D34, D35, D36, D37, D38, D39, D40, D41

Note : Circuit can measure 5V DC  voltage,  High voltage can be measure using resistor divider.

The bar graph – a series of LEDs in a line, such as you see on an audio display – is a common hardware display for analog sensors. It’s made up of a series of LEDs in a row, an analog input like a Potentiometer, and a little code in between. You can buy multi-LED bar graph displays fairly cheaply, like this one. This tutorial demonstrates how to control a series of LEDs in a row, but can be applied to any series of digital outputs.

Watch Video Of This Project

Arduino Code

/*
* 20 LED Bargraph Meter , Code writen for arduino mega, project consist
20 blue LED, ULN2003 X 3 as LED driver, code, schematic, PCB layout
available at our website www.twovolt.com

*/

// these constants won’t change:
const int analogPin = A0; // the pin that the potentiometer is attached to
const int ledCount = 20; // the number of LEDs in the bar graph

int ledPins[] = {
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41
}; // an array of pin numbers to which LEDs are attached

void setup() {
// loop over the pin array and set them all to output:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}

void loop() {
// map the result to a range from 0 to the number of LEDs:
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

// loop over the LED array:
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
// if the array element’s index is less than ledLevel,
// turn the pin for this element on:
if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}
// turn off all pins higher than the ledLevel:
else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}

## 10X3W White LED Knight Rider Effect ( Arduino Uno)

Simple Project provide knight rider effect with help of 10X3W white LEDs and Arduino Uno, LED connected to D2 to D11 pins of Arduino.

Arduino Pins Vs LED

• D2>>LED1
• D3>>LED2
• D4>>LED3
• D5>>LED4
• D6>>LED5
• D7>>LED6
• D8>>LED7
• D9>>LED8
• D10>>LED9
• D11>>LED10

Arduino Code

/*
Simple code generate knight rider effect using 10 white LEDs,
Code presented  here is a modification of original code from electroschematics Author P-Marian

*/
int del=50; // sets a default delay time
void setup() {
// initialize the digital pins as outputs:
for (int i = 2; i<=11 ; i++) {
pinMode(i, OUTPUT);
} // end of for loop
} // end of setup

void loop() {
for (int i = 2; i<=11; i++) { // blink from LEDs 2 to 11
digitalWrite(i, HIGH);
delay(del);
digitalWrite(i, LOW);
}
for (int i = 11; i>=3; i–) { // blink from LEDs 11 to 3
digitalWrite(i, HIGH);
delay(del);
digitalWrite(i, LOW);
}
}

## Arduino Based DC Motor Speed Controller with 16X2 LCD

The DC motor controller has been designed using Multi-purpose LCD Arduino Nano shield, circuit, PCB layout  and Arduino code available at our website www.twovolt.com , it can control DC motor 7-12V DC , it can drive motor upto 5Amps. Speed of motor can be set using trimmer potentiometer, 16X2 LCD display the Bar-Graph of speed of motor. Potentiometer is connected to Analog Pin A0 and Digital pin 9 which provides PWM output, this PWM signal goes to gate of MOSFET.

Compact multipurpose Arduino Nano 16X2 LCD shield can be used to develop various projects, shield provided with various things, LM 35 Temperature sensor, 3X Tactile Switch, Vertical trimmer Potentiometer, 12V Relay with NO/NC output, power Mosfet, AC714 current sensor and 16X2 LCD.

Arduino/LCD Pins

• LCD RS pin to digital pin 12
• LCD Enable pin to digital pin 11
• LCD D4 pin to digital pin 5
• LCD D5 pin to digital pin 4
• LCD D6 pin to digital pin 3
• LCD D7 pin to digital pin 2
• LCD R/W pin to ground

Arduino Pins Various Devices

• Switch 1 Arduino Pin A3
• Switch 2 Arduino Pin D6
• Switch 3 Arduino Pin D7
• Current Sensor ACS714 Arduino Pin A5
• Trimmer Potentiometer Arduino Pin A0
• LM35 Sensor Arduino Pin A4
• Power Mosfet Arduino Pin D9
• Relay Arduino Pin D8

Arduino Code

/*
Motor Speed Controller with 16X2 LCD Bar-Graph Display, Circuit, PCB Layout ,
and code available at our website www.twovolt.com, Its Modified code,
original author of the code is Rui Santos, http://randomnerdtutorials.com/

*/

// include the library code
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int potPin = A0; // Potentiometer
int motorPin = 9; // Driver FET PWM
int potValue = 0; // Pot Value
int motorspeed = 0; // Pot Value to PWM
int pBari = 0; // Bar-Graph
int i = 0; // foor loop

//progress bar character
byte pBar[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

void setup() {
// setup our led as an OUTPUT
pinMode(motorPin, OUTPUT);
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD
lcd.print(” MOTOR SPEED”);
//Create the progress bar character
lcd.createChar(0, pBar);
}

void loop() {
// clears the LCD screen
lcd.clear();
// Print a message to the LCD
lcd.print(” MOTOR SPEED”);
//set the cursor to line number 2
lcd.setCursor(0,1);
// read the value from the potentiometer
// turns the potValue into a Speed Of the Motor
motorspeed=map(potValue, 0, 1024, 0, 255);
//Speed up the motor
analogWrite(motorPin, motorspeed);
// turns the brighness into a percentage for the bar
pBari=map(motorspeed, 0, 255, 0, 17);
//prints the progress bar
for (i=0; i<pBari; i++)
{
lcd.setCursor(i, 1);
lcd.write(byte(0));
}
// delays 350 ms
delay(350);
}

## LED Dimmer Using Arduino 16X2 LCD and Potentiometer

Another  project LED Dimmer using multi LCD Arduino Nano shield, vertical trimmer potentiometer can used to adjust the LED brightness, LCD shows the bar-graph reading of LED dimmer.  MOSFET helps to drive LED up to 5A constant. Circuit works with 12V DC. Project has many parts , unused parts can be used omit if not required.

Arduino Pins

• LCD RS pin to digital pin 12
• LCD Enable pin to digital pin 11
• LCD D4 pin to digital pin 5
• LCD D5 pin to digital pin 4
• LCD D6 pin to digital pin 3
• LCD D7 pin to digital pin 2
• LCD R/W pin to ground
• Arduino Analog Pin A0 Potentiometer
• Arduino Digital PWM D9 LED Driver

Arduino Code

/*
LED Dimmer with 16X2 LCD Bar-Graph Display, Circuit, PCB Layout ,
and code available at our website www.twovolt.com, Modified code,
original author of the code is Rui Santos, http://randomnerdtutorials.com/

*/

// include the library code
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int potPin = A0; // Potentiometer
int ledPin = 9; // Driver FET PWM
int potValue = 0; // Pot Value
int brightness = 0; // Pot Value to PWM
int pBari = 0; // Bar-Graph
int i = 0; // foor loop

//progress bar character for brightness
byte pBar[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

void setup() {
// setup our led as an OUTPUT
pinMode(ledPin, OUTPUT);
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD
lcd.print(” LED Brightness”);
//Create the progress bar character
lcd.createChar(0, pBar);
}

void loop() {
// clears the LCD screen
lcd.clear();
// Print a message to the LCD
lcd.print(” LED Dimmer”);
//set the cursor to line number 2
lcd.setCursor(0,1);
// read the value from the potentiometer
// turns the potValue into a brightness for the LED
brightness=map(potValue, 0, 1024, 0, 255);
//lights up the LED according to the bightness
analogWrite(ledPin, brightness);
// turns the brighness into a percentage for the bar
pBari=map(brightness, 0, 255, 0, 17);
//prints the progress bar
for (i=0; i<pBari; i++)
{
lcd.setCursor(i, 1);
lcd.write(byte(0));
}
// delays 750 ms
delay(750);
}

## ARDUINO AND 16X2 LCD BASED STOP WATCH

Simple 16X2 LCD based stop watch, the project tested on multi LCD shield, circuit includes 3 switches, start, stop and reset, project works with 7-12V DC supply or USB power input, code is written for Arduino Nano.

Arduino Connections

• Switch 1 Arduino Pin A3  RESET SWITCH
• Switch 2 Arduino Pin D6 TIMER START SWITCH
• Switch 3 Arduino Pin D7 TIMER STOP SWITCH

Arduino Pins LCD

• LCD RS pin to digital pin 12
• LCD Enable pin to digital pin 11
• LCD D4 pin to digital pin 5
• LCD D5 pin to digital pin 4
• LCD D6 pin to digital pin 3
• LCD D7 pin to digital pin 2
• LCD R/W pin to ground

Arduino Pins Vs. Various options Multi-Purpose Shield

• Switch 1 Arduino Pin A3  RESET SWITCH
• Switch 2 Arduino Pin D6 TIMER START SWITCH
• Switch 3 Arduino Pin D7 TIMER STOP SWITCH
• Current Sensor ACS714 Arduino Pin A5
• Trimmer Potentiometer Arduino Pin A0
• LM35 Sensor Arduino Pin A4
• Power Mosfet Arduino Pin D9
• Relay Arduino Pin D8

ARDUINO CODE

/*Simple LCD stopwatch program with Start, Stop, Reset Switches.
Schematic and PCB layout available at www.twovolt.com Code is modification
of original code from author TechWithZan*/

//including liblary for LCD
#include <LiquidCrystal.h>

//setting up LCD INPUT pins
LiquidCrystal lcd(12,11,5,4,3,2);

//setting hours, minutes, secound and miliseconds to 0
int h=0;
int m=0;
int s=0;
int ms=0;

//defines pin for all buttons
const int start_pin = 6;
const int stop1_pin = 7;
const int reset_pin = 17;

//defines starting points (in my case 0)
int start=0;
int stop1=0;
int reset=0;

void setup()
{

lcd.begin(16 ,2); //starting LCD

//defining pins if they are INPUT or OUTPUT pins
pinMode(start_pin, INPUT);
pinMode(stop1_pin, INPUT);
pinMode(reset_pin, INPUT);
}
void loop()
{
lcd.setCursor(0,1);
lcd.print(“STOP-WATCH”);
lcd.setCursor(0,0);
lcd.print(“TIME:”);
lcd.print(h);
lcd.print(“:”);
lcd.print(m);
lcd.print(“:”);
lcd.print(s);

if(start == HIGH)
{
stopwatch(); //goes to sub program stopwatch
}

}

void stopwatch()
{
lcd.setCursor(0,0); //setting start point on lcd
lcd.print(“TIME:”); //writting TIME
lcd.print(h); //writing hours
lcd.print(“:”);
lcd.print(m); //writing minutes
lcd.print(“:”);
lcd.print(s); //writing seconds
ms=ms+10;
delay(10);

if(ms==590)
{
lcd.clear(); //clears LCD
}

if(ms==590) //if state for counting up seconds
{
ms=0;
s=s+1;
}

if(s==60) //if state for counting up minutes
{
s=0;
m=m+1;
}

if(m==60) //if state for counting up hours
{
m=00;
h=h+01;
}

lcd.setCursor(0,1);
lcd.print(“STOP-WATCH”);

if(stop1 == HIGH) //checking if button is pressed
{
stopwatch_stop(); //going to sub program
}
else
{
stopwatch(); //going to sub program
}
}

void stopwatch_stop()
{
lcd.setCursor(0,0);
lcd.print(“TIME:”);
lcd.print(h);
lcd.print(“:”);
lcd.print(m);
lcd.print(“:”);
lcd.print(s);

lcd.setCursor(0,1);
lcd.print(“STOP-WATCH”);

if(start == HIGH)
{
stopwatch(); //going to sub program
}

if(reset == HIGH)
{
stopwatch_reset(); //going to sub program
loop();
}
if(reset == LOW)
{
stopwatch_stop(); //going to sub program
}
}

void stopwatch_reset()
{
lcd.clear();
lcd.setCursor(0,1);
lcd.print(“STOPWATCH”);
h=00; //seting hours to 0
m=00; //seting minutes to 0
s=00; //seting seconds to 0
return; //exiting the program and returning to the point where entered the program
}

Watch Video Of This Project

## Temperature Controlled Fan ON-OFF Switch Using Arduino Nano 16X2 LCD and LM35 Sensor

Compact Temperature controlled fan on/off switch is based on Arduino Nano multipurpose TWOVOLT shield, the circuit consist LM35 temperature sensor, 16X2 LCD, 12V relay including driver transistor, circuit works with 12V supply and can controlled any fan from 12V to 230V AC, for testing purpose I have connected 12V DC fan. At normally open switch of relay. The shield has many other parts can be omit if not required, refer circuit diagram for more info. Relay can switch load up to 7amps supply 5V to 230V AC.

Arduino Pins LCD

• LCD RS pin to digital pin 12
• LCD Enable pin to digital pin 11
• LCD D4 pin to digital pin 5
• LCD D5 pin to digital pin 4
• LCD D6 pin to digital pin 3
• LCD D7 pin to digital pin 2
• LCD R/W pin to ground

Arduino Pins Various Devices

• Switch 1 Arduino Pin A3
• Switch 2 Arduino Pin D6
• Switch 3 Arduino Pin D7
• Current Sensor ACS714 Arduino Pin A5
• Trimmer Potentiometer Arduino Pin A0
• LM35 Sensor Arduino Pin A4
• Power Mosfet Arduino Pin D9
• Relay Arduino Pin D8

Default temperature trigger point is set to 35C, if you want to change the value , change here

Arduino Code for this project

/*
Tempereture Controlled Fan ON/OFF using arduino tempereture display on 16X2
LCD, Arduino Code, Circuit Diagram, PCB Layout Available at www.twovolt.com.
The project switch on the Fan at max set point
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
int tempPin = A4; // LM35 Temp Sensor Analog Output
int Relay = 8; // Relay Pin
int temp;
int tempMin = 25; //
int tempMax = 35; // Switch On The Relay

void setup() {
pinMode(Relay, OUTPUT);
pinMode(tempPin, INPUT);
lcd.begin(16,2);
}
void loop() {
if(temp < tempMin) { // if temp is lower than Minimum-Temp

}
if(temp > tempMax) { // if temp is higher than Temp-Max
digitalWrite(Relay, HIGH); // Turn on Relay
} else { // else Turn of The Relay
digitalWrite(Relay, LOW);
}
lcd.print(“TEMP: “);
lcd.print(temp); // Display Temp
lcd.print(“C “);
lcd.setCursor(0,1); // move cursor
lcd.print(“FAN:ON/OFF”);
lcd.print(“”);
delay(300);
lcd.clear();
}

int readTemp() { // Temperature and convert it to celsius
return temp * 0.48828125;
}

## LED Sequencer Using 10 White LEDs of Each 3W and Arduino

The 10 LED sequencer circuit published here is based on Arduino Uno and 10 White LED board. The project contains 10 LEDs of each 3W, provides high intensity, can be used in various applications. The board can be connected to Arduino Uno, Arduino Mega, Arduino Nano or Raspberry Pai , each LED can be controlled individually, I have connected LEDs to pin D2-D11 of Arduino. LED board required supply 5V DC, it can work with higher  supply by changing current resistor across LEDs, Large size Bar-graph monitor, led sequencer, strobe, LED light effects are possible applications with this board.

Note : Dont Power Up the LED Board from Arduino, LED board required separate 5V DC 3Amps.

Video Of this Project

Features

• Supply 5V DC
• Maximum Load on each channel 300mA-400mA (Total 3Amps)
• LED 1-10 Connected to D2,D3,D4,D5,D6,D7,D8,D9,D10,D11 of Arduino

The 10X3W White LED board has been designed to create large size barograph meter and light effects generator.  The board contains 3W LEDs, D-Pak transistor as driver and current limiting resistor across each LED. Circuit works with 5V, each LED take approx. 300mA-400mA current, each LED can be controlled individually by applying TTL voltage, header connector provided to interface micro-controller. LED dimmer possible by applying PWM signal to each LED, Easy interface with Arduino.

Arduino Code for LED Sequencer

/* A simple program to sequentially turn on and turn off 10 LEDs
Code tested on 10X3W white LED board works with 5V DC,
all LEDs take approx 2Amp current, PCB Design , Schematic
website www.twovolt.com */

int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int LED6 = 7;
int LED7 = 8;
int LED8 = 9;
int LED9 = 10;
int LED10 = 11;

void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(LED8, OUTPUT);
pinMode(LED9, OUTPUT);
pinMode(LED10, OUTPUT);

}

void loop() {
digitalWrite(LED1, HIGH);
delay(60);
digitalWrite(LED2, HIGH);
delay(60);
digitalWrite(LED3, HIGH);
delay(60);
digitalWrite(LED4, HIGH);
delay(60);
digitalWrite(LED5, HIGH);
delay(60);
digitalWrite(LED6, HIGH);
delay(60);
digitalWrite(LED7, HIGH);
delay(60);
digitalWrite(LED8, HIGH);
delay(60);
digitalWrite(LED9, HIGH);
delay(60);
digitalWrite(LED10, HIGH);
delay(60);
digitalWrite(LED1, LOW);
delay(60);
digitalWrite(LED2, LOW);
delay(60);
digitalWrite(LED3, LOW);
delay(60);
digitalWrite(LED4, LOW);
delay(60);
digitalWrite(LED5, LOW);
delay(60);
digitalWrite(LED6, LOW);
delay(60);
digitalWrite(LED7, LOW);
delay(60);
digitalWrite(LED8, LOW);
delay(60);
digitalWrite(LED9, LOW);
delay(60);
digitalWrite(LED10, LOW);
delay(60);

}

## Multipurpose Compact 16X2 LCD Shield For Arduino Nano

Compact multipurpose Arduino Nano 16X2 LCD shield can be used to develop various projects, shield provided with various things, LM 35 Temperature sensor, 3X Tactile Switch, Vertical Trimmer Potentiometer, 12V Relay with NO/NC output, power MOSFET, AC714 current sensor and 16X2 LCD.

Arduino Pins LCD

• LCD RS pin to digital pin 12
• LCD Enable pin to digital pin 11
• LCD D4 pin to digital pin 5
• LCD D5 pin to digital pin 4
• LCD D6 pin to digital pin 3
• LCD D7 pin to digital pin 2
• LCD R/W pin to ground

Arduino Pins Various Devices

• Switch 1 Arduino Pin A3
• Switch 2 Arduino Pin D6
• Switch 3 Arduino Pin D7
• Current Sensor ACS714 Arduino Pin A5
• Trimmer Potentiometer Arduino Pin A0
• LM35 Sensor Arduino Pin A4
• Power MOSFET Arduino Pin D9
• Relay Arduino Pin D8

Arduino Code for 16X2 LCD

/*
LiquidCrystal Library – display() and noDisplay()

Demonstrates the use a 16×2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints “Hello World!” to the LCD and uses the
display() and noDisplay() functions to turn on and off
the display.

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
modified 7 Nov 2016

This example code is in the public domain.

http://www.twovolt.com

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(“hello, world!”);
}

void loop() {
// Turn off the display:
lcd.noDisplay();
delay(500);
// Turn on the display:
lcd.display();
delay(500);
}

1 2