Sunday, June 24, 2012

Touch Based Blinking Lights

This circuit demonstrates the principle and operation of application based on touch sensor. The circuit is divided into three parts: Input, 555 timer and output. A touch plate is used for the input and output can be seen across an LEDor a buzzer. Some application of the circuit include touch based blinking lights, touch buzzer, touch switch etc.
Click Here

The touch plates is connected to the trigger pin of the 555 timer IC. When we touch the touch plates the output of the touch plates becomes zero thereby providing an active low trigger to the IC 555. The IC is configured in the monostable mode .The output of the IC is a pulse whose frequency is set by the resistor (R1) and  capacitor (C1) according to the formula [F=1/(1.1*R*C)]. In this case it produces a pulse with frequency of about 0.9 hertz and time period of 1.1 seconds. In monostable mode pin7 (discharge pin) and pin6 (threshold pin) are shorted while R1 is connected between pin7 and Vcc and C1 is connected between pin 6 and ground. Reset pin (pin4) is connected to Vcc while control pin is connected to ground through a capacitor. The output can be observed on the LED, which glows for a small duration. This circuit can be used in the following applications:

To detect stray voltages produced by mains or to detect electrostatics build up in a room.
To make touch buzzers.
To implement touch switches like for a bell.

circuit 2, shows an improved version of this circuit. This circuit has a higher sensitivity as compared to circuit in figure 1. The output of the touch plate is connected to the base of npn transistor T1 (BC 547). The collector is connected to the Vcc through a resistor R1. The trigger pin of the IC is connected to the collector of the transistor. When no input is there on the base of the T1, T1 is in cut off state and hence the trigger pin is at logic high and therefore 555 do not produce any output. When we touch the plates T1 behaves like a closed switch trigger pin gets connected to ground, thereby producing the output at pin 3 of the IC.

Saturday, June 16, 2012

Digital code lock using 8051 microcontroller (AT89C51)


An  digital lock is a device which has an electronic control assembly attached to it. They are provided with an access control system. This system allows the user to unlock the device with a password. The password is entered by making use of a keypad. The user can also set his password to ensure better protection. The major components include a keypad, LCD and the controller AT89C51 which belongs to the 8051 series of microcontrollers. This article describes the making of an electronic code lock using the 8051 microcontroller. 


A 4x3 matrix keypad and a 16x2 LCD have been used here. Keypad and LCD are very commonly used input & output devices, respectively. A four digit predefined password needs to be specified the user. This password is stored in the system.
While unlocking, if the entered password from keypad matches with the stored password, then the lock opens and a message is displayed on LCD. Also an output pin is made high to be used for further purpose.
The connections in the circuit are as following: port P2 of microcontroller AT89C51 is used as data input port which is connected to data pins (7-14) of LCD. P1^0, P1^1 and P1^2 pins of microcontroller are connected to control pins RS, RW and EN of LCD. Port P0 is used to take input from keypad. P0^7 has been used as lock output pin of controller.
As the program starts, string ‘Enter Password’ is displayed on LCD. The keypad is scanned for pressed digits one by one. Every time, row and column of the key pressed is detected and a ‘*’ is displayed on LCD corresponding to the entered number. After the four digits are entered, the user is prompted to ‘Confirm Password’ and again the input is taken through LCD. If the passwords do not match, a message is displayed to indicate ‘Wrong Password’; otherwise the user is prompted to unlock the device.
To unlock, user needs to ‘Enter Password’ through keypad. Again the keypad is scanned for pressed keys and corresponding digits are identified. The passkey is displayed as ‘****’ on the LCD screen. After the four digits are entered, they are compared with the pre-set password. If all the four digits match with set password, LCD displays ‘Lock Open’ and the lock output pin goes high. If the security code is wrong, ‘Wrong Password’ is sent to be displayed on LCD. The system gets locked if more than three attempts are made with wrong password to open the electronic lock. The system needs to be reset in such a case.

Thursday, June 14, 2012

2 in 1 Room Bell

The roombells are used to produce a ringing alert sound so that the resident comes to know that a visitor is there on the door. Many homes have two doors for entering. So at times it is confusing for the resident to find out on which door is the visitor present. This roombell circuit produces two different sounds can be used simultaneously on both the doors.

The roombell circuit is made up of CMOS LSI designed UM3561 IC which consumes less power. It is commonly used in toys and alarm watches because of its low cost. A compact sound module can be constructed using this IC. It includes oscillator and selector circuit and only few components are required to be added externally. It also contains a programmed ROM to produce siren sound.

When the switch S1 or S2 is pressed, the pin1 or pin5 of the IC1 receives the high signal which is used to drive the transistor that is connected to pin3 of IC1. Hence the speaker gets the supply and IC1 produces the sound of siren so as to indicate the presence on the door. A transistor is used for the process of amplification as the output of pin3 is very low.
Many other different sounds can be produced by referring the datasheet of UM3561. Similarly many other ICs are there to produce different sounds i.e. UM3481, UM3484, and UM34811. 

USB Cell Phone Charger

Nowadays mobiles can also be charged using the USB outlet of PC. The Cell Phone charger circuit presented here can give 4.7V of synchronized voltage for charging the phone. As USB outlets can give 5V DC and 100mA of current. It is sufficient for slow charging of mobile phones so they can be used to charge the mobile phones. USB stands for Universal Serial Port. It is one of the latest methods to exchange information from PC to the real world. The USB port offers power to the external devices. +5V of power is available at pin1 and -5V of it is available at pin4.


USB Mobile Charger

Most of the Mobile Phones battery are rated 3.6 volts at 1000 to 1300 mAh. These battery sets have 3 Lithium cells which have 1.2 volt rating. Typically a battery pack sufficiently requires 4.5 volts and 300-500 mA current for fast charging. But low current charging is preferred to increase the efficiency of the battery. The circuit described here provides 4.7 V of the regulated voltage and a sufficient amount of current for the slow charging of the mobile phones. Regulated output is given by the transistor T1, output voltage is controlled by Zener diode ZD and the polarity of the output supply is protected by D1. Front end of the circuit should be connected to an A type USB plug, a red wire to pin1 and black wire to pin 4 of the plug for easy polarity recognition. The output of a suitable charger pin should be connected with the mobile phone. After the circuit is assembled, USB plug should be inserted into the socket and output should be measured from the circuit. If the output is OK and polarity is correct, connect it with the mobile phone and if the polarity is incorrect, it will destroy the mobile battery so extreme care should be taken. 
For making this circuit a USB cable is used with at least one male plug on it and strip back about 5 cm of the outer insulation with shield from the bare end of the USB cable. Normally, USB cables have four wires i.e. red, green, white and black. As green and white carry the data so they can be trimmed as they have no use here.. Mostly black wire is NEGATIVE and red is POSITIVE. The voltage across USB is about 5V with 500 mA as maximum current for any device. Now power lines are connected to the USB plug with correct polarity. Reflectors are used for LEDs to get maximum illumination.

How to interface LEDs with 8051 microcontroller (AT89C51)


This article introduces you to the very basic operation of taking an output from the microcontroller AT89C51. It demonstrates the principle behind interfacingLEDs with 8051 microcontroller. Here we have demonstrated the aforesaid principles by blinking LEDs continuously i.e., switching them on and off.
 AT89C51, which belongs to the family of 8051 series of microcontrollers, is very commonly used by a large community of hobbyist and engineers. Its simplicity and ease of programming with inbuilt features easily makes its position in the top preferred list of  microcontroller for both beginners and advanced user.
LEDs are by far the most widely used means of taking output. They find huge application as indicators during experimentations to check the validity of results at different stages. They are very cheap and easily available in a variety of shape, size and colors.
The principle of operation of LEDs is simple. The commonly available LEDs have a drop voltage of 1.7 V and need 10 mA to glow at full intensity. The following circuit describes “how to glow an led”.
 The value of resistance R can be calculated using the equation, R= (V-1.7)/10 mA. Since most of the controllers work on 5V, so substituting V= 5V, the value of resistance comes out to be 330 ohm. The resistance 220 ohm, 470 ohm is commonly used substitute in case 330 ohm is not available.

AT89C51  is a 40 pin microcontroller which belongs to 8051 series of microcontroller. It has four ports each of 8 bits P0, P1, P2 and P3.The AT89C51 has 4K bytes of programmable flash. The port P0 covers the pin 32 to pin 39, the port P1 covers the pin 1 to pin 8, the port P2 covers the pin 21 to pin 28 and the port P3 covers the pin 10 to pin 17. Pin 9 is the reset pin. The reset is active high. Whenever the controller is given supply, the reset pin must be given a high signal to reset the controller and bring the program counter to the starting address 0x0000. The controller can be reset by manually connecting a switch or by connecting a combination of resistor and capacitor as shown in the circuit diagram. A 12 MHz crystal is connected between pin 18 pin 19. Pin 40 is Vcc and pin 20 is ground. Pin 31, is connected to Vcc as we are using the internal memory of the controller
LEDs are connected to the port P0. LEDs need approximately 10mA current to flow through them in order to glow at maximum intensity. However the output of the controller is not sufficient enough to drive the LEDs, so if the positive leg of the LED is connected to the pin and the negative to ground as shown in the figure, the LED will not glow at full illumination.
 

To overcome this problem LEDs are connected in the reverse order and they run on negative logic i.e., whenever 1 is given on any pin of the port, the LED will switch off and when logic 0 is provided the LED will glow at full intensity.
As soon as we provide supply to the controller, the LEDs start blinking i.e., they become on for a certain time duration and then become off for the same time duration. This delay is provided by calling the delay function. The values inside the delay function have been set to provide a delay in multiples of millisecond (delay (100) will provide a delay of 100 millisecond).