Wednesday, August 6, 2008

Digital Combination Lock



The circuit above above makes use of the CMOS 4017 decade counter IC. Each depression of a switch steps the output through 0 - 9. By coupling the output via an AND gate to the next IC, a predefined code has to be input to create the output. Each PBS switch is debounced by two gates of a CMOS4001 quad 2-input NOR gate. This ensures a clean pulse to the input of each CMOS 4017 counter. Only when the correct number of presses at PBS A will allow PBS B to become active. This is similar for PBS C and PBS D. At IC4, PBS D must be pressed 7 times. Then PBS C is again pressed 7 times, stepping from output 1 to output 8. The AND gate formed around CMOS4081 then goes high, lighting the LED. The Reset switch can be pressed at any time. Power on reset is provided by the 100n capacitor near the reset switch.

Electronic Keypad



The IC is a quad 2 input "AND" gate, a CMOS 4081. These gates only produce a HIGH output, when BOTH the inputs are HIGH. When the key wired to 'E' is pressed, current through R1 and D1 switchs Q5 on.The relay energises; and Q5 is 'latched on' by R8. Thus, the Alarm is set by pressing a single key,say one of the two non-numeric symbols.

The alarm will switch off when the 4 keys connected to "A,B,C,D" are pushed in the right order.The circuit works because each gate 'Stands' upon its predecessor.If any key other than the correct key is pushed, then gate 1 is knocked out of the stack, and the code entry fails. Pin 1 is held high by R4. This 'Enables' gate 1; and when button 'A' is pressed, the output at pin 3 will go high. This output does two jobs.It locks itself 'ON' through R2 and it 'Enables' gate 2, by taking pin 5, high. Now, if 'B' is pressed, the output of gate 2, at pin 4 will go high. This output does two jobs. It locks itself 'ON' through R3 and it 'Enables' gate 3 by taking pin 12 high.
Now, if 'C' is pressed, the output of gate 3 will lock itself 'ON' through R5 and, by taking pin 8 high, 'Enable' gate 4. Pressing 'D' causes gate 4 to do the same thing; only this time its output, at pin 10, turns Q4 'ON'. This takes the base of Q5 to ground, switching it off and letting the relay drop out. This switches the alarm off.

Any keys not connected to 'A B C D E' are wired to the base of Q1. Whenever 'E' or one of these other keys is pressed, pin 1 is taken low and the circuit is reset. In addition, if 'C' or 'D' is pressed out of sequence, then Q2 or Q3 will take pin 1 low and the circuit will reset. Thus nothing happens until 'A' is pressed.Then if any key other than 'B' is pressed, the circuit will reset.
Similarly, after 'B', if any key other than 'C' is pressed,the circuit will reset. The same reasoning also applies to 'D'.
The Keypad needs to be the kind with a common terminal and a separate connection to each key. On a 12 key pad, look for 13 terminals. The matrix type with 7 terminals will NOT do. Wire the common to R1 and your chosen code to 'A B C D'. Wire 'E' to the key you want to use to switch the alarm on. All the rest go to the base of Q1.

The diagram should give you a rough guide to the layout of the components, if you are using a stripboard. The code you choose can include the non-numeric symbols.In fact, you do not have to use a numeric keypad at all,or you could make your own keypad.
I haven't calculated the number of combinations of codes available, but it should be in excess of 10 000 with a 12 key pad; and, after all, any potential intruder will be ignorant of the circuit's limitations. Of Course, if you must have a more secure code, I can think of no reason why you shouldn't add another 4081 and continue the process of enabling subsequent gates. Or you could simply use a bigger keypad with more "WRONG" keys.
Any small audio transistors should do. The 27k resistors could be replaced with values up to 100k. And the only requirements for the 4k7 resistors is that they protect the junctions while providing enough current to turn the transistors fully on.
Capacitors (C1 C2 C3 C4 C5) are there to slow response time and overcome any contact bounce. They are probably unnecessary.

Electronic Doorbell with Counter






Description:
This circuit uses a synthesized sound chip from Holtek, the HT-2811. This reproduces the sound of a "ding-dong" chiming doorbell. Additionally, the circuit includes a CMOS 4026 counter display driver IC to count your visitors.

