Wednesday 20 June 2012

Little Door Guard

If some intruder tries to open the door of your house, this circuit sounds an alarm to alert you against the attempted intrusion. The circuit (Fig. 1) uses readily available, low-cost components. For compactness, an alkaline 12V battery is used for powering the unit. Input DC supply is further regulated to a steady DC voltage of 5V by 3-pin regulator IC 7805 (IC2).
Assemble the unit on a general-purpose PCB as shown in Fig. 4 and mount the same on the door as shown in Fig. 3. Now mount a piece of mirror on the door frame such that it is exactly aligned with the unit. Pin configurations of IC UM3561 and transistors 2N5777 and BC547 are shown in Fig. 
Initially, when the door is closed, the infrared (IR) beam transmitted by IR LED1 is reflected (by the mirror) back to phototransistor 2N5777 (T1). The IR beam falling on phototransistor T1 reverse biases npn transistor T2 and IC1 does not get positive supply at its pin 5. As a result, no tone is produced at its output pin 3 and the loudspeaker remains silent. Resistor R1 limits the operating current for the IR LED.
When the door isopened, the absence of IR rays at phototransistor T1 forward biases npn transistor T2, which provides supply to  positiveIC1. Now 3-sirensound generator IC UM3561 (IC1) gets power via resistor R5. The output of IC1 at pin 3 is amplified by Darlington-pair transistors T3 and T4 to produce the alert tone via the loudspeaker.
Rotary switch S2 is used to select the three preprogrammed tones of IC1. IC1 produces fire engine, police and ambulance siren sounds when its pin 6 is connected to point F, P or A, respectively

Simple Timer for Very Long Periods

Simple mechanical timers, which you can buy for a couple of pounds in every home improvement centre, are suitable for switching something on and off one or more times per day. They can be used to control a wide variety of devices, such as  lamps inside or outside the house,lighting for bird cages and aquariums, sump pumps, battery chargers, etc.
If you need to control something over a longer period than the standard 24 hours, you can use two timers with the second one plugged  into the first one (see photos). To determine what you can do with this arrangement, you  first need to determine how often the load  needs to be switched. For example, if the  first timer has 48 tabs the shortest ‘on’ time  is 30 minutes in 24 hours. This means that the  second timer will run for 30 minutes every 24 hours, so the maximum duration of a full cycle is 48 days. A device such as a charger for diving torches can be connected to the second timer. 
To prevent the ‘on’ time of the second timer from exceeding 24 hours, it is essential to keep the ‘on’ time of the second timer shorter than that of the first timer. If a maximum cycle time of 48 days is too short, you can also connect a third timer. With three timers, the maximum cycle time is 2304 days (one ‘on’ time in approximately 6.5 years).

As you can see from the photos, the second timer may interfere with the tabs of the first timer if they are plugged together with one on top of the other. This can be avoided by turning the second timer by 180 degrees relative to the first one.

Monday 18 June 2012

Triangular Wave Oscillator

This design resulted from the need for a partial replacement of the well-known 8038 chip,  which is no longer in production and there fore hardly obtainable.
An existing design for driving an LVDT sensor (Linear Variable Differential Transformer),  where the 8038 was used as a variable sine  wave oscillator, had to be modernised. It may  have been possible to replace the 8038 with an  Exar 2206, except that this chip couldn’t be used  with the supply voltage used. For this reason we  looked for a replacement using standard components, which should always be available.
In this circuit two opamps from a TL074 (IC1.A  and B) are used to generate a triangular wave,  which can be set to a wide range of frequencies using P1. The following differential amplifier using T1 and T2 is configured in such a way  that the triangular waveform is converted into  a reasonably looking sinusoidal waveform. P2  is used to adjust the distortion to a minimum.
The third opamp (IC1.C) is configured as a  difference amplifier, which presents the sine  wave at its output. This signal is then buffered by the last opamp (IC1.D). Any offset at the  output can be nulled using P3.

Sunday 17 June 2012

Remote Control Blocker

This circuit was designed to block signals from infrared remote controls. This will prove very useful if your children have the tendency to switch channels all the time. It is also effective when your children aren’t permitted to watch TV as a punishment. Putting the TV on standby and put-ting the remote control out of action can be enough in this case.

The way in which we do this is very straightforward. Two IR LEDs continuously transmit infrared light with a frequency that can be set between 32 and 41 kHz. Most remote controls work at a frequency of 36 kHz or 38 kHz.
The disruption of the remote control occurs as follows. The ‘automatic gain’ of the IR receiver in TVs, CD players, home cinema systems, etc. reduces the gain of the receiver due to the strong signal from the IR LEDs. Any IR signals from a remote control are then too weak to be detected by the receiver. Hence the equipment no longer ‘sees’ the remote control!
The oscillator is built around a standard NE555. This drives a buffer stage, which provides the current to the two LEDs. Setting up this circuit is very easy. Point the IR LEDs towards the device that needs its remote control blocked. Then pick up the remote control and try it out. If it still functions you should adjust the frequency of the circuit until the remote control stops working.
This circuit is obviously only effective against remote controls that use IR light!

40 LED Bicycle Light

The 555 circuit below is a flashing bicycle light powered with four C,D or AA cells (6 volts). Two sets of 20 LEDs will alternately flash at approximately 4.7 cycles per second using RC values shown (4.7K for R1, 150K for R2 and a 1uF capacitor). Time intervals for the two lamps are about 107 milliseconds (T1, upper LEDs) and 104 milliseconds (T2 lower LEDs). Two transistors are used to provide additional current beyond the 200 mA limit of the 555 timer.
A single LED is placed in series with the base of the PNP transistor so that the lower 20 LEDs turn off when the 555 output goes high during the T1 time interval. The high output level of the 555 timer is 1.7 volts less than the supply voltage. Adding the LED increases the forward voltage required for the PNP transistor to about 2.7 volts so that the 1.7 volt difference from supply to the output is insufficient to turn on the transistor. Each LED is supplied with about 20 mA of current for a total of 220 mA. The circuit should work with additional LEDs up to about 40 for each group, or 81 total. The circuit will also work with fewer LEDs so it could be assembled and tested with just 5 LEDs (two groups of two plus one) before adding the others.

