Interfacing SPI TFT with Arduino.

By // 20 comments:
Hey fellas!
It's been long since our last blog...but worry not! Here I'm back again with something new to try this time around. This blog will let you know how to interface a 1.8 inches SPI TFT with arduino. The task may get a bit tricky if someone just starts without taking a few things in consideration. So here we go!




Now what's with this "SPI" term? Why not just a TFT?
Well, that's because like you all must have known, there are 2 modes of transferring data, SERIAL & PARALLEL. When there are separate multiple data buses for data transfer, that's a Parallel Data Bus TFT or more generally known as a normal TFT. These types of displays will have a comparatively large no. of pins to connect (quite obvious), as 8 or 16 pins are for data bus alone and then the other ones too.
They generally take up all the space on an UNO or even may require a shield as well.

When there is a single data bus to transfer all the data, all the data is streamlined in a series and then pushed towards the receiving end. This type of TFT is called an SPI TFT, where SPI stands for SERIAL PERIPHERAL INTERFACE. Now we know what that un-abbreviated form says!

Also remember that this 1.8 inches SPI TFT has different pin connections on an UNO (or similar) board and the MEGA board. On MEGA, the SPI pins lie at 50,51,52 and 53. 

First of all, list of required items is as follows:
* Arduino UNO (or similar) x 1
* 1k ohm resistances x 5
* One-2-One connectors x 8

The TFT library comes pre-installed in Arduino version 1.0.5 and later.

Make the connections as mentioned below-

Reset
8
Dc (A0)
9
Cs
10
SDA
11 (UNO) or 51 (MEGA)
SCL
13 (UNO) or 52 (MEGA)
BKL
3.3v
Vcc
5v
Gnd
Gnd


Now instead of making the first 5 connections directly to Arduino, put a resistor of 1k or similar value between the TFT pin and the Arduino pin. That’s because the IO ports are 3.3v tolerant while the Vcc required is 5v. It is quite possible because of it’s non-standard chinese manufacturing.

Now, open the IDE and run the any sketch except the “BitmapLogo”. This sketch uses the SD card function and requires you to hook up the TFT with an SD card as well, which is definitely not a part of this article.

I’m putting a demo sketch that I ran successfully-

#include <TFT.h>  // Arduino LCD library
#include <SPI.h>

// pin definition for the Uno
#define cs   10
#define dc   9
#define rst  8

// pin definition for the Leonardo
// #define cs   7
// #define dc   0
// #define rst  1

// create an instance of the library
TFT TFTscreen = TFT(cs, dc, rst);

// char array to print to the screen
char sensorPrintout[4];

void setup() {

  // Put this line at the beginning of every sketch that uses the GLCD:
  TFTscreen.begin();

  // clear the screen with a black background
  TFTscreen.background(0, 0, 0);

  // write the static text to the screen
  // set the font color to white
  TFTscreen.stroke(255, 255, 255);
  // set the font size
  TFTscreen.setTextSize(2);
  // write the text to the top left corner of the screen
  TFTscreen.stroke(255, 0, 0);
  TFTscreen.text("IoT Freaks!\n ", 20, 0);
  TFTscreen.stroke(0, 255, 255);
  TFTscreen.text("Sensor value\n ", 12, 25);
  // ste the font size very large for the loop
  
}

void loop() {

  // Read the value of the sensor on A0
  String sensorVal = String(analogRead(A0));

  // convert the reading to a char array
  sensorVal.toCharArray(sensorPrintout, 4);

  TFTscreen.stroke(255, 255, 0);
  TFTscreen.setTextSize(5);
  TFTscreen.text(sensorPrintout, 34, 50);
  delay(550);
  TFTscreen.stroke(0, 0, 0);
  TFTscreen.text(sensorPrintout, 34, 50);
}

This sketch requires a sensor at pin A0 to read it's value and then display it as text on  the TFT. So put any analog value sensor such as a potentiometer, an LDR, an IR pair or whatever you have.





Viola! I’m pretty much sure you’ll have it done then……

Be sure to buy the stuff mentioned in this blog by clicking on the link below-
http://www.ebay.in/usr/4d_innovations?_trksid=p2053788.m1543.l2754

