Sunday, November 8, 2009

Police Siren Project

This police siren simulated electronic project uses two 555 timers IC to generate a sound similar to the police siren. A single 556 timer IC which consists of two 555 timers can also be used. In this circuit, both of the timers are configured as astable circuit. The first timer is configured as a square wave close to 1 Hz astable oscillator. The output of this timer is used to feed the control voltage of the second timer where it is subjected to frequency modulation. This frequency modulation will generate a tone similar to the siren used by the police. The frequency of this tone generator can be varied by changing the value of potentiometer VR1. When set to its maximum value of 220k ohm, it will have a tone frequency of approximately 320 Hz.
Schematic Diagram
The schematic of the project is as shown below.

When S1 is switched ON, the circuit will be powered ON and U1 will start to oscillate at a frequency given by the formula:

f = 1.44/[(R1 + 2R2)(E1)]

= 1.44/[(10 + 2*82)(10)] Hz

= 0.8 Hz

This output frequency from pin 3 of U1 is fed into pin 5 of U2 where it is subjected to frequency modulation through resistor 10K. The tone generated can be varied by changing the values of potentiometer VR1. Experiment with the sound and settle with the best sound of your choice. The output of U2 is used to drive a power transistor which in turn drives an 8 ohm speaker. Diode D2 is used to prevent the damage of transistor Q1 due to the back emf generated by the speaker during the ON/OFF driving of the speaker.

Parts List
The parts list of the project is as shown below.



Timer circuit has been used in many projects and there are basically 2 types that are used these days. One of them is the use of analog RC circuit where charging of the capacitor circuit determined the T(time) of the circuitry. This type of circuitry has larger tolerance and is used in applications where the T is not so critical as the T is affected by the tolerance of the RC components used.
The other is the use of crystal or ceramic resonators together with microprocessor, microcontroller or application specific integrated circuit that need higher precision T in the tolerance of up to 5 ppm (parts per million).

555 IC
One commonly used circuit is the 555 IC which is a highly stable controller capable of producing timing pulses. With a monostable operation, the T(time) delay is controlled by one external resistor and one capacitor. With an astable operation, the frequency and duty cycle are accurately controlled by two external resistors and one capacitor. The application of this integrated circuit is in the areas of PRECISION TIMING, PULSE GENERATION, TIMING DELAY GENERATION and SEQUENTIAL TIMING.
A typical 555 IC block diagram is as shown below.

Monostable Operation
Figure below shows the monostable operation of a 555 IC.

In this mode, the device generates a fixed pulse whenever the trigger voltage falls below Vcc/3. When the trigger pulse voltage applied to pin 2 falls below Vcc/3 while the its output is low, its internal flip-flop turns the discharging transistor Tr off and causes the output to become high by charging the external capacitor C1 and setting the flip-flop output at the same instant. The voltage across the external capacitor C1, VC1 increases exponentially with the time constant T=RA*C1 and reaches 2Vcc/3 at td=1.1RA*C1. Hence, capacitor C1 is charged through resistor RA. The greater the time constant RA*C1, the longer it takes for the VC1 to reach 2Vcc/3. In other words, the time constant RA*C1 controls the output pulse width. When the applied voltage to the capacitor C1 reaches 2Vcc/3, the comparator on the trigger terminal resets the flip-flop, turning the discharging transistor Tr on. At this time, C1 begins to discharge and its output goes to low.
Astable Operation

An astable operation is achieved by configuring the circuit as shown above. In the astable operation, the trigger terminal and the threshold terminal are connected so that a self-trigger is formed, operating as a multivibrator. When its output is high, its internal discharging transistor Tr turns off and the VC1 increases by exponential function with the time constant (RA+RB)*C. When the VC1, or the threshold voltage, reaches 2Vcc/3, the comparator output on the trigger terminal becomes high, resetting the F/F and causing its output to become low. This in turn turns on the discharging transistor Tr and the C1 discharges through the discharging channel formed by RB and the discharging transistor Tr. When the VC1 falls below Vcc/3, the comparator output on the trigger terminal becomes high and the timer output becomes high again. The discharging transistor Tr turns off and the VC1 rises again. The frequency of oscillation is given as below.


Phone In Use Project

Phone In Use Project
This project is a simple phone in use indicator that one can design and construct that displays the status of the phone line. If the phone line is in use, the yellow LED will turn ON. If it is not in use, the green LED will turn ON. By having this indicator, the user of the phone will not be interrupted by another user who would want to use the same line. There are altogether 13 electronic parts that are used. They are 4 diodes, 2 LEDs, 5 resistors and 2 NPN transistors.

Circuit Description

When the phone is in on-hook condition, the voltage across the tip and ring is in the range of 48V DC to 50V DC. When it is in off-hook condition (the receiver is taken off its hook), the voltage drops to the range of 6V DC to 15V DC.
As shown in the circuit, diodes D1, D2, D3 and D4 are used to ensure that in the event that the tip and ring of the telephone line is reversed, the circuit can still be used. When the telephones connected to this line are on-hook, there is enough voltage to turn on transistor Q2 through voltage divider R4 and R5. When Q2 is ON, the green LED L2 will slightly turn ON which indicates that the phone line is not in use.
When the telephone goes to off-hook condition, Q2 will turn OFF. This allows current to flow through transistor Q1 causing yellow LED L1 to turn ON.
When the phone is ringing, both the LEDs will flash.
Parts List