Friday 15 June 2012

RGB Solar Lamp

This deluxe solar-powered light  uses a battery and solar cells salvaged from a solar lamp with a four-cell battery (4.8 V nominal terminal  voltage).
The circuit can operate from any  DC voltage around this value and  its current consumption, at 20 mA,  is low. This means that the battery  can give up to five days of operation. The circuit consists of an Atmel  ATtiny microcontroller which drives  a red, a green and a blue LED directly  from three port pins. Series resistors are of course included to limit  the LED current. The microcontroller  drives the LEDs in sequence to produce an  RGB running light effect. The microcontroller  is also responsible for ensuring that the light automatically switches on when it gets dark  and off when it is light. The light sensor is  made from one of the solar cells from a bro-ken solar lamp (it is more common  for the battery to fail rather than  the solar cells).

Unique Water Pump Controller

Here is a simple solution for automatic pumping of water to the overhead tank. Unlike other water-level indicators,  it  does not use probes to detect the water level and hence there is no probe corrosion problem. It has no direct contact with water, so the chance of accidental leakage of electricity to the water tank is also eliminated. Two important advantages of the circuit are that the water level never goes below a particular level and no modification in the water tank is required.
Fig.  shows the circuit of the water-pump controller. The circuit uses an LDR-white LEDs assembly to sense the water level. It forms a triggering switch to energise the relay for controlling the pump. The LDR-LEDs assembly (shown in Fig. 2) is fixed on the inner side of the cap  of  the  water tank without making contact with water. The light reflected from  the water tank is used to control the resistance of LDR1.

When the water level is high enough, light from the white LEDs (LED1 through LED3) reflects to fall on LDR1. This reduces the resistance of LDR1, increasing the voltage at the non-inverting input (pin 3)  of IC1. IC1  is used in the circuit as a  voltage comparator. Resistors R4 and R5 form a potential divider to fix half of supply voltage to the inverting input of IC1.
Normally, when the water tank is full, LDR1 gets more of reflected light because the distance between the water level and the face of LDR1 is minimal. When white light falls on LDR1, the voltage at the non-inverting input (pin 3) of IC1 increases and its output goes high. This high output makes pnp transistor T1 non-conducting and the relay remains de-energised. LED1 also remains ‘off.’ Since the water-pump power supply is connected to the normally-open (N/O)  contacts of  relay RL1, pumping is stopped.
When water level falls, the amount of  light reflected to LDR1 decreases and its resistance increases. This reduces the  voltage at pin 3 of IC1 and its output goes  low. This  low output from IC1 makes transistor T1 conduct. Relay RL1 energises to close the N/O  contacts and the motor  starts pumping water. LED1 glows to indicate the pumping of water.
Assemble the circuit on a general-purpose PCB and enclose in a suitable  cabinet. Solder the white LEDs-LDR1 assembly on a separate PCB and use a separate power supply for it. Mount LEDs behind the LDR. Otherwise, light from the LEDs will  affect the working of the circuit. Connect LDR1 to the main circuit board at ‘A’ and ‘B’ points.
Fix the LEDs-LDR1 assembly on the inner side of the water-tank cap as shown in Fig.  3. Orient the LEDs and the LDR such that when the water tank is full, the light emitted from the LEDs and reflected  from the water surface falls directly on  LDR1.  The  distance between the upper level of water and the LEDs-LDR setup should be minimal, ensuring that water doesn’t touch  LDR1. Otherwise, the circuit  will  not function properly. By using more white  LEDs, this  distance  can  be increased. Cover the LDR with a black tube to increase its sensitivity.
You can fix the main unit at a convenient place and connect it to the LEDs-LDR  assembly through wire. Select the relay according to the horse-power (HP) of the water pump. After  arranging the setup (with  maximum water in the tank), adjust VR1 until LED1 stops glowing. In this state, the relay should de-energise. When the water level decreases, the relay automatically energises to connect mains to the motor and it starts pumping water.

A Simple Solar Cell Power System

A solar cell power system can be built using this electronic scheme. This electronic circuit is composed of three parts: a diode, solar cell panel and a rechargeable battery. Diode prevents battery discharge through the solar panel in the absence of sunlight or low light. Although diode is usually Schottky type, the direct voltage it can produce a considerable energy loss. Circuit uses a specials diode with low direct voltage.
To adjust the circuit, replace solar panel with adjustable stabilized voltage source, with current limiter set at a level which is not dangerous to the battery. Adjust power supply output at a level higher than 0.1 V than battery voltage. Then, adjust P1 until the point where IC1's output went into logical "1". Finally, with an ammeter if the battery is discharged when the source voltage is below the current battery voltage.

Wednesday 13 June 2012

detail about 8051 microcontroller

About the 8051

The Intel 8051 is an 8-bit microcontroller which means that most available operations are limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The Short and Standard chips are often available in DIP (dual in-line package) form, but the Extended 8051 models often have a different form factor, and are not "drop-in compatible". All these things are called 8051 because they can all be programmed using 8051 assembly language, and they all share certain features (although the different models all have their own special features).
Some of the features that have made the 8051 popular are:
  • 4 KB on chip program memory.
  • 128 bytes on chip data memory(RAM).
  • 4 reg banks.
  • 128 user defined software flags.
  • 8-bit data bus
  • 16-bit address bus
  • 32 general purpose registers each of 8 bits
  • 16 bit timers (usually 2, but may have more, or less).
  • 3 internal and 2 external interrupts.
  • Bit as well as byte addressable RAM area of 16 bytes.
  • Four 8-bit ports, (short models have two 8-bit ports).
  • 16-bit program counter and data pointer.
  • 1 Microsecond instruction cycle with 12 MHz Crystal.