The vendor's offering interesting and working hardware at quite handy rates. Go give it a try! :)

So until my next blog, this is it. As always, any problem you face and wish to discuss it, the comment boxes are always down there and you can reach me as well at iotfreaks@gmail.com

For more of these interesting stuff, like my page-
https://www.facebook.com/iotfreaks/

And our community,
https://www.facebook.com/projectsdunia/

How To Interface PIR Sensor With Arduino

By // 15 comments:
Hello Arduinians... Ever thought of detecting motion via your Arduino.... if yes, then this one's for you. In this tutorial, We're interfacing PIR sensor today with Arduino. Let's gets started!

Block Diagram
Working of PIR Motion Sensor
Block Diagram
Components Required For This Tutorials
  1. 1 * Arduino Board
  2. 1 * PIR Motion Sensor(you can buy from here)  
  3. Breadboard
  4. Jumper wires
  5. Battery

What is PIR motion sensor & how it works?

Basically, a PIR stands for "Passive Infrared Sensor". The sensor works on the principle of infrared waves' detection those are being emitted by human bodies. They are undetectable to us but can be discovered by the devices designed for such special purposes. I'm going to go just a little deep, enough to make you understand the internal operation.
When a body moves in front of a PIR sensor, the temperature of that place changes where the body has moved. If the body makes a further movement, the composition of infrared waves being received by the PIR from that region changes and since the reading is not the same as last reading, it generates a signal for the microcontroller and we work on it accordingly.


Circuit Diagram
We can easily interface PIR motion sensor with Arduino-like our other sensor. But it all depends on our logic of the code, how efficiently do we want to detect motion through it.
A PIR has 3 pins, just like any other sensor, Vcc, Signal & Ground pin. A very simple circuit of interfacing PIR motion sensor with Arduino is shown below
circuit diagram of PIR Motion Sensor
Circuit 
PIR Motion Sensor description
                                                                                          PIR Motion Sensor                                          
The 2 knobs are there too. One for adjusting sensitivity by increasing or decreasing the range of motion detection and another one for response delay. If you're using PIR in your home security, I strongly suggest you set the range at maximum (towards right). However, the detection range offered by a PIR sensor is good enough, like about 6 metres as I've tested it successfully.

Source Code
Here is a very simple code for this tutorial which only detects if there is ANY motion and triggers an LED for confirmation.Write below code into Arduino IDE and compile it.

int pirSensor=5;                                                     // connect sensor at pin 5
int led=13;                                                             // connect led at pin 13
void setup() 
{
   Serial.begin(9600);                                             // initialize serial
   pinMode(led, OUTPUT);                                  //  initialize led as output
   pinMode(pirSensor, INPUT);                            //  initialize sensor as input  
}

void loop() 
{
  int sensorValue = digitalRead(sensor);                // read sensor value
  Serial.println(sensorValue);                                 // print sensor value  
  delay(100);                                                          //  delay 100 miliseconds
  if(sensorValue > 600)
  { digitalWrite(led,HIGH); }
}

Now you can connect the signal pin to any analog pin also but for that, you'll have to check what values do you get on the serial monitor and which value do you wish to use as a threshold for triggering any LED, buzzer, etc.
Note that the sensor first takes some time for its calibration and after that it starts detecting motion. If any motion is detected, it triggers the LED on Arduino board and keeps searching for the motion for a certain amount of time. It only settles low if there is no further motion detected for that given search period (which can be changed in code). Giving a search window to your sensor, makes it's working more efficient and there are better chances for you to get non-erroneous functioning.
I too did both codes and both worked fine for me. Here's a snap!
PIR motion sensor circuit
Demo
So that's an end to our tutorial  for this time. Hope you enjoyed reading. If you liked this tutorial then don't forget it to share with your friends. I'll be back with more..... till then #happyDIYing

If you have any question or query or feedback regarding this tutorial then leave a comment below and we will solve those as soon as possible.

Be sure to buy the stuff mentioned in this blog by clicking on the link below-
http://www.ebay.in/usr/4d_innovations?_trksid=p2053788.m1543.l2754

The vendor's offering interesting and working hardware at quite handy rates. Go give it a try! :)

Learn How To Make A Digital Voltmeter Using Arduino