Friday, October 16, 2009

Constructing your own 3V FM Transmitter

This project provides the schematic and the parts list needed to construct a 3V FM Transmitter. This FM transmitter is about the simplest and most basic transmitter to build and have a useful transmitting range. It is surprisingly powerful despite its small component count and 3V operating voltage. It will easily penetrate over three floors of an apartment building and go over 300 meters in the open air.
It may be tuned anywhere in the FM band. Or it may be tuned outside the commercial M band for greater privacy. (Of course this means you must modify your FM radio to be able to receive the transmission or have a broad-band FM receiver.) The output power of this FM transmitter is below the legal limits of many countries (eg, USA and Australia). However, some countries may ban ALL wireless transmissions without a licence. It is the responsibility of the constructor to check the legal requirements for the operation of this kit and to obey them.


The circuit is basically a radio frequency (RF) oscillator that operates around 100 MHz. Audio picked up and amplified by the electret microphone is fed into the audio amplifier stage built around the first transistor. Output from the collector is fed into the base of the second transistor where it modulates the resonant frequency of the tank circuit (the 5 turn coil and the trimcap) by varying the junction capacitance of the transistor. Junction capacitance is a function of the potential difference applied to the base of the transistor. The tank circuit is connected in a Colpitts oscillator circuit.

The electret microphone: an electret is a permanently charged dielectric. It is made by heating a ceramic material, placing it in a magnetic field then allowing it to cool while still in the magnetic field. It is the electrostatic equivalent of a permanent magnet. In the electret microphone a slice of this material is used as part of the dielectric of a capacitor in which the diaphram of the microphone formsone plate. Sound pressure moves one of its plates. The movement of the plate changes the capacitance. The electret capacitor is connected to an FET amplifier. These microphones are small, have excellent sensitivity, a wide frequency response and a very low cost.
First amplification stage: this is a standard self-biasing common emitter amplifier. The 22nF capacitor isolates the microphone from the base voltage of the transistor and only allows alternating current (AC) signals to pass.
The tank (LC) circuit: every FM transmitter needs an oscillator to generate the radio Frequency (RF) carrier waves. The tank (LC) circuit, the BC547 and the feedback 5pF capacitor are the oscillator in the Cadre. An input signal is not needed to sustain the oscillation. The feedback signal makes the base-emitter current of the transistor vary at the resonant frequency. This causes the emitter-collector current to vary at the same frequency. This signal fed to the aerial and radiated as radio waves. The 27pF coupling capacitor on the aerial is to minimise the effect of the aerial capacitance on the LC circuit. The name 'tank' circuit comes from the ability of the LC circuit to store energy for oscillations. In a pure LC circuit (one with no resistance) energy cannot be lost. (In an AC network only the resistive elements will dissipate electrical energy. The purely reactive elements, the C and the L simply store energy to be returned to the system later.) Note that the tank circuit does not oscillate just by having a DC potential put across it. Positive feedback must be provided. (Look up Hartley and Colpitts oscillators in a reference book for more details.)
Components may be added to the PCB in any order. Note that the electret microphone should be inserted with the pin connected to the metal case connected to the negative rail (that is, to the ground or zero voltage side of the circuit). The coil should be about 3mm in diameter and 5 turns. The wire is tinned copper wire, 0.61 mm in diameter. After the coil in soldered into place spread the coils apart about 0.5 to 1mm so that they are not touching. (The spacing in not critical since tuning of the Tx will be done by the trim capacitor. It is quite possible, but not as convenient, to use a fixed value capacitor in place of the trimcapacitor - say 47pF - and to vary the Tx frequency by simply adjusting the spacing of the coils. That is by varying L of the LC circuit rather than C.) Adding and removing the batteries acts as a switch.Connect a half or quarter wavelength antenna (length of wire) to the aerial point. At an FM frequency of 100 MHz these lengths are 150 cm and 75 cm respectively.
Place the transmitter about 10 feet from a FM radio. Set the radio to somewhere about 89 - 90 MHz. Walk back to the FM transmitter and turn it on. Spread the winding of the coil apart by approximately 1mm from each other. No coil winding should be touching another winding. Use a small screw driver to tune the trim cap. Remove the screwdriver from the trim screw after every adjustment so the LC circuit is not affected by stray capicitance. Or use a plastic screwdriver. If you have difficulty finding the transmitting frequency then have a second person tune up and down the FM dial after every adjustment. One full turn of the trim cap will cover its full range of capacitance from 6pF to 45pF. The normal FM band tunes in over about one tenth of the full range of the tuning cap.
So it is best to adjust it in steps of 5 to 10 degrees at each turn. So tuning takes a little patience but is not difficult. The reason that there must be at least 10 ft. separation between the radio and the FM transmitter is that the FM transmitter emits harmonics; it does not only emit on one frequency but on several different frequencies close to each other. You should have little difficulty in finding the Tx frequency when you follow this procedure.