8051 models may also have a number of special, model-specific features, such as UARTs, ADC, OpAmps, etc..





Typical applications

8051 chips are used in a wide variety of control systems, telecom applications, robotics as well as in the automotive industry. By some estimations, 8051 family chips make up over 50% of the embedded chip market.

Basic Pins

PIN 9: PIN 9 is the reset pin which is used to reset the microcontroller’s internal registers and ports upon starting up. (Pin should be held high for 2 machine cycles.)
PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a crystal at these pins to provide clock pulses to the circuit.
PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V 500mA to function properly, although there are lower powered versions like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.
PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If external memory is connected then PIN 31, also called EA/VPP, should be connected to ground to indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which is used when multiple memory chips are connected to the controller and only one of them needs to be selected.We will deal with this in depth in the later chapters. PIN 29 is called PSEN. This is "program store enable". In order to use the external memory it is required to provide the low voltage (0) on both PSEN and EA pins.

Ports

There are 4 8-bit ports: P0, P1, P2 and P3.
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional functions associated with them based upon the context of their usage.The port 1 output buffers can sink/source four TTL inputs. When 1s are written to portn1 pins are pulled high by the internal pull-ups and can be used as inputs.
PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter inputs, read and write pins for memory access.
PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P2 will act as an address bus in conjunction with PORT P0 to access external memory. PORT P2 acts as A8-A15, as can be seen from fig 1.1
PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P0 acts as a multiplexed address and data bus that can be used to access external memory in conjunction with PORT P2. P0 acts as AD0-AD7, as can be seen from fig 1.1
PORT P10: asynchronous communication input or Serial synchronous communication output.

Oscillator Circuits

The 8051 requires an external oscillator circuit. The oscillator circuit usually runs around 12MHz, although the 8051 (depending on which specific model) is capable of running at a maximum of 40MHz. Each machine cycle in the 8051 is 12 clock cycles, giving an effective cycle rate at 1MHz (for a 12MHz clock) to 3.33MHz (for the maximum 40MHz clock). The oscillator circuit generates the clock pulses so that all internal operations are synchronized.

Data and Program Memory 

The 8051 Microcontroller can be programmed in PL/M, 8051 Assembly, C and a number of other high-level languages. Many compilers even have support for compiling C++ for an 8051.
Program memory in the 8051 is read-only, while the data memory is considered to be read/write accessible. When stored on EEPROM or Flash, the program memory can be rewritten when the microcontroller is in the special programmer circuit.

Program Start Address

The 8051 starts executing program instructions from address 0000 in the program memory. The A register is located in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations.

Special Function Register

The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF. A, B, PSW, DPTR are called SFR.This area of memory cannot be used for data or program storage, but is instead a series of memory-mapped ports and registers. All port input and output can therefore be performed by memory mov operations on specified addresses in the SFR. Also, different status registers are mapped into the SFR, for use in checking the status of the 8051, and changing some operational parameters of the 8051.

General Purpose Registers

The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This means that there are essentially 32 available general purpose registers, although only 8 (one bank) can be directly accessed at a time. To access the other banks, we need to change the current bank number in the flag status register.

A and B Registers

The A register is located in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations. The B register is used in a similar manner, except that it can receive the extended answers from the multiply and divide operations. When not being used for multiplication and Division, the B register is available as an extra general-purpose register.







 

Tuesday 12 June 2012

8085 microprocessor

The Intel 8085 is an 8-bit microprocessor introduced by Intel in 1977. It was binary-compatible with the more-famous Intel 8080 but required less supporting hardware, thus allowing simpler and less expensive microcomputer systems to be built.
The "5" in the model number came from the fact that the 8085 requires only a +5-volt (V) power supply rather than the +5V, −5V and +12V supplies the 8080 needed. Both processors were sometimes used in computers running the CP/M operating system, and the 8085 also saw use as a microcontroller, by virtue of its low component count. Both designs were eclipsed for desktop computers by the compatible Zilog Z80, which took over most of the CP/M computer market as well as taking a share of the booming home computer market in the early-to-mid-1980s.
The 8085 had a long life as a controller. Once designed into such products as the DECtape controller and the VT100 video terminal in the late 1970s, it continued to serve for new production throughout the life span of those products (generally longer than the product life of desktop computers).
The 8085 is a conventional von Neumann design based on the Intel 8080. Unlike the 8080 it does not multiplex state signals onto the data bus, but the 8-bit data bus was instead multiplexed with the lower part of the 16-bit address bus to limit the number of pins to 40. Pin No. 40 is used for the power supply (+5v) and pin No. 20 for ground. Pin No. 39 is used as the hold pin. Pins No. 15 to No. 8 are generally used for address buses. The processor was designed using nMOS circuitry and the later "H" versions were implemented in Intel's enhanced nMOS process called HMOS, originally developed for fast static RAM products. Only a 5 Volt supply is needed, like competing processors and unlike the 8080. The 8085 uses approximately 6,500 transistors.
The 8085 incorporates the functions of the 8224 (clock generator) and the 8228 (system controller), increasing the level of integration. A downside compared to similar contemporary designs (such as the Z80) was the fact that the buses required demultiplexing; however, address latches in the Intel 8155, 8355, and 8755 memory chips allowed a direct interface, so an 8085 along with these chips was almost a complete system.
The 8085 has extensions to support new interrupts, with three maskable interrupts (RST 7.5, RST 6.5 and RST 5.5), one non-maskable interrupt (TRAP), and one externally serviced interrupt (INTR). The RST n.5 interrupts refer to actual pins on the processor, a feature which permitted simple systems to avoid the cost of a separate interrupt controller.
Like the 8080, the 8085 can accommodate slower memories through externally generated wait states (pin 35, READY), and has provisions for Direct Memory Access (DMA) using HOLD and HLDA signals (pins 39 and 38). An improvement over the 8080 was that the 8085 can itself drive a piezoelectric crystal directly connected to it, and a built in clock generator generates the internal high amplitude two-phase clock signals at half the crystal frequency (a 6.14 MHz crystal would yield a 3.07 MHz clock, for instance).
The 8085 is a binary compatible follow up on the 8080, using the same basic instruction set as the 8080. Only a few minor instructions were new to the 8085 above the 8080 set.