By // 13 comments:
Arduino is very popular and easy to use. With Arduino, we can do lot's of projects and experiment. So today we add one more projects in our Arduino project list. In this article, we are going to make a digital voltmeter.using an Arduino board. In this project, we measure the input voltage range between 0 to 50V by using the voltage divider. It is very simple to use Arduino as a voltmeter. Arduino UNO has  5 analog pin to read the input analog value. If we have an idea about reference voltage then we can easily measure the input voltage. Here we will use 5V as a reference voltage.
Block Diagram
arduino based dc voltmeter circuit diagram
Block Diagram of DC Voltmeter
Component Required 
  1. 1 * Arduino Board(In this article we use Arduino UNO)
  2. 1 * LCD Module(Here we will use 16 * 2 LCD Module)
  3. 1 * 100K Resistor 
  4. 1* 10K Resistor
  5. 1 * 5K Potentiometer
  6. Some jumper wires
  7. Breadboard 
Circuit Diagram
Circuit diagram of this projects is very simple and easy to understand. Here we use a 16 * 2 LCD module to display the voltage. Read this article to learn How To Interface LCD With Arduino UNO.
arduino based DC Voltmeter circuit
Circuit Diagram
A voltage divider circuit is used here to divide the input voltage by the range  of Arduino board. As we all know that Arduino is compatible with till 5v only. Above this voltage, our Arduino may be damaged.
Analog input pin on the Arduino board measure the input voltage and convert it into digital format by using inbuilt ADC(analog to digital converter) that can be processed  by Arduino and then display it on LCD. In this project, we fed input voltage to analog pin A0 of Arduino by using the voltage divider circuit. A simple voltage divider circuit is made by using one 100kohm and one 10kohm resistor to make the 1:11 divider. Thus, by using this voltage divider circuit we can measure the voltage up to 55V.                      
         Voltage divider output  Vout  = Vin * ( R2/(R1+R2) )
It is good if you use this voltmeter project to measure the voltage within range 0v to 35v. Because large voltage may be damaged your Arduino board. 

Code 
In this project, we use inbuilt liquid crystal library for the display of voltage value and analogRead() function to read the input voltage at the analog pin A0. Here our reference voltage is 5V, hence we multiply read value with 5 and then divide it with 1024 to obtain the actual voltage. Then by using the voltage divider formula we can decrease this value within the range of Arduino board voltage.


Video Demonstration 

A Guide For Interfacing Analog Sensors With Arduino

By // 6 comments:
With Arduino, almost everything seems to be too friendly when it comes to interfacing various sensors, shields, add-ons or any other utility devices. Just because the Arduino coding environment is so user-friendly, anyone can do it. So in this post, I will just show you how to hook up your sensors to Arduino and get them running. Let's start with the very basics....

sensor interfacing with arduino
Sensors
What is Sensor
Sensors are those electronic components which convert physical data into electronic data. This data is in analog format and is fed to the microcontroller on the Arduino board. The microcontroller has inbuilt ADCs (Analog-2-Digital Converter) which processes this data and converts it into digital format.

And once you have received the (electronically converted) physical data, you can make your Arduino perform as you want.


On your Arduino board, there are analog pins named as A0, A1, A2, A3, A4, A5. The number of these pins may vary depending on your Arduino board. For UNO, there are only 6 analog pins while for MEGA there are 16. And remember this thing, any sensor (or other components) that gives analog data and you wish to process it, you'll have to connect it to your analog pins only. For now, I would say SENSORS would always be connected to analog pins.

Connection of Analog Sensor with Arduino
All sensors have their own method to connect with Arduino. Some of them need pull-up resistors, some need a certain power supply to use them.  But any sensor has generally 3 pins to connect to Arduino or other development board. These pins are. 
1. +Vcc
2. Signal
3. Gnd
Hook up the +Vcc to 5v (or 3.3v if sensor demands it) on your Arduino board.
Connect the Gnd pin to Ground pin on your Arduino.
Connect the Signal pin to any of your Arduino's analog pins. In our case, say A1.

Code for Interfacing Analog Sensor with Arduino
Below code is general code for interfacing analog sensors with Arduino. Write this code in your Arduino IDE to start playing with analog sensors.
void setup()
 {
  Serial.begin(9600);                            // initialize serial communication at 9600 bits per second:
  }