Circuit Notes:
The Holtek HT-2811 is available from Maplin electronics in the UK, order code BH69A. The operating voltage must remain within 2.4 to 3.3 Vdc and standby current is minimal. The reset switch zeroes the count,and the 7 segment display is a common cathode type. To save power consumption the display can be enabled or disabled with a switch as shown in the above diagram. The count will still be held in memory. The IC pin out for the 4026 is shown in pin order below:

Pin 1 is the clock input
Pin 2 is the clock enable
Pin 3 is display enable
Pin 4 enables the carry output
Pin 5 is the carry output
Pin 6 is display segment f Pin 7 is display segment g
Pin 8 is 0 V.
Pin 9 is display segment d Pin 10 is display segment a
Pin 11 is display segment e Pin 12 is display segment b
Pin 13 is display segment c Pin 14 is the2 output
Pin 15 is reset
Pin 16 is +Vcc

The envelope of the chime is set by the 220k, 330k, 3u3 and 4u7 resistors and capacitors. These values are the manufactures default values, but may be adjusted to alter the length and delay of the chime.The combination of the 2k2, 22k and 47u resistor capacitor network has a double function. It provides a debouncing circuit for the bell press and at the same time has a sufficiently long time constant. This ensures that anyone rapidly pressing the doorbell switch, only advances the count once.The 47u capacitor may be increased in size, if needed.

Circuit Expansion:
The count may be expanded for up to 99 visits by cascading two CMOS 4026 IC's and using an additional 7 segment display. This is achieved by wiring pin 5 ( the 10's output ) of the first CMOS4026 to pin 1 (the clock input) of the second IC.

Transistor / Diode / IC (DIP) Outlines

Generating -5 Volts From a 9 Volt Battery


A 555 timer can be used to generate a squarewave to produce a negative voltage relative to the negative battery terminal. When the timer output at pin 3 goes positive, the series 22 uF capacitor charges through the diode (D1) to about 8 volts. When the output switches to ground, the 22 uF cap discharges through the second diode (D2) and charges the 100 uF capacitor to a negative voltage. The negative voltage can rise over several cycles to about -7 volts but is limited by the 5.1 volt zener diode which serves as a regulator. Circuit draws about 6 milliamps from the battery without the zener diode connected and about 18 milliamps connected. Output current available for the load is about 12 milliamps. An additional 5.1 volt zener and 330 ohm resistor could be used to regulate the +9 down to +5 at 12 mA if a symmetrical +/- 5 volt supply is needed. The battery drain would then be around 30 mA.

555 Tone Generator (8 ohm speaker)


This is a basic 555 squarewave oscillator used to produce a 1 Khz tone from an 8 ohm speaker. In the circuit on the left, the speaker is isolated from the oscillator by the NPN medium power transistor which also provides more current than can be obtained directly from the 555 (limit = 200 mA). A small capacitor is used at the transistor base to slow the switching times which reduces the inductive voltage produced by the speaker. Frequency is about 1.44/(R1 + 2*R2)C where R1 (1K) is much smaller than R2 (6.2K) to produce a near squarewave. Lower frequencies can be obtained by increasing the 6.2K value, higher frequencies will probably require a smaller capacitor as R1 cannot be reduced much below 1K. Lower volume levels can be obtained by adding a small resistor in series with the speaker (10-100 ohms). In the circuit on the right, the speaker is directly driven from the 555 timer output. The series capacitor (100 uF) increases the output by supplying an AC current to the speaker and driving it in both directions rather than just a pulsating DC current which would be the case without the capacitor. The 51 ohm resistor limits the current to less than 200 mA to prevent overloading the timer output at 9 volts. At 4.5 volts, a smaller resistor can be used.

Sunday, July 20, 2008

Car Water Temperature

Helical Notch Filter Schematic

4 MHz Amplitude Modulated Oscillator


• The only tuned component is the crystal operating in fundamental mode.

A while back I needed an amplitude modulated signal source at 4 MHz. This circuit was literally thrown together with parts laying on the bench. I built it dead bug style on a piece of copper clad board. It should work for you with little or no modification, other than the selection of the crystal, for use at other frequencies. At lower frequencies you might have to increase the capacitor values to get it to oscillate, and at higher frequencies, you might have to reduce the capacitor values a little. Just be aware that the crystal will be operating in its fundamental mode. Overtone crystals will work, but they will oscillator at their fundamental frequency.

Output level can be raised by biasing the audio amplifier's output stage to a higher voltage. This can be accomplished by placing a resistor from the base of the grounded-emitter transistor to ground. As voltage to the oscillator is increased, the voltage swing to achieve a given level of modulation will have to be increased as well.



