Sunday, February 24, 2019

Arduino Display

Arduino LCD Display

Arduino lcd display

In this Project, we will learn how to use the 16x2 LCD Display with Arduino. The Liquide Crystal Display (LCD) is the electronic device that is used to displaying characters. This 16x2 LCD Display is the most commonly used module in a wide range of applications. These modules are recommended over the Seven Segment displays because it is easily programmable, and there are no limitations to print symbols or special characters, where seven segment does not do this, Animations are also performed in this LCD.

This LCD displays 16 characters in each line and there are 2 such lines present. That why it is known as the 16x2 LCD Display. And in this display, each character is displayed in a 5x7 pixel matrix.

It has two Resisters Command and Data, Command resister is used to storing the command instructions given to the LCD. Command instruction are perform following commands like clear screen, point the cursor position and so no. And Data resister is used to storing the data that is shown on the display.

Pin Description:-

There are 16 interface pins in the LCD module 

VSS or Ground pin to provide ground to the module.
VDD/VCC pin is for positive power supply.
V0 pin is to control display contrast through a Potentiometer.
RS (Resister Select)pin is to select either Command resister or Data resister.
RW(Read/Write)pin is to Read the resister or to Write the resister.
E (Enable)pin is to enabled writing to the resister.
D0-D7 pins are the 8bits digital pins.
Backlight Anode pin (i.e +5V).
Backlight Cathode pin (i.e negative supply).

Hardware Component Used:-

  1. Arduini IDE

Circuit:-Arduino lcd display

Circuit Description:-

Befor doing the connections you should solder the 16 pin header strip to you LCD screen connector for better results.

  • Arduino digital pin 12 to LCD pin RS
  • Arduino digital pin 11 to LCD pin Enable
  • Arduino digital pin 5 to LCD pin D4
  • Arduino digital pin 4 to LCD pin D5
  • Arduino digital pin 3 to LCD pin D6
  • Arduino digital pin 2 to LCD pin D7
  • Arduino +5v pin to LCDs Anode pin through 220 ohms resistor 
  • Arduino GND pin to LCDs Cathode pin.
  • Arduino GND pin to 1st pin of 10k Pot
  • LCD V0 pin to middle pin of 10k pot
  • Last pin of 10k pot to +5v.

Schematics:-

Arduino lcd display

Code:-


Code Description:-

First, we have to define the LCD pins that are connected with the Arduino here we write const int that constant integer.
               const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

Next is #include <LiquidCrystal.h> this is the library for controlling the LCD you must have to include this in your code. Liquid Crystal Library.
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);  to define the LCD pins that are used in the code to print the Text.
In void setup lcd.begin(16, 2); is to setup the numbers of rows and columns of LCD.
lcd.print("YOUR TEXT HERE"); is to print the text on the LCD.
In void loop we write lcd.setCursor(0, 1); to set the cursor in the 2nd line of the LCD here note that line 1 is the 2nd row since counting begins with 0, so write 0. Now we shift into the 2nd line of LCD  lcd.print("YOUR TEXT HERE");  is to print the text in the 2nd line.
Read more ...

Wednesday, February 13, 2019

Adruino Button

Arduino Button With LED

Hey, Guys...

Our this Project is about Push Button, yes today we will learning how to control an LED with a PushButton using Arduino. Now, what is PushButton? A PushButton is a device or a simple Switch mechanism to control such aspects or Process. A PushButton is a device that connects 2 points of a circuit whenever it gets pressed. Here we are using this PushButton to turn ON and OFF the LED. Like when we Press the Button our LED is turns ON, and when leaving the Button LED again back to OFF state(or turn OFF).

For detailed information of PushButton visit    https://en.wikipedia.org/wiki/Push_switch 


Components Used:-

Software Used:-

Circuit:-

control led with pushbutton using arduino

Steps:-