void loop() 
{
  int sensorValue = analogRead(A1);            // read the input on analog pin 1:
  Serial.println(sensorValue);                       // print out the value you read:
  delay(1);                                                      //this  delay in between reads for stability 
}

After burning this code to your Arduino, open the serial monitor and see the analog-2-digital converted data on your serial terminal. Basically, it is 10-bit data since the inbuilt ADC of your Arduino is a 10bit ADC.You will get the reading on your serial monitor.

That's all for now. Hope you got everything out of that blog.I'll try to bring something new next time. Till then........ keep learning and keep prototyping.

If You have got any problem or feedback then comment below. I will be right back to you soon.

Be sure to buy the stuff mentioned in this blog by clicking on the link below-

The vendor's offering interesting and working hardware at quite handy rates. Go give it a try! :)

Automatic Street Light Controller Circuit Using LDR And 555 Timer IC

By // 56 comments:
We are living in the world where everything goes to be automatic from your washing machine to your ceiling fan. Street lights are one of those examples of the automatic world. Automatic street light are those light which needs no manual operation to gets turn ON and turn OFF. Did you ever try to make such kind of street lights that gets turn ON and turns OFF automatically? In this article, we are going to make automatic street light using LDR and 555 timer IC.

List of Components  
  1. 555 Timer IC
  2. LDR
  3. LED
  4. Potentiometer
  5. Resistor 1* 1k ohm 
  6. Resistor 1* 220 ohm
  7. 9V Battery
  8. Printed Circuit Board(PCB) Or BreadBoard 
Circuit Diagram
A very simple circuit diagram of automatic street light is given below. 
automatic street light controller circuit using ldr
Automatic Street Light Controller Circuit

Principle and Working of Automatic Street Light Controller

555 Timer IC is the main part of the circuit that works as a comparator. All the working of this circuit depends on the working of the 555 timers Ic.To know more about 555 times IC read this article Working of 555 Timer IC. In this circuit pin, 3 produce output which has just two states high and low. Output goes to high when  trigger pin  is at a lower level than the 1/3rd level of the power supply voltage and output goes low when trigger pin 2 is at above then 1/3rd  of the power supply voltage. In this circuit pin, 4,6 and 8 are connected to the power supply. Here we use LDR to detect the presence of light which is formed a potential divider circuit with the help of 1k ohms resistor. LDR is a special type of resistor whose value depends on the light. Read this article to know How LDR Works. The output of this divider circuit is given to trigger pin of the 555 timer IC. 

In this circuit, we use a simple LED to know how the whole circuit works. You can also connect as much led as you want by using the transistor or you can connect a Relay to control high voltage electrical bulbs. 

You must use caution while connecting Relay to this circuit because its may be danger and as different bulb have different wattage.

Video Demonstration of Automatic Street Light Controller



Atmel AVR Studio - Download and Install

By // 2 comments:
In the previous article, we learn why AVR microcontrollers are so popular for designing embedded system projects. We have got the basic knowledge of ATmega16 Pin description and other required data through its datasheet. Now we can move forward to code our microcontroller. So In this article, we are going to install and setup the Atmel studio.
installing atmel studio
 Source: ATMEL

HOW TO INSTALL ATMEL STUDIO 


Those who have been using an earlier version of Atmel studio can realize that there are not so much difference between the new version of Atmel studio except the awesome UI. To download the atmel studio first you have to go to the atmel website or simply click here. There you may see two option for downloading atmel studio like this:
Software                   Description
    
     1                          Atmel studio (latest version name) eg. Atmel studio 7.0 (build 634) web installer                                   (recommended)
                                  2.38 MB, Required internet access during installation 

     2                          Atmel studio 7.0 (build 634) offline installer 
                                 734 MB, No internet access required during installation