The gain of the audiio amplifier is determined by the ratio of the 1 K ohm input resistor to the 56 k Ohm feedback resistor, and is limited by the open loop gain of the grounded-emitter stage. The open loop gain can be estimated by looking at the voltage drop across the 1 K ohm collector resistor. The voltage gain will be (in theory) about 38 X the voltage across the 1 K collector load. Thus, a 2 volt drop would give you an open loop gain of about 76:1 at audio frequencies, so the closed loop gain will be dominated by the feedback as described above.

The low frequency roll-off of the input singal will be approximately 1/(2Pi*3.3 uf * 1,000 Ohms ), which comes out to about 50 Hz. The input impedance of the amplifier at the summing node is sufficeintly low enough to allow as assumption of zero ohms to be sufficient for a design using 5% resistors .

Be aware that the antenna has DC on it and shorting the antenna to ground might destroy some of the parts. You can use a small (.001 uf for example) capacitor in series with the oscillator output if you want. If you use an antenna with this device, make is a really short one as RF emissions are regulated in most if not all countries. Besides, the waveform is pretty rich in harmonics.

This circuit generates a low power test signal and should not be used as a transmitter. Make sure you are within the law in the locality in which you operate this.

As this was built from parts laying on the bench, it isn't optimized, but it does demonstrate that it is very tolerant of component choice. A lot of small signal transistor will work. Look up the 2N4401 -its not that special.

Friday, July 18, 2008

Simple Electronic Lock Project


There are six (or more) push switches. To 'unlock' you must press all the correct ones at the same time, but not press any of the cancel switches. Pressing just one cancel switch will prevent the circuit unlocking. When the circuit unlocks it actually just turns on an LED for about one second, but it is intended to be adapted to turn on a relay which could be used to switch on another circuit.

Please Note: This circuit just turns on an LED for about one second when the correct switches are pressed. It does not actually lock or unlock anything!

Parts Required

* resistors: 470, 100k ×2, 1M
* capacitors: 0.1µF, 1µF 16V radial
* red LED
* 555 timer IC
* 8-pin DIL socket for IC
* on/off switch
* push-switch ×6 (or more)
* battery clip for 9V PP3
* stripboard 12 rows × 25 holes

Traffic Light Project


This project operates red, amber and green LEDs in the correct sequence for a single UK traffic light. The time taken for the complete red - red & amber - green - amber sequence can be varied from about 7s to about 2½ minutes by adjusting the 1M preset. Some amber LEDs emit light that is almost red so you may prefer to use a yellow LED.

The 555 astable circuit provides clock pulses for the 4017 counter which has ten outputs (Q0 to Q9). Each output becomes high in turn as the clock pulses are received. Appropriate outputs are combined with diodes to supply the amber and green LEDs. The red LED is connected to the ÷10 output which is high for the first 5 counts (Q0-Q4 high), this saves using 5 diodes for red and simplifies the circuit.

Parts Required

* resistors: 470 ×3, 22k, 100k
* capacitors: 0.1µF, 1µF 16V radial, 10µF 16V radial
* diodes: 1N4148 ×6
* LEDs: red, amber (or yellow), green
* 1M preset, horizontal
* 555 timer IC, such as NE555
* 4017 counter IC
* DIL sockets for ICs: 8-pin, 16-pin
* on/off switch
* battery clip for 9V PP3
* stripboard: 20 rows × 21 holes

Digital Dice




This digital dice project is an interesting project that will display in random the number from 1 to 9 on the 7 segment display. This is an alternative device that can be used to replace the traditional dice when you are playing games such as snake ladder, monopoly etc. The generation of clock is done by using a 555 timer which is connected in the astable mode at a frequency of approximately 50 Hz. This clock signal is fed into the decade counter which outputs are connected to 4 bit binary adder which provides a binary output equavalent to binary input + 1. The outputs are then connected to a BCD to 7 Segment Decoder which is used to drive a common anode 7 segment display.

As shown in the schematic above, when push button PB is pressed, a square output will be generated from the 555 timer which gives a frequency of approximately 50 Hz to the 7490 decade counter IC. The frequency of the astable 555 timer is calculated by using the standard formula of the timer.

f = 1.44/(1K + 2*1K)(0.01uF) = 48 Hz.

