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.

Download Arduino Code

Download PDF Schematic

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() {
// read the potentiometer:
int sensorReading = analogRead(analogPin);
// 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.

Download Arduino Code

Download PDF Schematic

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() {
// read the potentiometer:
int sensorReading = analogRead(analogPin);
// 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.

Download Arduino Code

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() {
// read the potentiometer:
int sensorReading = analogRead(analogPin);
// 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. 

Download Arduino Code

Arduino Pins Vs LED

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

Watch  Video of This Project Here  

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
potValue = analogRead(potPin);
// 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);
}


Download Arduino Code

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
potValue = analogRead(potPin);
// 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);

start = digitalRead(start_pin); //reading buton state
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”);

stop1 = digitalRead(stop1_pin); //reading buton state
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”);

start = digitalRead(start_pin); //reading buton state
if(start == HIGH)
{
stopwatch(); //going to sub program
}

reset = digitalRead(reset_pin); //reading buton state
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

Download Code

Download PDF Schematic

Motorized Slider for Pro-Camera Using Nema 23 Stepper Motor or Servo Motor

Motorized Camera Slider for Pro Camera Like Red Epic, Alexa, Black Magic, Canon, Nikon, Fuji.

The Slider can handle Payload Up to 20Kg, It  has option for stepper motor or brushed/Brush-Less servo mounting , linear movement can be controlled using Arduino, motion control software, Radio frequency remote, Joystick based wire remote, Futaba RC Remote. Infra Red Remote Controlled, Normal Hand movement possible without motor. 

Application

  • Stop Motion
  • Time Lapes
  • Motion Controlled Shoot
  • Smooth Linear Motion

Note : I will update the pictures of stepper motor, brushed/brush-less servo mount.

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.

Download PDF Schematic

 

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() {
temp = readTemp(); // Temperature
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
temp = analogRead(tempPin);
return temp * 0.48828125;
}

60V to 5V-2Amps USB Power Output DC-DC Converter for E-Vehicle

Tiny 60V to 5V USB power converter is based on TPS54560 IC, the projects provides 5V DC and peak current up to 5Amps, constant current up to 2Amps. It can be used in lots of application where high voltage to 5V DC USB power required, good use in automotive application. It can be used in E-vehicle for smart phone charger,  USB Hub connector mounted on board for easy connection, input has screw terminal.

Download Data Sheet TPS54560

Features

  • Supply input 9V to 60V DC
  • Output 5V DC
  • Load Current 5 Amps Peak and 2Amps Constant
  • Onboard USB Hub Connector
  • Good for E-Vehicle, Carts, Trucks as for USB Charger

Watch Video Of This Project

1 2