Click any one option that you want to install and register your email id as a guest user or create an atmel account. Now go to your email account and click on the download link send by atmel.
After downloading is completed then double-click on the installation file to install atmel studio. If you have got already installed Visual Studio then it will not install or if you do not have visual studio install on your desktop then first it install it.  Now you just click on next button till installation won't be finished.
When visual studio installation is completed then it installs atmel studio.Accept the terms of the license and click next.
installing atmet studio
Now click next once again as shown.
installing atmel studio
Now once again click on next button and installing will start as shown.
installing atmel studio 6
Now wait for a while and  click on finish button in next dialogue box. Now atmel studio installation is completed and atmel studio will be installed on your desktop. 
Now you have successfully completed installation of atmel studio and ready to code your AVR microcontroller. In the next article, we set up the atmel studio to write our first code for AVR  microcontroller. Hope you like this article and if you have got any problem then comment below.

AVR Microcontroller ATmega16 - An Introduction

By // 25 comments:
ATMEL AVR microcontrollers are very popular among Engineers,Students and Hobbyist  for designing mid range embedded system projects. All embedded system needs brain that receives external signal, interprets it and perform a set of task accordingly. AVR microcontroller are best option for this purpose because AVR microcontroller have powerful instruction set and have high speed.In this article we'll discuss the basic  of ATMEL ATmega16 microcontroller.

WHICH AVR I USE 

difference between avr microcontrollers
AVR Features
ATMEL AVR microcontrollers are available in the market in many varieties. But most popular and used AVR microcontrollers are ATmega8, Atmega16 and ATmega32. All these microcontrollers are belongs to ATMEL mega family. There are no difference between avr microcontroller. They only differs in memory size and Price.
Nomenclature of Atmega uCs

atmel avr microcontroller


Atmega16 Pin Configuration

atmega16 pin configuration
Pin Configuration
Pin 10 and 11 : These pins are available for the power supply of uC. Atmega16 works at 5V.

Pin 9 : This pin is used for Reset the uC. It is an active low pin means its gets activated when you give it high signal.

Pin 30 and 32 : Pin 30 is analog Vcc. Atmega16 has features of analog to digital converter. This pin is used to gives power externally to analog circuit. Pin 32 is analog reference pin. This pin is also used for ADC purpose.

Pin 12 and 13 : By default ATmega26 works at 1 MHz internal frequency. We used this pin to connect an external crystal oscillator for getting higher frequency and clock pulses.

Pin 1-8 (PORT B) : These 8 pin of ATmega16 uC are known as PORTB. These pins are I/O pin that means all pins are capable of getting input as well as giving output.

Pin 33-40(PORT A) : These pins are known as PORTA. PORTA can be used for ADC purpose. If PORTA is not used for ADC purpose then its serves as 8-bit bidirectional I/O PORT.

Pin 22-29(PORT C) : This is 8-bit bidirectional I/O port known as PORT C. All pins of PORT C have internal pull-up resisters.

Pin 14-21 (PORT D) :
This is also 8-bit bidirectional I/O port with internal pull-up resistors. PORTD also has some additional features for serial communication, interprets, PWM and timer.

Datasheet: 

Now we have got some basic knowledge about Atmega16 uC. If you want to learn anything else about the ATmega16 uC then you can refer to its Datasheet. Datasheet contains all the information about uC like its behavior,bit setting, actual working etc. 

Arduino Distance Measurement Using Ultrasonic Sensor

By // 3 comments:
We all know about the ultrasonic sensor and also wanted to play with it, but don't know how ultrasonic sensor works. So In this article, we will see  how to use an ultrasonic sensor with your projects. The ultrasonic sensor is very popular among arduino hobbyist and there are so many projects which you will be able to do at the end of this article.

Description of HC-SR04 Ultrasonic Sensor
ultrasonic sensor
Ultrasonic Sensor can measure the distance from 1" to 13 feet( 1 cm to up to 4metre) with accuracy up to 3mm. A hc-sr04 ultrasonic sensor has 4 pin GND, VCC, Echo and Trigger Pin. Trig pin generate an ultrasound by setting trig pin on the high state of 10 microseconds. Echo pin produce an output in a microsecond when ultrasound returns back from the object to echo pin.

We can calculate the distance by using simple formula Speed=(Distance/Time). The speed of the sound is 340m/s and thus by calculating ultrasound travel time we can calculate the object distance from the ultrasonic sensor.

Required Components
  1. 1 Arduino UNO board( Buy from here Arduino )
  2. 1 HC-SR04 ultrasonic sensor ( Buy from here sensor )
  3. Jumper wire
  4. Breadboard