The output from the 555 timer is then connected to the input of U1 7490 decade counter. When the decade counter reach the count of 9, the outputs of QA and QD will go to logic "1" and the counter is reset. The 7447 BCD to 7 segment decoder is used to drive the 7 segment common anode display.

Automotive Speed Indicator


The speed of an automobile can be indicated by detecting the pulses generated by the ignition system and causing an LED to light. The circuit utilizes a quad NOR gate IC chip. Two of the gates are configured as a one shot multivibrator which produces a fixed duration pulse each time the primary circuit of the automobile ignition system opens the circuit to the ignition coil. The other 2 gates are used as buffers which provide an accurate rectangle pulse. As the number of pulses per second increases, the voltage fed to the base of of the NPN transistor becomes high enough to cause it to conduct and turn on the LED. The speed at which the LED lights is set by R4. The input of the circuit is connected to the distributor side of the ignition coil or to the tachometer connection on those cars that are equipped with electronic ignition.

Plant Moisture Meter


Stick the metal probes into a freshly watered plant and adjust R5 for a mid-scale meter deflection. The meter will monitor the soil wetness and the meter will indicate whether it is to moist or to dry. This circuit uses a dual power supply which could be created by two 9 volt batteries.

60 LED Clock


This project is based on the 4017 chip.
As you can see see we have changed the circuit a little. For example, the 4093 NAND gate is now set to exactly 1 second clock pulses. The clock rate is determined by the resistor and capacitor combination on the 4093. If the resistor is 220k ohms and the capacitor is 4.7uf then the output will be 1 second clock pulses. To increase the clock rate you should decrease the value of the resistor or capacitor. To decrease the clock rate you should increase the value of the resistor or capacitor. Please remember to ground all unused legs of the 4093 or noise in the circuit will occur and cause the clock to malfunction. Therefore, ground pins 5,6,8,9,12, and 13. To operate the circuit simply move the switch from STOP to RUN.

Touch Switch


This circuit uses a 555 timer as the bases of the touch switch. You can learn more about 555 timers in the Learning section on my site. When the plate is touched the 555 timer is triggered and the output on pin 3 goes high turning on the LED and the buzzer for a certain period of time. The time that the LED and the buzzer is on is based on the values of the capacitor and resistor connected to pin 6 & 7. The 10M resistor on pin 2 causes the the circuit to be very sensitive to the touch.

Funk Box

Phone In Use Indicator


With this circuit mounted in or near every phone in the house, it will allow users to know if the phone is being used and not to pick up the phone. When a phone is taken off hook, the voltage across the tip and ring terminals drops to 10 volts or less. This will cause the FET (2N4360) to turn on and also turn on the transistor (2N2222). When the transistor turns on it will allow current to flow through the LED and make it light. A blinking LED could be used to make the effect better.

Intercom


It is a simple intercom that anyone can put together and get to work. It is based on the LM380 IC chip. This chip is able to put out 2 watts of power if it is heat sink properly. The following pins should be grounded and attached to a foil to dissipate the heat. Pins 3,4,5,10,11,12 should all be grounded. The circuit works as follows. Switch 1 is a double pole double throw switch. In one position is the talk position and in the other is the listen position. In the diagram shown the switch is in the talk position for the speaker on the left. Talking into the speaker inputs a signal to the IC chip through the matching transformer T1. The output from the IC chip goes to the speaker on the right. If you put the switch in the other position the speaker on the right is the talking unit and the speaker on the left listens. Volume is controlled by the 1meg ohm pot R1.

Digital Thermometer using ATMega16 and 16*2 LCD


Abstract

Thermometer is used to measure temperature. This project is used to measure temperature and display digitally so, this project is known as digital thermometer . LM35, The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature, is used. ATMEGA16 is used in this project for calculation of temperature and 16 X 2 LCD is used for displaying temperature.

Why LM35 ?

The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 μA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a −55° to +150°C temperature range, while the LM35C is rated for a −40° to +110°C range.


Features
Calibrated directly in ° Celsius (Centigrade)
Linear + 10.0 mV/°C scale factor
0.5°C accuracy guaranteeable (at +25°C)
Rated for full −55° to +150°C range
Suitable for remote applications
Low cost due to wafer-level trimming
Operates from 4 to 30 volts
Less than 60 μA current drain
Low self-heating, 0.08°C in still air
Nonlinearity only ±1⁄4°C typical
Low impedance output, 0.1 W for 1 mA load