Step 1:- First of all, take the pushbutton and plug it at the centre of the Breadboard as shown in the circuit diagram above.
Note that in the 4 pin push button each two terminals are connected internally so whenever you conect the button just check out the pin configuration that which two pins are connected internally (use Multimeter for better result).
Step 2:- Now connect one pin of the button with the 5v VCC supply of Arduino.

Step 3:- Then connects another pin of the button with GND though 1k ohm resistor. The same pin of the button is connected with the signal pin of Arduino i.,e  pin 4 of Arduino.

Step 4:- Now plug the LED on to the breadboard and connects the short leg (Cathode) of the LED with GND of Arduino.

Step 5.:- And connects another leg (Anode) of LED with Pin No. 12 of Arduino.

Step 6:- Now connect the Arduino board with the PC by using a USB cable and check for the Board type (Tools > Board > Arduino Uno). And also check for the Serial Port (Tools > SerialPort > COM).

Step 7:- Upload the Program.

Whenever the button is pushed(Pressed) the LED is Turn ON and when the button is un-pushed(not Pressed) the LEdis turn OFF.

The circuit is Ready...


Schematics:- 

control led with pushbutton using Arduino


Code:-

Code Desciption:-

Here first we declare the value of Push Butoon that is 0, int ButtonValue=0;  and define the integer int LED=12; that means the LED pin is connected to pin no 12 of arduino. And int BUTTON=4; that means Button pin is connected with the pin no 4 of arduino.
void setup
in the void setup we declare the pinMode to provide the output to the LED we can write pinMode(LED,OUTPUT); and input to the Button we acn write pinMode(BUTTON,INPUT);
void loop
In the void loop we write ButtonValue = digitalRead(BUTTON); that means when the Button is pushed it would Read the digital value i.e., either 0 or 1.
Here we use the if - else condition that means if the button is pressed so the LED should ON and else it should be OFF we write the same statement in the form of code like if (ButtonValue == HIGH) (here == means Equals tothen  digitalWrite(LED, HIGH);  else digitalWrite(LED, LOW); 
For more detail of if - else condition:-  https://www.arduino.cc/reference/en/language/structure/control-structure/else/



Read more ...

Wednesday, February 6, 2019

Knight Rider LED

Knight Rider LED


The Knight Rider is a basic Arduino project. What is Knight Rider LED Project? This project is just like our previous LED Chaser project in that project the LEDs were Frequently ON and OFF to show the Chaser effect but in this one the LEDs will be Frequently ON and OFF in such a way that it looks like a single LED is moving one end to another end and this phenomenon is called as LED Knight Rider.  




Hey Guys...
This is our 2nd basic Arduino Project with LEDs, today we will make a Knight Rider. In this Project, I will be using 10 LEDs but in your, you can increase or Decrease the number of LEDs as per our demand.

Component Used:-

Software Used:-

Note:- Here I am using 220 ohms Resister you can also use 200 ohms it will work as well, and you should have use the resisters when connecting LEDs with Arduino, because without Resisters your LEDs and Arduino might be Damaged so keep it in your mind.     

Steps:-

Step 1:- Take LEDs and plugged all LEDs into the Breadboard in Series.

Step 2:- Now connect all short legs (-ve) in the Negative Bar of Breadboard, and connect it with GND pin of Arduino. 

Step 3:- Then connect all the positive legs of the LEDs with Arduino as per the pin Nos that mentioned in the Program with the help of Jumper wires.

Step 4:-  Now in the Arduino IDE:- connect the Arduino Board with the PC using a USB cable and check for the Board (Tools > Boards > Arduino Uno). Also, check for the COM port (Tools > Serial port > COM).

Step 5:-  And upload the Program. whenever you are uploading the Program just unplug the Negative jumper from the Arduino.

Your Knight Rider is ready, you can adjust the speed of the Rider by just changing the delay_time vale at the beginning of the Program.


Enjoy.......

knight rider

Schematics.

knight rider using arduino

code.




Code Description:-



Here the first step is to Define the integer or int in this code we will define or declare ledPins 1 to 10 to Arduino pins 4 to 13.



void set
In the void set, we declare the pinMode like which pin acts as an INPUT and which is act as an OUTPUT here we can write pinMode(ledPin, OUTPUT); because we need this pin as an OUTPUT to show the output.



void loop
The void loop is used to run the program in a loop or it repeats itself mood. Here we write digitalWrite(ledPin,HIGH); to give the digital input as HIGH (i.e.,1) to turn ON the LED
and write digitalWrite(ledPin, LOW);  to give digital input as LOW (i.e.,0) to turn OFF the LED. The
delay is used to give pause in between LED ON and OFF in this code we use delay timeof 50 milli sec.





Read more ...

Monday, February 4, 2019

LED Chaser Using Arduino

LED Chaser

Hello guys...
This is our first Project With Arduino. Today we are making LED Chaser using simple steps. But first, we have to know what is LED Chaser? LED Chaser is a phenomenon in which many LEDs (Light Emitting Diodes) or electric blues are connected in a series or in a string and they are Frequently ON and OFF to give or show the illusion that is moving in the direction. The direction of moving of LEDs purely depends upon you like in which direction you want to move the LEDs it is done by just doing some change in the Program. The best example of LED Chaser is normally seen in the shops in which they are set those types of LED Chaser to Attracts the customers or to showing there shop's Name.   

You can use this LED Chaser Project for your Home Decoration.







Hardware Components Used

  1. Arduino Uno R3                            
  2. 5mm LEDs
  3. Full-Size Breadboard                     
  4. Male to Male Jumper Wires 
  5. 220-ohm resistor            

Software Used

Steps.

  1. Take LEDs and plugged all LEDs on to the Breadboard in series.
  2. Now give the common GND supply to all the short leg(-ve) of the LEDs in Breadboard.
  3. Then connect the positive leg of all the LEDs with Arduino board as per pin No's. that mentioned in the Program with the help of Jumper wires.
  4. Now, in Arduino IDE software connect the Arduino board with PC using a USB cable.
  5. Check for the Board (Tools>Board>Arduino Uno).
  6. Check for the COM port (Tools>Serial port>COM).
  7. And upload the Program.

Your LED Chaser is Ready...

And you can also Modify your Chaser by just changing the program.

Enjoy...

Schematics.

led chaser


Code.




Code Discription:-



Here, the very first thing to do while writing your program you have to define the Integer 'int' in this we have to declare the PINs like here we declare pin 13 to pin 4 for LED 1 to LED 10.



void setup
In void setup, we have to declare the pinMode like which pin acts as an INPUT or which pin acts as an OUTPUT like in this code we need output though the LEDs so we write (LED, OUTPUT) that means the pin by which the LED is connected acts as an OUTPUT pin.



void loop
The void loop is basically used to run the program in a loop that means it repeats itself. Here we write digitalWrite(LED1, HIGH); to give the high signal (i.e., 1) to turn ON the LED.
And we use delay(100); to wait for 1 milli sec and then write digitalWrite(LED, LOW); to give the LOW signal (i.e., 0) to turn OFF the LED and again delay for 1 milli sec.


Note that it is Case-sensitive so you should write each and every thing same as shown.
Read more ...

Saturday, December 29, 2018

What Is Arduino Board?

What Is Arduino Board?



The UNO is the best board, to begin with, gadgets and coding. On the off chance that this is your first experience tinkering with the stage, the UNO is the most powerful board you can begin playing with. The UNO is the most utilized and reported a leading group of the entire Arduino family. 


What is arduino


Arduino is the open source platform that helps students to develop there own codes and projects. An Arduino Uno is a microcontroller board dependent on the ATmega328P IC(datasheet). It has 14 advanced in/out pins (of which 6 can be utilized as PWM pins i.e., Pulse Width Modulation, 6 simple sources of input, a 16 MHz quartz Xtal, a USB connector, a 5Volt power supply connector, an ICSP header and a reset push button. It contains everything expected to help the Microcontroller; essentially associate it to a PC with a USB lead or power it with an AC-to-DC connector or battery to begin. You can deal with your UNO without any worrying a lot about accomplishing something incorrectly if you are done anything wrong yan can easily replace the Atmega328p IC that is not costly (under 200/-) and begin your work again.

Arduino IDE software. 

Arduino is a Micro-controller that performs operations with the program. The program is basically a code that is written in JavaPython language. The program is written in the software which is known as Arduino IDE. After compiling the program is burn in the Board by USB cable.


what is arduino board


Description Of The IDE Screen:-

File 

-  New 
   To create the New sketch (or it opens the new Tab ).
-  Open
   To load the sketches browsing through the drives and folders from your PC.
-  Open Recent 
   To opens the sketch that is recently opened.
-  Sketchbook
   It shows the current sketchbook folder in which all the sketches are saved.
-  Examples
   All the examples are shows here that are provided by the Arduino IDE for easy access. All examples are set in a pleasant way that will help you a lot. 
-  Close
   It closes the tab of the software from which it is clicked.
-  Save
   To save the sketch with the name that you have given to the sketch.
-  Save as...
   To save the sketch again with another name.
-  Page setup
   This shows the page setup tab for printing.
-  Print
   To print the sketch you make.
-  Preference
   It shows the additional settings to change the language and other settings.
-  Quit
   It closes all the IDE tabs. And the sketch that had opened previously when quit, is automatically opened when you start the IDE next time.

Edit
-  Undo/Redo
   It helps to go backwards when you are editing your sketch, and you may go forward with Redo.
-  Cut
   It cuts (or removes) the text and copyed it into the clipboard so you may copy it elsewhere.
-  Copy
   It copes the text to make the duplicate of it.
-  Copy for Forum
   Its copies the sketch code to the clipboard to posting the code into the forum with all syntax and colours.
-  Copy as HTML
   It copies the code as an HTML code that is best suitable to upload the code into the web page.
-  Paste
   To paste the code (or text) from the clipboard to where you point the cursor position in the Editor.
-  Select All
   It selects all the text and Highlights it in the Editor.
-  Comment/Uncomment
   It puts the // comment or removes the // comment in every selected line in the editor.
-  Increase/Decrease Indent
   To adds or subtracts the space in the beginning of every selected line,
-  Find
   It opens the tab for Finding in the Text.
-  Find Next
   It is used to highlights the upcoming Occurrence of the specified search item in the find tab, With respect to the position of the cursor.
-  Find Previous
  It is used to highlights the previous occurrence of the specified search item in the find tab. With respect to the position of the cursor.

Sketch
-  Verify/Compile 
   It is to verify or checks the code before uploading into the board, that is everything is correct or not.
   If it's not then it shows the error.
-  Upload
   It verifies the code and uploads the sketch into the board through the selected PORT.
-  Upload Using Programmer
   It will overwrite the bootloader program into the board, (Tools > Burn Bootloader )
-  Export Compiled Binary
   It saves the .hex file that can be sent or archive into the board.
-  Show Sketch Folder
   It opens the current Folder where the sketches are saved.
-  Include Library 
   It for including a library to the sketch by just typing the #include statement in the starting of the code. and for adding external library you need to go to the menu and library manager and import library from .zip.
-  Add Files 
  Its used to Add the source file to the sketch.

Tools
-  Auto Formate
    It formats your code.
-  Serial Monitor
   It opens the serial monitor in the new tab. and shows the data when connected to the board with the com port.
-  Board
   It shows the different types of boards and you have to select the one on which you have to work on.
-  Port
   It shows all the com ports that are available in the machine, And it will automatically choose the appropriate COM for you and if not you have to select the COM port.
-  Programmer 
   It shows the different hardware for the programmer when programming a board, Normally you don't have to select it but if you are burning the bootload into the new microcontroller then you have to select it.
-  Burn Bootloader
   It is used to burn the bootloader into the new microcontroller chip or IC. Normally you do not have to burn the bootloader into the Arduino and Genuino board but if you purchase a new ATmega IC then you have to do this.

Read more ...