It should already be clear from the above circuit description that there is a surprising amount of electronics which may be learnt from this deceptively simple kit. Here is a list of some advanced topics in electronics which can be demonstrated or have their beginnings in this project:
Class C amplifiers; FM transmission; VHF antennas; positive and negative feedback; stray capacitance; crystal-locked oscillators; signal attenuation The simple halfwave antenna used in the project is not the most efficient. Greater efficiency may be gained by connecting a dipole antenna using 50 ohm coaxial cable. Connect one lead to the Antenna point and the other to the earth line.
You may experiment using 6V or 9V with the circuit to see how this increases the range of the transmitter. The sensitivity may be increased by lowering the 22K resistor to 10K. Try it and see. Note that this FM transmitter is not suitable for use on your body, for example, in your pocket. This is because it is affected by external capacitance and the transmitting frequency drifts depending how close you are to it. Stray capacitance is automatically incorporated into the capacitance of the tank circuit which will shift the transmitting frequency.



Wednesday, October 14, 2009

Wire Loop Alarm

This circuit is a simple wire loop alarm that can be used in doorways, hallways, or any other place the tripwire will be broken by intruders. The circuit has a built in siren, but it can be replaced by a relay to drive an external siren, commercial alarm, etc.

R1           1              100K 1/2W 1% Resistor 
R2, R4    2              10K 1/2W 1% Resistor   
R3           1              1 Meg 1/2W 1% Resistor              
C1, C3    2              0.1uF Ceramic Disc Capacitor      
C2           1              0.01uF Ceramic Disc Capacitor   
IC1          1              4001UBE Quad 2-i/p NOR Gate 
Q1          1              MPSA14 Low Power NPN Transistor       
SIREN    1              Micro piezo siren 12V DC 150mA, 110dB @ 1M  
LOOP     1              See "Notes"      
MISC     1              Board, Wire, Socket For IC1       
  1. The loop can be any type of hookup wire, with a maximum resistance of about 90K. Using very thin wire (40AWG, for example) will make a very sensitive trip wire, but will shorten the distance it can be strung due to the high resistance.
  2. The siren can be replaced with a relay to drive external loads.

Sunday, October 4, 2009

LED Photo Sensor

Here's a circuit that takes advantage of the photo-voltaic voltage of an ordinary LED. The LED voltage is buffered by a junction FET transistor and then applied to the inverting input of an op-amp with a gain of about 20. This produces a change of about 5 volts at the output from darkness to bright light. The 100K potentiometer can be set so that the output is around 7 volts in darkness and falls to about 2 volts in bright light.


Low Frequency Sinewave Generators

The two circuits below illustrate generating low frequency sinewaves by shifting the phase of the signal through an RC network so that oscillation occurs where the total phase shift is 360 degrees. The transistor circuit on the right produces a reasonable sinewave at the collector of the 3904 which is buffered by the JFET to yield a low impedance output. The circuit gain is critical for low distortion and you may need to adjust the 500 ohm resistor to achieve a stable waveform with minimum distortion. The transistor circuit is not recommended for practical applications due to the critical adjustments needed.
The op-amp based phase shift oscillator is much more stable than the single transistor version since the gain can be set higher than needed to sustain oscillation and the output is taken from the RC network which filters out most of the harmonic distortion. The sinewave output from the RC network is buffered and the amplitude restored by the second (top) op-amp which has gain of around 28dB. Frequency is around 600 Hz for RC values shown (7.5K and 0.1uF) and can be reduced by proportionally increasing the network resistors (7.5K). The 7.5K value at pin 2 of the op-amp controls the oscillator circuit gain and is selected so that the output at pin 1 is slightly clipped at the positive and negative peaks. The sinewave output at pin 7 is about 5 volts p-p using a 12 volt supply and appears very clean on a scope since the RC network filters out most all distortion occurring at pin 1.


Tuesday, September 29, 2009

Microcontroller Based Electronic Thermostat Project

Electronic Thermostat
Mechanical thermostat has been around for a long time and has been used in industrial control, home appliances control and many other devices to measure and control the temperature of a certain processes. The sensor used usually is a bimetallic sensor that is make from two different metals that expand at different rates as they are heated up. These metal strips are bonded together and when the temperature rises, the strips will bend upward hence making connection to the contact of the circuit so that current can flow through the circuit.
As the temperature cools down, it will go back to its original position and disconnect the current from the circuit. By adjusting the strip and the contact, the temperature can be contolled. Most oven and air conditioners use this type of sensor. The mechanical thermostat is more widely used due to its lower cost compared to electronic thermostat.
The use of electronic thermostat is becoming more popular now as the cost of semiconductor continues to drop with the advancement of better fabrication and packaging processes. Many applications have switched to electronic control as the control of the temperature is more accurate, easier to control the desired temperature using digital technology, more reliable and interfacing with other devices.
This application note from Microchip uses a low cost 6 pin microcontroller in the design of electronic thermostat. The features of PIC10F204 are as shown below. One advantage is that it has the PDIP package which makes it easier for electronic hobbyists to do their own soldering.

  • 256 Words Program Memory and 16 bytes Static RAM
  • Wide Operating Voltage from 2.0V to 5.5V DC
  • 3 I/O
  • 1 comparator
  • 25 mA source/sink current I/O
  • 1 8-bit timers.