ATMEGA16

It is a low power CMOS 8-bit microcontroller based on AVR enhanced RISC architecture. By executing powerful instructions in single clock cycle, it achieves throughputs approaching 1 MIPS per MHz allowing system designer to optimize power consumption versus processing speed. It has four 8-bit bidirectional I/Os. It has 16K bytes of in-system programmable flash program memory with read while write capabilities, 512 Bytes EEPROM, 1K byte SRAM & 32 general purpose registors.

Working

As shown from figure components are soldered on PCB. When power supply is given to circuit, IC LM35 generates voltage according to the atmospheric temperature. This voltage is in analog form so it is given to the ADC0 port of microcontroller. It is ADC port so it converts analog voltage into digital form. We have written one algorithm in which this digital voltage is given as input and we get output as temperature in °Celsius. Also we have written one code that shows this temperature on LCD and horizontal bar whose length varies according to the temperature on LCD.

Programmer: - BascomAVR

Program:-

$regfile = "M16def.dat" ' use the Mega16

$crystal = 10000000

Deflcdchar 0 , 32 , 32 , 31 , 31 , 31 , 31 , 32 , 32 ' replace ? with number (0-7)'
Deflcdchar 3 , 16 , 16 , 31 , 31 , 31 , 31 , 16 , 16 ' replace ? with number (0-7)
Deflcdchar 4 , 1 , 1 , 31 , 31 , 31 , 31 , 1 , 1 ' replace ? with number (0-7)

Config Lcd = 16 * 2

Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.3 , Rs = Portb.2

Config Adc = Single , Prescaler = Auto , Reference = Avcc 'config ADC
Start Adc

Dim W As Word , Perc As Word , Volt As Word , Volt_d As Byte , Channel As Byte , I As Byte , Cols As Byte

Cls
Cursor On

Locate 1 , 1
Lcd "TEMP"

Do
W = Getadc(0)
Volt = W * 3
Volt_d = Volt Mod 10
Volt = Volt / 10
Locate 1 , 9
Lcd Volt ; "," ; Volt_d
Locate 1 , 13
Lcd "'C"


Cols = Volt / 2

Locate 2 , 1
For I = 1 To Cols
Select Case I
Case 1 : Lcd Chr(3)
Case 4 : Lcd Chr(4)
Case 8 : Lcd Chr(4)
Case 12 : Lcd Chr(4)
Case 16 : Lcd Chr(4)
Case Else : Lcd Chr(0)
End Select
Next I

Waitms 100

Loop
End

Sunday, June 22, 2008

Running Message Display


Light emitting diodes are advan- tageous due to their smaller size, low current consumption and catchy colours they emit. Here is a running message display circuit wherein the letters formed by LED arrangement light up progressively. Once all the letters of the message have been lit up, the circuit gets reset. The circuit is built around Johnson decade counter CD4017BC (IC2). One of the IC CD4017BE’s features is its provision of ten fully decoded outputs, making the IC ideal for use in a whole range of sequencing operations. In the circuit only one of the outputs remains high and the other outputs switch to high state successively on the arrival of each clock pulse. The timer NE555 (IC1) is wired as a 1Hz astable multivibrator which clocks the IC2 for sequencing operations. On reset, output pin 3 goes high and drives transistor T7 to ‘on’ state. The output of transistor T7 is connected to letter ‘W’ of the LED word array (all LEDs of letter array are connected in parallel) and thus letter ‘W’ is illuminated. On arrival of first clock pulse, pin 3 goes low and pin 2 goes high. Transistor T6 conducts and letter ‘E’ lights up. The preceding letter ‘W’ also remains lighted because of forward biasing of transistor T7 via diode D21. In a similar fashion, on the arrival of each successive pulse, the other letters of the display are also illuminated and finally the complete word becomes visible. On the following clock pulse, pin 6 goes to logic 1 and resets the circuit, and the sequence repeats itself. The frequency of sequencing operations is controlled with the help of potmeter VR1.
The display can be fixed on a veroboard of suitable size and connected to ground of a common supply (of 6V to 9V) while the anodes of LEDs are to be connected to emitters of transistors T1 through T7 as shown in the circuit. The above circuit is very versatile and can be wired with a large number of LEDs to make an LED fashion jewellery of any design. With two circuits connected in a similar fashion, multiplexing of LEDs can be done to give a moving display effect.