Circuit Diagram
Ultrasonic sensor pin connected to arduino pin in a very simple manner as shown in the image below. Here we use a voltmeter as a reference because we can't place a real object before the LDR. So when we increase or decrease the voltage level of voltmeter then its corresponding value also changed.
Arduino           Ultrasonic sensor
Vcc                      Vcc
Pin 5                   Trig
Pin 4                   Echo
Gnd                     GND 
ultrasonic_sensor circuit
Circuit
Source code
Here first we define the trig pin and echo pin of the ultrasonic sensor and they are pin no 5 and pin no 4 respectively. Here we define Trig pin as output and Echo pin as an input. After that, we defined three long variable name duration, cm and inches. In the loop first we set the Trig pin Low for few microsecond and after that, we set it in the high state for 10 microseconds. We read the travel time by ultrasound by using the pulseIn() function.
ultrasonic sensor source code
Source Code
For getting the exact distance we multiply .034 in duration and then divide it by 2 because ultrasound travels forward and backward. At the end we use Serial.print() function to print the value in the virtual terminal.You can download the source code by clicking on the link.

Video Demonstration 


Hope you like this tutorial on the ultrasonic sensor. If you have got any problem using the ultrasonic sensor or its proteus simulation then feel free to comment below or if you have any suggestion about this tutorials and let me know by your valuable comments. 

How to Interface 4*3 Keypad With Arduino

By // No comments:
In this article, we will find out how to interface a matrix keypad with arduino in very easy technique. During this article, we are using a 4*3 matrix keypad. Keypads are a very important component in the embedded system which are used in various mini or major comes and the commercial product like telephone, electronic locker, and alternative automation product. At the end of the article you may be ready to interface a matrix keypad together with your arduino and after you press a key, its shows up into the serial monitor.

What is 4*3 Matrix Keypad
One of the most frequently asked question among the students or hobbyist are when we use 4*3 or 4*4 matrix keypad and what is the difference between them. Therefore, we have only one answer what's your requirement within the project. The logic behind operating of each keypad are same. The 4*3 keypad is simple keypad having 4 rows and 3 column, therefore, total 12 keys as shown in the image. There are so many distributors wherever you will purchase a keypad otherwise you can purchase from here
type of keypad matrix 4*3 Keypad matrix 

Circuit Diagram
The circuit of interfacing of a keypad with arduino is very simple. You only need to connect rows 1, 2, 3, 4 to digital pin 6, 7, 8, 9 respectively and column 1, 2, 3 are connected to digital pin 10, 11, 12 respectively of the arduino. The circuit is extremely easy to grasp as shown in the below image.
simple circuit diagram of keypad interfacing with arduino
Circuit Diagram
Program

Program of interfacing a keypad with arduino is extremely easy. Here we simply use an if-else statement to check every condition one by one. First we kept row 1 low and check all condition for it and equally with others rows one by one. You can download the source code from here.
From here you will display the key on an LCD and build a lot of other cool projects like door lock, calculator, security system enabled projects. Hope you like this article. If you have got any doubt then comment below or have any suggestion then you may be forever welcome to ProjectsDunia.

VIDEO:




555 Timer IC: Introduction, Working and Pin configuration

By // No comments:
One of the most versatile linear integrated circuit is 555 timer. 555 timer IC was first introduced in early 1970 by  Signetics Corporation.555 timer IC is incredibly low cost and popular timing IC that is used by electronics student, hobbyist for generating timing delay and pulses. Mono stabale and astable multi vibrators is that the most correct example of its application. With the exception of this it's conjointly used for oscillations, waveform generators, analog frequency meters, voltage regulators, digital  probes, tone generation, frequency divider and lots of others.This device is obtainable as 8-pin mini Dual-in-line package(DIP)  or 14 pin Dual-in-line package(DIP) that consist 25 transistor,16 resistors, 2 diode.

PIN CONFIGURATION OF 555 TIMER IC
555 timer ic pin configuration
8-Pin DIP 555 Timer IC

Pin 1: Ground   This pin is used to measured the all voltages.

Pin 2: Trigger   Negative going pulse is applied to this pin whose dc level is greater than 1/3 times                                VCC. Thus comparator 2 output goes low. The output remains high as long as                                      trigger terminal is held at low voltage.