Among the learning experiences one gained from this projects are:
  • Power supply is directly tapped from the AC lines voltage using a resistive based power supply. This makes the entire circuit live and one has to be careful when implementing this project. Ensure that no parts of the circuit is accessible to any user. Use a plastic enclosure to house the printed circuit board properly.
  • The principles of triac is briefly discussed here. The use of zero crossing detection is useful as many applications use this method in their operations. Among them are light dimmer and motor control applications.
  • Learn how to optimise the program code to make it efficient. Many programmers use long routines to accomplish a certain task when a few lines of codes would be sufficient. This experience needs to be learned as one hands on a project and repeatedly look into the code to make it shorter and efficient.
  • Having learned the code, one can then modify and add temperature sensor to make it a close loop control. Display circuity and user interface can be added to the system by migration to a higher pin count microcontroller.

The full application note and source code of the Microcontroller Based Electronic Thermostat Project can be obtained from Microchip website.


Monday, September 28, 2009

Construct a two station Intercom

This intercom project provides the schematic and the parts list needed to construct a very simple wired two station Intercom. This project will help beginners to electronics understand one of the application of operational amplifers(OP AMP). In this case, the LM 386 operational amplifier is configured as an amplifier.
LM386 Low Voltage Audio Power Amplifier
The LM386 is a power amplifier designed for use in low voltage consumer applications. The gain is internally set to 20 to keep external part count low, but the addition of an external resistor and capacitor between pins 1 and 8 will increase the gain to any value from 20 to 200. The inputs are ground referenced while the output automatically biases to one-half the supply voltage. The quiescent power drain is only 24 milliwatts when operating from a 6 volt supply, making the LM386 ideal for battery operation.
a) Battery operation
b) Minimum external parts
c) Wide supply voltage range: 4V–12V or 5V–18V
d) Low quiescent current drain: 4mA
e) Voltage gains from 20 to 200
f) Ground referenced input
g) Self-centering output quiescent voltage
h) Low distortion: 0.2% (AV = 20, VS = 6V, RL = 8W, PO = 125mW, f = 1kHz)
i) Available in 8 pin MSOP package

a) AM-FM radio amplifiers
b) Portable tape player amplifiers
c) Intercoms
d) TV sound systems
e) Line drivers
f) Ultrasonic drivers
g) Small servo drivers
h) Power converters

Those who are adventurous can also configure one of them to be permanently ON which means it can be used as a remote listening microphone by just a simple soldering of the 2 points of the circuit.
You can find the CK204 Two Station Intercom kit here under the SURVEILLANCE AND SECURITY (SPY) category.


Construct a 6-15V Alarm

This project provides the schematic and the parts list needed to construct a very simple Alarm. This is a simple project and will help the beginners to electronics to understand one of the functions of 555 timers and one of their application. 556 timers has 2 of 555 timers.
General Description
The LM556 Dual timing circuit is a highly stable controller capable of producing accurate time delays or oscillation. The 556 is a dual 555. Timing is provided by an external resistor and capacitor for each timing function. The two timers operate independently of each other sharing only VCC and ground. The circuits may be triggered and reset on falling waveforms. The output structures may sink or source 200mA.
a) Direct replacement for SE556/NE556
b) Timing from microseconds through hours
c) Operates in both astable and monostable modes
d) Replaces two 555 timers
e) Adjustable duty cycle
f) Output can source or sink 200mA
g) Output and supply TTL compatible
h) Temperature stability better than 0.005% per °C
i) Normally on and normally off output

a) Precision timing
b) Pulse generation
c) Sequential timing
d) Time delay generation
e) Pulse width modulation
f) Pulse position modulation
g) Linear ramp generator

The Connection diagram of a typical LM556 Dual timer is as shown below.

You will learn what 110dB of alarm sounds like. The piezo elements is set to oscillate around their resonant frequency. The sound generated is very loud and it can hurt your ears, so do be careful.

You can find the CK216 6-15V Alarm Module kit here under the SURVEILLANCE AND SECURITY (SPY) category.


Analog Timing Light Project

Timing Light Project

This analog timing light project uses RC circuit as a delay OFF timer to control the duration an incandescent light turns ON. When the accuracy of a timer is not critical, the use of RC circuit is a good choice as it is more cost effective and simple. Once the normally open switch SW is pressed, the light will turn ON for a duration of 10 - 20 seconds before it turns OFF. The duration of the turn ON time can be varied by varying the values of R1, R2 and E1.
Schematic Diagram
The schematic of the project is as shown below.

When SW is pressed, the base of the transistor Q1 is forward bias and it turns ON. This turns ON the 12V relay that is connected to the transistor. The contact of the relay RLY must be able to withstand the current of the load. At the same time, the electrolytic capacitor E1 is being charged to a voltage of approximately 0.7V.
Once SW is released, E1 will discharged through resistor R2 and the base of the transistor. After some time, When the voltage across E1 drops to approximately 0.5V, the transistor will turn OFF. This in turn will cause the relay to turn OFF and the incandescent light will turn OFF. The timing of the turn OFF can be changed by changing the values of E1, R1 and R2.

Parts List
The parts list of the project is as shown below.


HVAC Thermostat

Introduction To HVAC Thermostat

HVAC thermostat has been one of the common device used in residential and industrial buildings to control the temperature of a space be it a warehouse, a room, a hall or an office. This thermostat project will focus on the heating control of a space that uses electric heater as its source of heating. It basically consists of a comparator that controls the ON and OFF of the electric heater based on the sensor temperature.
The control of the fan speed is usually hardwired with two speed or three speed motors and is incorporated into the thermostat. The temperature range of this thermostat is from 5 Celcius to 30 Celcius with a tolerance of approximately 3 degree Celcius. Hence, only non critical tolerance control of temperature control such as a room can be used.

Circuit Description
The circuit diagram shows the configuration of the HVAC thermostat. The LM358 Op Amp is used as a comparator to sense the inputs of the reference voltage (PIN 3) and room temperature (PIN 2). The thermistor used is a NTC (negative temperature coefficient) type where its resistance will drop when the temperature increases and vice versa. It has a resistance of 20K ohm at 25 degree Celcius. When the room temperature drops, the thermistor resistance will go up and hence the output of the operational amplifier will be low. This cause the relay to turn OFF and the heater will conduct until the temperature of the room rises again.

The circuit is calibrated using variable resistor VR1. Set the lever of the slide potentiometer or rotary potentiometer VR2 to 25 Celcius location. Place the thermistor at a space where the temperature is at 25 Celcius. By varying VR1, set the resistance at the position between the ON and OFF of the relay. Use a suitable contact relay rating according to the load of the heater.

Parts List


Constructing FM transmitters (89MHz - 109MHz)

This project provides the schematic and the parts list needed to construct FM transmitters with an operating frequency of 89MHz - 109MHz. You need a receiver to receive the signals from this transmitter. Typical radio tuned to FM range will be able to receive this signal.
A Frequency Modulated wave is a sine wave with a periodically varying instantaneous frequency and a constant amplitude. The average frequency is called the carrier frequency and the instantaneous frequency changes at the modulation frequency . The maximum excursion of the instantaneous frequency from the average is related to the modulation depth .
For a FM radio transmission, the carrier frequency would be the station you tune to, and you would hear a pure audio tone at the modulation frequency, with a loudness derived from the modulation depth.
Frequency modulation (FM) is the encoding of information in either analog or digital form into a carrier wave by variation of its instantaneous frequency in accordance with an input signal. This is typically accomplished using radio waves. The most typical use is radio broadcasting.
Frequency modulation requires a wider bandwidth than amplitude modulation by an equivalent modulating signal, but this also makes the signal more robust against interference. Frequency modulation is also more robust against simple signal amplitude fading phenomena. As a result, FM was chosen as the modulation standard for high frequency, high fidelity radio transmission: hence the term "FM radio". The FM modulation illustration is as shown in the diagram below.

When assembling the components into the PCB, be careful to cut the leads of components as short as possible because at high frequencies, leads will alter the capacitance and inductance of the circuits.
The output of the FM transmitters is approximately 9mW at 9V with the antenna tapped at position B. Tapping the antenna at position A will triple the range to 27mW.
You can find the CK217 9V FM Transmitters kit here under the SURVEILLANCE AND SECURITY (SPY) category.


Infra Red Wireless Door Monitor

Door Monitor Project
This door monitor project uses an infrared beam to monitor door & passageways or any other area. When the beam is broken a relay is tripped which can be used to sound a bell or alarm. Suitable for detecting customers entering a shop, cars coming up a driveway, etc. The IR beam is very strong. Distances over 25 feet can be monitored. A 12VDC supply is required to power the circuit. A 12V wall adaptor is fine. Provision has been made so that only one power supply needs to be used to power both units. The relay is rated to switch mains voltages.
Door Monitor Transmitter Board

The door monitor transmitter board consists of two square-wave oscillators, one running at approx. 250Hz and the other running at 38kHz. The 38kHz frequency acts as a carrier wave and is required by the IR receiver module on the receiver board. This carrier wave is “ANDed” or modulated by the 250Hz frequency to produce an output signal that contains bursts of 38kHz at a rate of 250Hz. This signal is used to drive an infrared LED. The oscillators are made by using two 555 timer ICs set up as “astable” (free running) multivibrators. IC1 is used for the 250Hz oscillator. Resistor R1 and R2 and capacitor C1 set the frequency. Another 555 chip, IC2, is used for the 38KHz oscillator. Resistors R4 and R5 and capacitor C3 set the frequency. Notice the diodes D1 and D3. These are provided to create a “symmetrical” output. Normally the external capacitor C1 (C3) charges through resistors R1 and R2 (R4 and R5) and discharges through R2 (R5). Without the diodes this output waveform would have a longer “high” time than the “low” time. The diode bypasses resistor R2 (and R5) when the capacitor is charging, so that it is only charged via R1 (or R5). This gives the same charging and discharging time and so the output waveform has equal high and low times.
The charge time (output high) is given by:
THIGH = 0.693 x R1 x C1 (or 0.693 x R4 x C3)
The discharge time (output low) is given by:
TLOW = 0.693 x R2 x C1 (or 0.693 x R5 x C3)
The output frequency = 1 / (THIGH + TLOW)

The output from the IC1 is coupled via diode D2 and resistor R3 to the ‘trigger’ input of IC2. When the IC1 output is low it stops IC2 from running and IC2’s output is forced high (no IR LED current). When IC1 output is high, IC2 runs and the IR LED is pulsed at 38KHz.
The Waitrony IR LED is driven directly from the output of IC2. Resistor R6 sets the maximum LED current. With a 12VDC supply the current is about 45mA (the LED drops 2V across it when conducting). Lowering the value of R6 will increase the current through the LED thus boosting the signal strength. This may be necessary if the kit is used outside in direct sunlight or if you need “very long range”. Keep in mind that the maximum current that the 555 can handle is 200mA
If the distance to be monitored is less than about 10 yards then you will need to fit the 5mm shrink tubing over the IR LED. This narrows the radiating angle of the IR beam and makes it much more directional. The IR output is strong. It can easily bounce off walls etc to give false readings.
Door Monitor Receiver Board

The door monitor receiver consists of an IR receiver module that detects the incoming IR beam from the transmitter. The IR signal is used to keep a capacitor charged which in turn holds a relay operated. When the beam is broken the capacitor discharges and the relay releases. An IR receiver/detector module, RX1, is made up of an an amplifier/filter circuit tuned to detect a 38kHz frequency. The output pin is low whenever a 38kHz signal is detected.
When the IR beam is present the relay is operated. Not all Receiver Modules are the same. IR decoder module looks for a manufacturer-specific leader code before it decodes the modulated signal. The door monitor project produces an NEC compatible Leader code. The Kodenshi PIC37043LM and PIC12043LO decoder modules are the ones that are used in this project. If you use the incorrect IR decoder module the relay will not be operated continuously but will drop out after less than a second after power is applied.
The output of RX1 is the 250Hz signal from the transmitter. This signal is passed via transistor Q1, capacitor C1and diode D2 to capacitor C2. C2 is fully charged during the high portion of the signal. It starts to discharge during the low portion of the signal via LED L1, resistor R4 and transistor Q2. However the discharge time is much longer than the off time of the signal so the voltage across C2 is always enough to keep transistor Q2 on and therefore the relay operated. When the beam is broken the output of RX1 is high. Transistor Q1 is off and capacitor C2 is no longer being recharged. It will eventually discharge to the point where transistor Q2 will turn off and the relay will release. The “turn off” delay is determined by the time constant of resistor R5 and capacitor C3. With the values used it is approx. half a second. Capacitor C1 prevents a steady DC voltage on the collector of Q1 from charging C2. This would occur if the beam was not present or the beam was a continuous 38kHz signal. In other words, the receiver module will only respond to a pulsed 38kHz signal.
LED L1 gives a visual indication when the IR beam is present and is used to help with installation and setup. Zener diode Z1, resistor R6 and capacitor C4 provides a stable 5.6V supply for the IR module. The relays used should be mains rated: 250V/12A; 120VAC/15A.

Door Monitor Parts List


Decoding Of Infrared Remote Control Software

Infrared Remote Control Software
This Infrared Remote Control Software project based on Microchip 16C57 microcontroller is a reference guide to decode infrared remote control signals from television, VCR, air conditioner or other home appliances handset that uses NEC 6121 infrared format. Once one is able to understand how to decode an IR signal of a certain format, decoding another format can be easily done as the flow chart is more or less the same except the timing of the new format.
The NEC 6121 format is based on pulse width timing in determining whether the data transmitted is "1" or "0". The data "1" is determined by the pulse width timing from one rising edge to the next rising edge of 2.24ms. The data "0" is determined by the pulse width timing from one rising edge to the next rising edge of 1.12ms.

Most of the transmitter are modulated using a frequency of 32.75 kHz, 35.0 kHz, 36.0 kHz, 36.7 kHz, 38 kHz, 39 kHz, 40 kHz, 41.7 kHz, 48 kHz, and 56.8 kHz. The ones that are commonly used are 38 kHz and 40 kHz. In order to decode the received signals, the corresponding demodulating receiver must be used. For instance, if a modulating frequency at the transmitter used is 40 kHz, then the receiver demodulating frequency used should be 40 kHz as well. Modulating the data is a better design as this will make the data integrity better and less susceptible to noise. The demodulating receivers can be obtained from suppliers such as Vishay, LiteOn, Sharp or Kodenshi.

One word of caution when using the IR remote control is that it is easily affected by lighting devices that emits the infrared frequency. One such example is the fluorescent tube which emits the infrared frequency in its operation. When this type of lights is operating, the receiver may not be able to receive the signal from the transmtter due to interference from the signals emitted by the flurescent tube. In situation like this, confirm this by switching off the lights when controlling the device.
You may want to consider using RF frequency as a solution in this particular location. Another way is to place a filter in front of the receiver to narrow the infrared window but this solution will compromise the angle and operating distance of the infrared transmitter.
The infrared remote control software project provides the flow chart and source code and can be downloaded from Microchip website.


3 Transistor Audio Amp (50 milliWatt)

Here is a little audio amplifier similar to what you might find in a small transistor radio. The input stage is biased so that the supply voltage is divided equally across the two complimentary output transistors which are slightly biased in conduction by the diodes between the bases. A 3.3 ohm resistor is used in series with the emitters of the output transistors to stabilize the bias current so it doesn't change much with temperature or with different transistors and diodes. As the bias current increases, the voltage between the emitter and base decreases, thus reducing the conduction. Input impedance is about 500 ohms and voltage gain is about 5 with an 8 ohm speaker attached. The voltage swing on the speaker is about 2 volts without distorting and power output is in the 50 milliwatt range. A higher supply voltage and the addition of heat sinks to the output transistors would provide more power. Circuit draws about 30 milliamps from a 9 volt supply.


Telephone Audio Interface

Audio from a telephone line can be obtained using a transformer and capacitor to isolate the line from external equipment. A non-polarized capacitor is placed in series with the transformer line connection to prevent DC current from flowing in the transformer winding which may prevent the line from returning to the on-hook state. The capacitor should have a voltage rating above the peak ring voltage of 90 volts plus the on-hook voltage of 48 volts, or 138 volts total. This was measured locally and may vary with location, a 400 volt or more rating is recommended. Audio level from the transformer is about 100 millivolts which can be connected to a high impedance amplifier or tape recorder input. The 3 transistor amplifier shown above can also be used. For overvoltage protection, two diodes are connected across the transformer secondary to limit the audio signal to 700 millivolts peak during the ringing signal. The diodes can be most any silicon type (1N400X / 1N4148 / 1N914 or other). The 620 ohm resistor serves to reduce loading of the line if the output is connected to a very low impedance.


Triangle and Squarewave Generator

Here is a simple triangle/squarewave generator using a common 1458 dual op-amp that can be used from very low frequencies to about 10 Khz. The time interval for one half cycle is about R*C and the outputs will supply about 10 milliamps of current. Triangle amplitude can be altered by adjusting the 47K resistor, and waveform offset can be removed by adding a capacitor in series with the output.


Thursday, September 24, 2009

Improved 3 Transistor Audio Amp (80 milliwatt)

This circuit is similar to the one above but uses positive feedback to get a little more amplitude to the speaker. I copied it from a small 5 transistor radio that uses a 25 ohm speaker. In the circuit above, the load resistor for the driver transistor is tied directly to the + supply. This has a disadvantage in that as the output moves positive, the drop across the 470 ohm resistor decreases which reduces the base current to the top NPN transistor. Thus the output cannot move all the way to the + supply because there wouldn't be any voltage across the 470 resistor and no base current to the NPN transistor.
This circuit corrects the problem somewhat and allows a larger voltage swing and probably more output power, but I don't know how much without doing a lot of testing. The output still won't move more than a couple volts using small transistors since the peak current won't be more than 100mA or so into a 25 ohm load. But it's an improvement over the other circuit above.
In this circuit, the 1K load resistor is tied to the speaker so that as the output moves negative, the voltage on the 1K resistor is reduced, which aids in turning off the top NPN transistor. When the output moves positive, the charge on the 470uF capacitor aids in turning on the top NPN transistor.
The original circuit in the radio used a 300 ohm resistor where the 2 diodes are shown but I changed the resistor to 2 diodes so the amp would operate on lower voltages with less distortion. The transistors shown 2n3053 and 2n2905 are just parts I used for the other circuit above and could be smaller types. Most any small transistors can be used, but they should be capable of 100mA or more current. A 2N3904 or 2N3906 are probably a little small, but would work at low volume.
The 2 diodes generate a fairly constant bias voltage as the battery drains and reduces crossover distortion. But you should take care to insure the idle current is around 10 to 20 milliamps with no signal and the output transistors do not get hot under load.
The circuit should work with a regular 8 ohm speaker, but the output power may be somewhat less. To optimize the operation, select a resistor where the 100K is shown to set the output voltage at 1/2 the supply voltage (4.5 volts). This resistor might be anything from 50K to 700K depending on the gain of the transistor used where the 3904 is shown.


Decibel Meter

The circuit below responds to sound pressure levels from about 60 to 70 dB. The sound is picked up by an 8 ohm speaker, amplified by a transistor stage and one LM324 op-amp section. You can also use a dynamic microphone but I found the speaker was more sensitive. The remaining 3 sections of the LM324 quad op-amp are used as voltage comparators and drive 3 indicator LEDs or incandescents which are spaced about 3dB apart. An additional transistor is needed for incandescent lights as shown with the lower lamp. I used 12 volt, 50mA lamps. Each light represents about a 3dB change in sound level so that when all 3 lights are on, the sound level is about 4 times greater than the level needed to light one lamp. The sensitivity can be adjusted with the 500K pot so that one lamp comes on with a reference sound level. The other two lamps will then indicate about a 2X and 4X increase in volume.
In operation, with no input, the DC voltage at pins 1,2 and 3 of the op-amp will be about 4 volts, and the voltage on the (+) inputs to the 3 comparators (pins 5,10,12) will be about a half volt less due to the 1N914 diode drop. The voltage on the (-) comparator inputs will be around 5.1 and 6.5 which is set by the 560 and 750 ohm resistors.
When an audio signal is present, the 10uF capacitor connected to the diode will charge toward the peak audio level at the op-amp output at pin 1. As the volume increases, the DC voltage on the capacitor and also (+) comparator inputs will increase and the lamp will turn on when the (+) input goes above the (-) input. As the volume decreases, the capacitor discharges through the parallel 100K resistor and the lamps go out. You can change the response time with a larger or smaller capacitor.
This circuit requires a well filtered power source, it will respond to very small changes in supply voltage, so you probably will need a large filter capacitor connected directly to the 330 ohm resistor. I managed to get it to work with an unregulated wall transformer power source, but I had to use 4700uF. It worked well on a regulated supply with only 1000uF.


FM Transmitter

Here is the schematic, PC board pattern, and parts placement for a low powered FM transmitter. The range of the transmitter when running at 9V is about 300 feet. Running it from 12V increases the range to about 400 feet. This transmitter should not be used as a room or telephone bug. 
C1           1              0.001uf Disc Capacitor   
C2           1              5.6pf Disc Capacitor        
C3,C4     2              10uf Electrolytic Capacitor           
C5           1              3-18pf Adjustable Cap  
R1           1              270 Ohm 1/8W Resistor 270 Ohm 1/4W Resistor
R2,R5,R6              3              4.7k 1/8W Resistor          4.7K 1/4W Resistor
R3           1              10k 1/8W Resistor            10K 1/4W Resistor
R4           1              100k 1/8W Resistor         100K 1/4W Resistor
Q1, Q2  2              2N2222A NPN Transistor               2N3904, NTE123A
L1, L2     2              5 Turn Air Core Coil         
MIC        1              Electret Microphone     
MISC     1              9V Battery Snap, PC Board, Wire For Antenna    

  1. L1 and L2 are 5 turns of 28 AWG enamel coated magnet wire wound with a inside diameter of about 4mm. The inside of a ballpoint pen works well (the plastic tube that holds the ink). Remove the form after winding then install the coil on the circuit board, being careful not to bend it.
  2. C5 is used for tuning. This transmitter operates on the normal broadcast frequencies (88-108MHz).
  3. Q1 and Q2 can also be 2N3904 or something similar.
  4. You can use 1/4 W resistors mounted vertically instead of 1/8 W resistors.
  5. You may want to bypass the battery with a .01uf capacitor.
  6. An antenna may not be required for operation.

Thursday, September 17, 2009

12V to 120V Inverter

Have you ever wanted to run a TV, stereo or other appliance while on the road or camping? Well, this inverter should solve that problem. It takes 12 VDC and steps it up to 120 VAC. The wattage depends on which tansistors you use for Q1 and Q2, as well as how "big" a transformer you use for T1. The inverter can be constructed to supply anywhere from 1 to 1000 (1 KW) watts. 
C1, C2    2              68 uf, 25 V Tantalum Capacitor  
R1, R2    2              10 Ohm, 5 Watt Resistor              
R3, R4    2              180 Ohm, 1 Watt Resistor            
D1, D2   2              HEP 154 Silicon Diode    
Q1, Q2  2              2N3055 NPN Transistor (see "Notes")    
T1           1              24V, Center Tapped Transformer (see "Notes")               
MISC     1              Wire, Case, Receptical (For Output)        

  1. Q1 and Q2, as well as T1, determine how much wattage the inverter can supply. With Q1,Q2=2N3055 and T1= 15 A, the inverter can supply about 300 watts. Larger transformers and more powerful transistors can be substituted for T1, Q1 and Q2 for more power.
  2. The easiest and least expensive way to get a large T1 is to re-wind an old microwave transformer. These transformers are rated at about 1KW and are perfect. Go to a local TV repair shop and dig through the dumpster until you get the largest microwave you can find. The bigger the microwave the bigger transformer. Remove the transformer, being careful not to touch the large high voltage capacitor that might still be charged. If you want, you can test the transformer, but they are usually still good. Now, remove the old 2000 V secondary, being careful not to damage the primary. Leave the primary in tact. Now, wind on 12 turns of wire, twist a loop (center tap), and wind on 12 more turns. The guage of the wire will depend on how much current you plan to have the transformer supply. Enamel covered magnet wire works great for this. Now secure the windings with tape. Thats all there is to it. Remember to use high current transistors for Q1 and Q2. The 2N3055's in the parts list can only handle 15 amps each.
  3. Remember, when operating at high wattages, this circuit draws huge amounts of current. Don't let your battery go dead :-).
  4. Since this project produces 120 VAC, you must include a fuse and build the project in a case.
  5. You must use tantalum capacitors for C1 and C2. Regular electrolytics will overheat and explode. And yes, 68uF is the correct value. There are no substitutions.
  6. This circuit can be tricky to get going. Differences in transformers, transistors, parts substitutions or anything else not on this page may cause it to not function.
  7. If you want to make 220/240 VAC instead of 120 VAC, you need a transformer with a 220/240 primary (used as the secondary in this circuit as the transformer is backwards) instead of the 120V unit specified here. The rest of the circuit stays the same. But it takes twice the current at 12V to produce 240V as it does 120V.