Programming model

The processor has seven 8-bit registers accessible to the programmer, named A, B, C, D, E, H, and L, where A is the 8-bit accumulator and the other six can be used as independent byte-registers or as three 16-bit register pairs, BC, DE, and HL, depending on the particular instruction. Some instructions use HL as a (limited) 16-bit accumulator. As in the 8080, the contents of the memory address pointed to by HL could be accessed as pseudoregister M. It also has a 16-bit stack pointer to memory (replacing the 8008's internal stack), and a 16-bit program counter. HL pair is called the primary data pointers.

Commands/instructions

As in many other 8-bit processors, all instructions are encoded in a single byte (including register-numbers, but excluding immediate data), for simplicity. Some of them are followed by one or two bytes of data, which could be an immediate operand, a memory address, or a port number. Like larger processors, it has CALL and RET instructions for multi-level procedure calls and returns (which can be conditionally executed, like jumps) and instructions to save and restore any 16-bit register-pair on the machine stack. There are also eight one-byte call instructions (RST) for subroutines located at the fixed addresses 00h, 08h, 10h,...,38h. These were intended to be supplied by external hardware in order to invoke a corresponding interrupt-service routine, but are also often employed as fast system calls. The most sophisticated command was XTHL, which is used for exchanging the register pair HL with the value stored at the address indicated by the stack pointer.

8-bit instructions

Most 8-bit operations work on the 8-bit accumulator (the A register). For two operand 8-bit operations, the other operand can be either an immediate value, another 8-bit register, or a memory cell addressed by the 16-bit register pair HL. Direct copying is supported between any two 8-bit registers and between any 8-bit register and a HL-addressed memory cell. Due to the regular encoding of the MOV-instruction (using a quarter of available opcode space) there are redundant codes to copy a register into itself (MOV B,B, for instance), which are of little use, except for delays. However, what would have been a copy from the HL-addressed cell into itself (i.e., MOV M,M) instead encodes the HLT instruction, halting execution until an external reset or interrupt occurred.

16-bit operations

Although the 8085 is an 8-bit processor, it also has some 16-bit operations. Any of the three 16-bit register pairs (BC, DE, HL) or SP could be loaded with an immediate 16-bit value (using LXI), incremented or decremented (using INX and DCX), or added to HL (using DAD). LHLD loaded HL from directly-addressed memory and SHLD stored HL likewise. The XCHG operation exchanges the values of HL and DE. Adding HL to itself performs a 16-bit arithmetical left shift with one instruction. The only 16 bit instruction that affects any flag was DAD (adding HL to BC, DE, HL or SP), which updates the carry flag to facilitate 24-bit or larger additions and left shifts (for a floating point mantissa for instance). Adding the stack pointer to HL is useful for indexing variables in (recursive) stack frames. A stack frame can be allocated using DAD SP and SPHL, and a branch to a computed pointer can be done with PCHL. These abilities make it feasible to compile languages such as PL/M, Pascal, or C with 16-bit variables and produce 8085 machine code.
Subtraction and bitwise logical operations on 16 bits is done in 8-bit steps. Operations that have to be implemented by program code (subroutine libraries) included comparisons of signed integers as well as multiply and divide.

Input/output scheme

The 8085 supported up to 256 input/output (I/O) ports, accessed via dedicated Input/Output instructions—taking port addresses as operands. This Input/Output mapping scheme was regarded as an advantage, as it freed up the processor's limited address space.

Development system

Intel produced a series of development systems for the 8080 and 8085, known as the MDS-80 Microprocessor System. The original development system had an 8080 processor. Later 8085 and 8086 support was added including ICE (in-circuit emulators). It was a large and heavy desktop box, about a 20" cube (in the Intel corporate blue colour) which included a CPU, monitor, and a single 8 inch floppy disk drive. Later an external box was available with two more floppy drives. It ran the ISIS operating system and could also operate an emulator pod and an external EPROM programmer. This unit used the Multibus card cage which was intended just for the development system. A surprising number of spare card cages and processors were being sold, leading to the development of the Multibus as a separate product.
The later iPDS was a portable unit, about 8" x 16" x 20", with a handle. It had a small green screen, a keyboard built into the top, a 5¼ inch floppy disk drive, and ran the ISIS-II operating system. It could also accept a second 8085 processor, allowing a limited form of multi-processor operation where both processors ran simultaneously and independently. The screen and keyboard could be switched between them, allowing programs to be assembled on one processor (large programs took awhile) while files were edited in the other. It had a bubble memory option and various programming modules, including EPROM and Intel 8048 and 8051 programming modules which were plugged into the side, replacing stand-alone device programmers. In addition to an 8080/8085 assembler, Intel produced a number of compilers including PL/M-80 and Pascal languages, and a set of tools for linking and statically locating programs to enable them to be burnt into EPROMs and used in embedded systems.

Application of Microprocessor

Microprocessor is a multi-use device which finds applications in almost all the fields.Here is some sample applications given in variety of fields.
Electronics:
  • Digital clocks & Watches
  • Mobile phones
  • Measuring Meters
Mechanical:
  • Automobiles
  • Lathes
  • All remote machines
Electrical:
  • Motors
  • Lighting controls
  • Power stations
Medical:
  • Patient monitoring
  • Most of the Medical equipments
  • Data loggers
Computer:
  • All computer accessories
  • Laptops & Modems
  • Scanners & Printers
Domestic:
  • Microwave Ovens
  • Television/CD/DVD players
  • Washing Machines

Detail about 8085 microprocessor

what is a Microprocessor?
  • A microprocessor is a clock-driven semiconductor device consisting of electronic logic circuits manufactured by using either a large-scale integration (LSI) or very-large-scale integration (VLSI) technique.
  • The microprocessor is capable of performing various computing functions and making decisions to change the sequence of program execution.
  • In large computers, a CPU performs these computing functions.The Microprocessor resembles a CPU exactly.
  • The microprocessor is in many ways similar to the CPU, but includes all the logic circuitry including the control unit, on one chip.
  • The microprocessor can be divided into three segments for the sake of clarity. – They are: arithmetic/logic unit (ALU), register array, and control unit.
  • A comparison between a microprocessor, and a computer is shown below:
    • Arithmetic/Logic Unit: This is the area of the microprocessor where various computing functions are performed on data. The ALU unit performs such arithmetic operations as addition and subtraction, and such logic operations as AND, OR, and exclusive OR.
    • Register Array: This area of the microprocessor consists of various registers identified by letters such as B, C, D, E, H, and L. These registers are primarily used to store data temporarily during the execution of a program and are accessible to the user through instructions.
    • Control Unit: The control unit provides the necessary timing and control signals to all the operations in the microcomputer. It controls the flow of data between the microprocessor and memory and peripherals.
    • Memory: Memory stores such binary information as instructions and data, and provides that information to the microprocessor whenever necessary. To execute programs, the microprocessor reads instructions and data from memory and performs the computing operations in its ALU section. Results are either transferred to the output section for display or stored in memory for later use. Read-Only memory (ROM) and Read/Write memory (R/WM), popularly known as Random- Access memory (RAM).
    1. The ROM is used to store programs that do not need alterations. The monitor program of a single-board microcomputer is generally stored in the ROM. This program interprets the informat entered through a keyboard and provides equivalent binary digits to the microprocessor. Programs stored in the ROM can only be read; they cannot be altered.
    2. The Read/Write memory (RIWM) is also known as user memory It is used to store user programs and data. In single-board microcomputers, the monitor program monitors the Hex keys and stores those instructions and data in the R/W memory. The information stored in this memory can be easily read and altered.
    • I/O (Input/Output): It communicates with the outside world. I/O includes two types of devices: input and output; these I/O devices are also known as peripherals. 
      System Bus: The system bus is a communication path between the microprocessor and peripherals: it is nothing but a group of wires to carry bits.


     

Digital Dice With 7-Segment Display

A digital dice circuit can be easily realised using an astable oscillator circuit followed by a counter, display driver and a display. Here we have used a timer NE555 as an astable oscillator with a frequency of about 100 Hz. Decade counter IC CD4026 or CD4033 (which-ever available) can be used as counter-cum-display driver. When using CD4026, pin 14 (cascading output) is to be left unused (open), but in case of CD4033, pin 14 serves as lamp test pin and the same is to be grounded.
The circuit uses only a handful of components. Its power consumption is also quite low because of use of CMOS ICs, and hence it is well suited for battery operation. In this circuit two tactile switches S1 and S2 have been pro-vided. While switch S2 is used for initial resetting of the display to ‘0,’ depression of S1 simulates throwing of the dice by a player.
When battery is connected to the circuit, the counter and display section around IC2 (CD4026/4033) is energised and the display would normally show ‘0’, as no clock input is available. Should the display show any other decimal digit, you may press re-set switch S2 so that display shows ‘0’. To simulate throwing of dice, the player has to press switch S1, briefly. This ex-tends the supply to the astable oscillator configured around IC1 as well as capacitor C1 (through resistor R1), which charges to the battery voltage. Thus even after switch S1 is released, the astable circuit around IC1 keeps producing the clock until capacitor C1 discharges sufficiently. Thus for du-ration of depression of switch S1 and discharge of capacitor C1 thereafter, clock pulses are produced by IC1 and applied to clock pin 1 of counter IC2, whose count advances at a frequency of 100 Hz until C1 discharges sufficiently to deactivate IC1.
When the oscillations from IC1 stop, the last (random) count in counter IC2 can be viewed on the 7-segment display. This count would normally lie between 0 and 6, since at the leading edge of every 7th clock pulse, the counter is reset to zero. This is achieved as follows.
Observe the behavior of ‘b’ segment output in the Table. On reset, at count 0 until count 4, the segment ‘b’ output is high. At count 5 it changes to low level and remains so during count 6. However, at start of count 7, the output goes from low to high state. A differentiated sharp high pulse through C-R combination of C4-R5 is applied to reset pin 15 of IC2 to reset the output to ‘0’ for a fraction of a pulse period (which is not visible on the 7-segment display). Thus, if the clock stops at seventh count, the display will read zero. There is a probability of one chance in seven that display would show ‘0.’ In such a situation, the concerned player is given an-other chance until the display is non-zero. 

Monday 11 June 2012

Courtesy Light Circuit

This circuit is intended to let the user turn off a lamp by means of a switch placed far from bed, allowing him enough time to lie down before the lamp really switches off. Obviously, users will be able to find different applications for this circuit in order to suit their needs.
Due to the low current drawing, the circuit can be supplied from 220Vac mains without a transformer. Supply voltage is reduced to 10Vdc by means of C1 reactance, a two diode rectifier cell D1 & D2 and Zener diode D3. IC1 is a CMos 555 timer wired as a monostable, providing 15 seconds on-time set by R3 & C4. When SW1 is closed, IC1 output (pin 3) is permanently on, driving Triac D4 which in turn feeds the lamp. Opening SW1 operates the monostable and, after 15 seconds, pin 3 of IC1 goes low switching off the lamp.
Notes:
  • The circuit is wired permanently to the mains supply but current drain is negligible.
  • Due to transformerless design there is no heat generation.
  • The delay time can be varied changing R3 and/or C4 values.
  • Taking C4=10µF, R3 increases timing with approx. 100K per second ratio. I.e. R3=1M Time=10 seconds, R3=1M8 Time=18 seconds.
  • Low Gate-current Triacs are recommended.
  • Use a well insulated mains-type switch for SW1.

Car Central Locking System

For a few pounds you can buy a kit from any automotive accessory shop that will allow your car to be fitted with a central-locking door system. Such a kit essentially comprises a number of motors. There is also a control unit that enables the whole system to function. Here we show an example of such a unit. There are 5-wire motors and 2-wire motors. The 5-wire version is used in doors that have a key-lock.
There are 2 connections for the motor itself and 3 connections for the sensor part (an ‘open’ and a ‘close’ contact). These sensors determine whether the door is to be unlocked or locked. If there is no key lock in the door, these sensors are superfluous and a 2-wire motor can be used.
The polarity of the motor determines whether the locking mechanism goes up or down. By making a circuit that simply reverses the polarity of the motor, the door can be either locked or unlocked. The winding of the motor is connected between M1 and M2 in the schematic. When relay Re1 is energised, all motors will, for example, rotate anti-clockwise. By activating Re2 the motors will rotate clockwise. This depends on the actual polarity of the motor, of course.
The sensors are connected to R1 and R10. Here you have to pay careful attention. If Re1 causes the door to unlock, then Re1 has must obviously be connected to the ‘open’ contact. In that case, Re2 is for locking the doors and R10 is then connected to the ‘close’ contact. The R/C-combinations R16/C3 and R15/C4 ensure that the relays are energised for a certain amount of time (obviously this can be changed if this time is too short or too long for your doors).

Saturday 9 June 2012

Simple Mat Switch Circuit

This simple circuit produces a warning beep when somebody crosses a protected area in your home or office. The switch, hidden be-low the floor mat, triggers the alarm when the person walks over it.

The circuit uses a conductive foam as the switch. It can be two small pieces of conductive pads usually used to pack sensitive ICs as antistatic cover. Alternatively, you can make the switch by coating conducting carbon ink on two small pieces of a copper-clad board.
When the circuit is in standby mode, transistor T1 does not conduct, since its base is floating. When the person walks, the switch is pressed and current flows through R1 and the switch to provide positive bias to transistor T1. Transistor T1 conducts and its collector voltage drops, which acts as a negative trigger input for the monostable wired around IC NE555 (IC1).

IC1 outputs a pulse of fifty-seconds duration with preset values of R4 and C3. This pulse is applied to the buzzer through transistor T2. The buzzer sounds a warning beep on unauthorised entry. The pulse duration can be changed to the desired value by changing the values of R4 and C3. Resistor R2 in the circuit makes the trigger pin of IC1 high to prevent false triggering.

Assemble the circuit on a general-purpose PCB and enclose in a plastic case. Use a 9V battery to power the circuit. Connect the touchpad switch with the PCB and hide under the mat at the entrance. The PCB can be mounted on the nearby wall.

Make the switch carefully using conducting foam or copper clad coated with conducting ink. Place the two pieces with their conducting surface facing each other. Solder carefully a thin copper electric wire and ensure that it makes contact when the two plates touch together on pressing. Provide two 1cm rubber tabs between the plates to avoid touch in the standby mode.

Simple Car Alarm Sound Booster

For car alarms, emphasis should be put on hearing the audible alert and identifying it as belonging to your 'wheels'. Unfortunately, modern car alarm systems seem to have more or less the same alarm sound especially if they are from the same brand. Also, to comply with legal noise restrictions, the alarm sound is not always loud enough to be heard if the car is parked down the road.

The circuit shown here is designed to help boost the alarm sound by also activating the car's horn(s) when the alarm goes off. lnternally the car alarm system often provides a signal that activates the (optional) engine immobilizer and/or volume (ultrasound) sensors. This signal usually goes Low upon sys-tem triggering and high again when the alarm system is deactivated.
The alarm activation signal is fed to the circuit through Dl . When in idle state, T1 's gate is High and consequently the FET conducts,  keeping  power  FET T2 firmly switched off. When the  system gets an  active  low signal, T1  switches  off allowing  timing  capacitor C2 to charge  via  R2. About 15 seconds later, when the voltage across C2 is high enough, T2 starts to conduct and relay RE1 is energized. This, in turn, provides the required path for the 'lights flashing' signal to energize RE2 and feed battery power to the car's horn(s).
When the alarm system is turned off the activation signal returns to High. T1 starts to conduct and rapidly discharges C2 via R3. T2 is then cut off and REl is de-energized. Diode D2 suppresses back EMF from REl.
The circuit draws less than 2 mA when idling. When activated the circuit's current consumption is virtually that of the RE1 coil. RE1 is any simple SPST or SPDT relay, capable of switching  about 0.5 A (at 12 V). The coil rating is for 12 VDC and a current requirement as low as you can find. Fuse F1 should be a slow blow type and rated about twice RE1's coil current.
The B5.170 in position T2 can sink a continuous current of about 0.5  A. However, a value of 1.2 A pulsed is specified by Fairchild  for their devices. To keep the FET's d-s current due to C2 discharging within safe limits, R2 may be increased, C2 decreased and R3 increased, all proportionally. A factor of 2 will keep the FET out of harm's way with maybe a slight change in the 15-second delay and the sensitivity of the circuit. C1 is used as a smoothing capacitor and F2 should be rated in accordance with the horn(s) maximum current draw.

Thursday 7 June 2012

Short-Wave Superregenerative Receiver


Superregenerative receivers are characterised by their high sensitivity. The purpose of this experiment is to deter-mine whether they are also suitable for short-wave radio. Superregenerative receivers are relatively easy to build. You start by building a RF oscillator for the desired frequency. The only difference between a superregenerative receiver and an oscillator is in the base circuit. Instead of using a voltage divider, here we use a single, relatively high-resistance base resistor (100 kΩ to 1MΩ).
Superregenerative oscillation occurs when the amplitude of the oscillation is sufficient to cause a strong negative charge to be applied repeatedly to the base. If the regeneration frequency is audible, adjust the values of the resistors and capacitors until it lies somewhere above 20 kHz. The optimum setting is when you hear a strong hissing sound. The subsequent audio amplifier should have a low upper cutoff frequency to strongly attenuate the regeneration signal at its output while allowing signals in the audio band to pass through. This experimental circuit uses two transistors. A Walkman headphone with two 32-Ω earphones forms a suitable output device
The component values shown in the schematic diagram have proven to be suitable for the 10–20 MHz region. The coil consists of 27 turns wound on an AA battery serving as a winding form. The circuit produces a strong hissing sound, which diminishes when a station is received. The radio is so sensitive that it does not require any antenna to be connected. The tuned circuit by itself is enough to receive a large number of European stations. The circuit is usable with a supply voltage of 3 V or more, although the audio volume is greater at 9 V.
One of the major advantages of a superregenerative receiver is that weak and strong stations generate the same audio level, with the only difference being in the signal to noise ratio. That makes a volume control entirely unnecessary. However, there is also a specific drawback in the short-wave bands: interference occurs fairly often if there is an adjacent station separated from the desired station by some-thing close to the regeneration frequency. The sound quality is often worse than with a simple regenerative receiver. However, this is offset by the absence of the need for manual feedback adjustment, which can be difficult.


Room Noise Detector Schematic Circuit

This circuit is intended to signal, through a flashing LED, the exceeding of a fixed threshold in room noise, chosen from three fixed levels, namely 50, 70 & 85 dB. Two Op-amps provide the necessary circuit gain for sounds picked-up by a miniature electret microphone to drive a LED. With SW1 in the first position the circuit is off. Second, third and fourth positions power the circuit and set the input sensitivity threshold to 85, 70 & 50 dB respectively. Current drawing is 1mA with LED off and 12-15mA when the LED is steady on.
Parts List :

R1____________10K 1/4W Resistor
R2,R3_________22K 1/4W Resistors
R4___________100K 1/4W Resistor
R5,R9,R10_____56K 1/4W Resistors
R6_____________5K6 1/4W Resistor
R7___________560R 1/4W Resistor
R8_____________2K2 1/4W Resistor
R11____________1K 1/4W Resistor
R12___________33K 1/4W Resistor
R13__________330R 1/4W Resistor

C1___________100nF 63V Polyester Capacitor
C2____________10µF 25V Electrolytic Capacitor
C3___________470µF 25V Electrolytic Capacitor
C4____________47µF 25V Electrolytic Capacitor

D1_____________5mm. Red LED

IC1__________LM358 Low Power Dual Op-amp

Q1___________BC327 45V 800mA PNP Transistor

MIC1_________Miniature electret microphone

SW1__________2 poles 4 ways rotary switch

B1___________9V PP3 Battery

Clip for PP3 Battery

Use :
  • Place the small box containing the circuit in the room where you intend to measure ambient noise.
  • The 50 dB setting is provided to monitor the noise in the bedroom at night. If the LED is steady on, or flashes bright often, then your bedroom is inadequate and too noisy for sleep.
  • The 70 dB setting is for living-rooms. If this level is often exceeded during the day, your apartment is rather uncomfortable.
  • If noise level is constantly over 85 dB, 8 hours a day, then you are living in a dangerous environment.

In-Car Food And Beverage Warmer

This is a very useful device for those who are frequently on the move. It will keep your tea, coffee or food warm while consuming little power.  The circuit is simple. The ubiquitous timer 555 is used as a free-running astable multivibrator. Diodes 1N4148 are connected in reverse direction to facilitate maximum variation of the duty cycles

Power transistor T1 is Darlington type with 5A capacity and output of more than 60 watts. The chosen discrete components assure fixed frequency of 1 Hz (approximately) at pin 3 of timer IC1 (555). Resister R1 and potmeter VR1 (1-mega-ohm) allow adjustment of the duty cycle. The higher the duty cycle, the higher the output of the heater.
You can connect up to five 10W heating elements in parallel, totaling 50 watts. The consumption of current will be significantly less if fewer coil elements are connected in parallel through toggle switches S2 through S4. Each of these switches has a 6A rating.
Assemble the circuit on a general-purpose PCB. Mount power transistor TIP120 on a thick heat-sink. Isolate the circuit from the heating elements using only two wire connections. Use wires that can carry more than 6A current. Fix the coil elements below an aluminium or steel rectangular plate which is at least 1mm thick. Do not forget to insulate the heating plate from the elements. Use the car battery for the power supply with a proper current-carrying-capacity wire.

Remote Washing Machine Alert

It is often the case these days that the washing machine and  tumble dryer are installed in an outbuilding  or corner of a garage. This not only makes the kitchen a much quieter place but also leaves room for a dish washer and gives additional cupboard space. The problem now is how to tell when the wash cycle is finished. In bad weather you don’t want to make too many fruitless trips down the garden path just to check if the wash cycle is finished. The author was faced with this problem when he remembered a spare wireless door chime he had. With a few additional components and a phototransistor to passively detect when the washing machine’s ‘end’ LED comes on, the problem was solved.

C1 smoothes out any fluctuations in the LED light output (they are often driven by a multiplex signal) producing a more stable DC voltage to inputs 2 and 6 of IC1. The circuit is battery powered so the CMOS version of the familiar 555 timer is used for IC1 and IC2. The output of IC1 (pin 3) keeps IC2 reset (pin 4) held Low while there is no light falling on T1. When the wash cycle is finished the LED lights, causing T1 to conduct and the voltage on C1 starts to fall. Changing  the value of R1 will increase sensitivity if the LED is not bright enough.
When the voltage on C1 falls  below 1/3 of the supply volt-age IC1 switches its output  (pin 3) High, removing the  reset from IC2. T2 conducts  and LED D1 is now lit, sup-plying current to charge C2.  When  the  voltage  across  C2 reaches 2/3 supply IC2  switches its output Low and  C2 is now discharged by pin  7 via R3. The discharge time  is roughly one minute before  the transistor is again switched on. The process repeats as long as light is falling on T1.
Transistor T2 is a general-purpose small signal NPN type. The open collector output is  wired directly in parallel with the bell push  (which still functions if the transistor is not  switched on). Ensure that transistor output is  wired to the correct bell push terminal (not the side connected to the negative battery  terminal).
Each timer consumes about 60 µA quiescent and the circuit can be powered from the transmitter battery. Alternatively a 9 V battery can be substituted; it has much greater capacity than the original mini 12 V battery fitted in the bell push. Before you start construction, check the range of the wireless doorbell to make sure  the signal reaches from the washing machine to wherever the bell will be fitted.

Wednesday 6 June 2012

LED Bicycle Lights

Before getting started an acknowledgement is due, the circuit presented here uses an ingenious method of controlling a flyback  converter by the voltage developed on a cur-rent sensing resistor.


The reworked circuit is quite simple. At the instant that power is applied only a small current flows to charge C4 so insufficient voltage is developed on R3 to switch T2 on. Also, D1 allows C2 to charge from the 6 V battery, so  R1 feeds enough voltage to switch on T1 this shunts the voltage across L1 and the current in it starts to rise. At a certain point the  current which returns via R3 will develop sufficient voltage to switch on T2 which shunts the gate voltage to T1 causing it to switch off,  initiating the flyback voltage from L1. The fly-back pulse forces a current around the circuit,  charging C4 and feeding the LEDs.
As the return current is via the current sensing resistor R3, this keeps T2 turned on and T1 turned  off, so the flyback phase is not clamped until it has given up all its energy. Capacitor C3 provides positive feedback to ensure reliable oscillation and sharpen up the switching edges. Components D1, D2 & C2 form a bootstrap boost circuit for the MOSFET gate, although it is logic level it only guarantees the stated RD-S(on) at a Vg level of about 8 V — by happy coincidence the combined Vf of four ultrabright red LEDs is about 8.8 V and  this is the value that the output is normally clamped to.

There are some notes on the components specified. For position T1 an n-channel MOS- FET with a very low RD-S(on) of 15 mΩ (at 10 V) Is suggested, although its high ID rating (35 A) is not strictly necessary. Purists may wish to use Schottky barrier diodes for D2 and D4, but a quick look at the data sheet for the popular BAT85 shows that with a Trr of 4 ns it is not actually any faster than the 1N4148. It is doubtful whether the lower Vf would make any noticeable difference.

Zener diode D5 has been included as a safety measure in case the output should ever find  itself open circuit. The flyback converter can  develop a quite impressive voltage when  run without load and would have no difficulty damaging the MOSFET. If a higher voltage MOSFET is used then C4 could easily fall  prey to excessive voltage if the lead to the LED breaks. In the final working prototype D5 was a 1.3-watt 22-volt zener, but any value  between 18 and 24 V is fine. Bear in mind that with four white LEDs on the output the voltage will be somewhere in the region of 13 V. L1 is a 9 mm diameter 0.56 A 220 µH inductor with a low DC resistance (Farnell # 8094837); don’t even think about using those small axial lead inductors disguised as resistors even the fat ones last only a few seconds before failing with shorted turns.
On R3, this resistor is selected depending on  the configuration of LEDs. A value of 20 mA  is fairly typical for 5 mm LEDs, on this basis four red LEDs will need about 12 Ω; five red  LEDs about 10 Ω, and four white LEDs about 6.8 Ω. Resistor R4 (1 Ω 1%) is provided to use as a temporary connection for the LEDs’ negative lead so the volt drop can be measured to indicate the current flowing during setting the correct LED current by adjusting R3. The efficiency of the circuit depends on the LED current, which also determines to some extent the switching frequency. At 10 mA (4 white LEDs) 170 kHz was measured on the prototype and that’s about the maximum  normal electrolytic capacitors are able to withstand. If more current is drawn (e.g. three white LEDs at 30 mA) then the switching frequency drops to about 130 kHz and the efficiency rises to around 75%.  The circuit is simple enough to construct on stripboard, which can be built as a single or  double unit to suit whatever lamp housings are ready to hand. The double unit should fit comfortably in a 2x D cell compartment and  the single board is only a whisker bigger than a single C cell.

Suggested lamp housings are the Ever Ready and the Ultralight but there should be many others that can be modified to house the stripboard. In many cases the hole for the bulb will need 4 notches cut with a round file so that the LEDs can be pushed far enough through. These can be secured in place with a spot of hot melt glue. The battery and switch box can be surprisingly challenging, the unit built for a family member went on a bicycle with a wire basket so it was easy to bolt a Maplin ABS project box to that. With only the tubular frame to fix things onto, it’s not so easy. The  authors’ battery box for the present project  is an old Halfords lamp the one that drops  into a U shaped plastic clip that does nothing to deter thieves, but it’s far more secure when cut down to make a battery box and clamped to the handlebar with a jubilee clip. It easily holds a 6 V 1.3 Ah SLA battery from  Maplin but any nominal 6 V type can be used as per individual preference. Deep discharging should be prevented.