Pin 3: Output    Output pin is available to connect the load.There are two ways of connecting the                                   load either between pin 3 and ground or between pin 3 and +Vcc pin of 555 timer                                 IC.

Pin 4: Reset      555 timer can be reset by applying a negative pulse to this pin.

Pin 5: control voltage  To change the threshold voltage and trigger voltage an external voltage is                                               applied to this pin.

Pin 6: Threshold  SR flip flop is reset when voltage at this pin is greater than 2/3 Vcc.

Pin 7: Discharge   This pin is directly connected to the collector of transistor.When transistor is off                                     this acts as a open circuit and when transistor is on, acts as a shot circuit.

Pin 8:   A Supply voltage is applied to this pin that ranges from +5v to +18v with respect to                              the ground.

Block Diagram of 555 Timer IC

555 timer ic block diagram image
555 Timer IC Block Diagram

The 555 timer IC work as a mono-stable multi-vibrator and astable multi-vibrator. A voltage divider circuit is internally connected to the Pin 8 and Pin 1 of 555 timer IC. This circuit hold positive non inverting terminal of comparator at 1/3Vcc and negative inverting terminal of comparator at 2/3Vcc. The output from each comparator is connected to the input of the SR Flip-Flop. The output from the SR Flip-flop acts as a switching stage to drive the Load.

555 Timer IC has three operative modes known as:
1: Monostable
2: Astable
3: Bistable

To Know additional concerning 555 IC Click on this 555 Data sheet.

How To Interface Relay With Arduino

By // 2 comments:
A Relay is an electromagnetically operated switch. Relays are used to control a circuit. Many relays consist a coil, a yoke, and an armature. When a current is passed through the coil, a magnetic field is induced in the coil which moves the armature and relay start its switching function. A normal relay has NO(normally open), NC(normally connected), COM and coil pin within it. A Simple one channel relay is shown in below image
relay driver interfacing
Relay
Required Components
For designing a relay driver circuit you will need following components 
  • Relay
  • 1N4007 Diode
  • BC547 Silicon NPN transistor
  • 10K Resistor 
Circuit Diagram
A simple relay driver circuit is shown in below image. Here we use an NPN BC547 transistor to drive the relay.Base current ought to be a lot of enough to turn on a transistor. A diode 1N4007 use among the circuit to protect the transistor from damage due to back emf. When relay is in off state, COM pin of 

circuit diagram of relay driver
Relay Driver Circuit 
a relay is connected to NC(normally connected) pin and when a small current start flows through relay coil then COM pin is connected to NO(normally open) pin.

NOTE: Change +5V  to +12V in the circuit 

Code for relay testing is same as for blink an LED so learn  how to blink an LED and test your relay driver circuit. Now using relay make some more cool projects using arduino like control your AC home appliances, turn ON/OFF a bulb and many more.

Hope you like this article and give your valuable feedback by commenting below or if you have got any problem then also comment below. 

How To Interface LDR With Arduino

By // No comments:
Hello, Friends hope all of you playing with your arduino and currently need to try to do another cool projects on arduino. Therefore, this tutorial is for you. During this tutorial, we interface LDR(Light dependent Resister) with the arduino board. It is very simple tutorials for arduino students, hobbyist, and beginners. Before going more we must find out how LDR is dependent on Light.

What is LDR 
interfacing ldr with arduino
LDR(Light dependent Resister) or a photoresistor is a light dependent variable resistor that resistance decreases with the increase in the intensity of light. This gives an analog value so that it is connected to an analog pin of arduino board. A simple LDR is shown within the image and to buy an LDR click on the below image

Circuit Diagram
A simple circuit diagram is shown in the image. We won't use LDR directly within the circuit in order that a potential divider circuit is used with a 10K resistor. In this circuit one pin of LDR is connected to Analog pin A0 of arduino UNO and one pin is connected to ground(GND).

circuit diagram of LDR interfacing with arduino
LDR Circuit
Source code
Now connect your arduino board together with your PC and upload the given source code into the board. After uploading the code run your program and see the different value in your serial monitor.

LDR interfacing source code with arduino
LDR Code
Download:


Watch This Video: