Tuesday, April 20, 2010

Toggle ON / OFF Switch


This project describes how to build a "soft touch" switch. By "soft touch" we mean that you have to push once to set device ON and push again to set device OFF. This kind of switch works by latching a relay to ON state with push of a button and with another push latch is released. It is working like flip-flop states. In that way you can control power to a device using one push button.

The circuit is build around a 555 timer configured in a way that let it latch on one state and an action is required to change state. The circuit is powered from +5V and there are connectors to connect controlling device. Inspiration from this project and circuit is found here: http://todbot.com/blog . We added a relay on output, an indicator led as well as connectors for power, external push button and relay contacts.


Schematic:


Schematic for this circuit can be seen above. The circuit toggles a relay when button S1 is pressed. Operation of this circuit is simple. Pins 6 and 2 of 555 timer are at half power voltage. When output pin 3 is high then capacitor C1 is charged and when it's low capacitor is discharged. When button is pressed capacitor voltage appears on pin 6 and 2 and output pin 3 changes state as well as capacitor voltage changes. So when output is high capacitor has +5V. When we press the button pin 3 goes low and capacitor goes 0V, when we press button again output goes high again, so we have toggle functionality. When output is high transistor T1 is conducting current and relay is latched, when low relay is released. Diode D1 is used to protect transistor from back voltage generated when relay goes off.




A disadvantage of this circuit is that when we connect power to the circuit relay is engaged. A solution to this can be found on the second reference website below.

 
PCB:
 




                                  Components Layout                                                                                                pcb





for the more information: log on to

- http://todbot.com/blog/2010/01/02/momentary-button-as-onoff-toggle-using-555/






Infra Red Extender Mark



Description:An Infra Red wired Repeater circuit to control appliances from a remote location.







Parts List:


R1: 1k Resistor (1)


R2: 3.3k Resistor (1)


R3: 10k Resistor (1)


R4: 15k Resistor (1)


R5: 2k2 Resistor (1)


R6: 470R Resistor (1)


R7: 47R Resistor (1) 0.5 Watt


PR1: 4.7k Preset (1)


C1,C3: 47u Elect(2)


C2: 1n Polyester 5% or better (1)


C4: 100u Elect(1)


Z1: 5V1 Zener (1)


Q1: BC549C or BC109C or 2N2222 (1)


Q2: BC337 or BC549 or ZTX450 (1)


IC1 : TSOP1738


IC2: 555 or 7555 (1)


LED1 5mm RED (1)


LED2,3 IR diode TIL38 or similar (2)


Alternatives to IC1 :


Everlight IR receiver module ELIRM 8621


Harrison electronics IR1


Vishay TSOP 1838


Radio Shack 276-0137


Sony SBX 1620-12


Sharp GP1U271R


Notes:


The signal emitted by an IR remote control contains two parts, the control pulses and a modulated carrier wave. The control pulses are used to modulate the carrier, a popular modulation frequency being 36 and 42KHz. The signal is radiated by an IR diode, typical wavelengths in the 850 and 950 nm region of the electromagnetic spectrum. Although this light is invisible to the human eye, it can be seen as a bright spot with a camcorder or digital camera.


In this circuit, the TSOP1738 IR module removes the carrier leaving only the slower control pulses ( 1 - 3KHz) which appear at the output. R1, C1 and Z1 form a smoothed 5 Volt supply for the IR module. Under quiescent conditions (no input signal) the output of the IR module is high. Transistor Q1 will be on, resulting in a low collector voltage, restting the 555 oscillator. Q1 also acts as a level shifter, converting the 5 Volt output signal to 12 Volts for the 555 timer. When an IR signal is received, decoded control pulses turn Q1 off and on. Each time Q1 turns off, pin 4 of the 555 timer goes high and an oscillation will be produced for the duration of each data pulse.


The 555 is wired as an equal mark/space ratio oscillator, the timing resistor R4, being connected back to the output of the timer, pin 3. The timing capacitor C2 is the other component in the timing chain. The pulse duration at pin 3 is defined as:-


T = 1.4 R4 C2


As the timing is crucialthe capacitor should have a tolerance of 5% or better and the power supply should be regulated. To allow for tolerance in components a 4k7 preset resistor is wired in series with R4. This adjustment allows R4 to be 15k to 19.7K creating output pulses of 21us and 27.58 us. As frequency is the reciprocal of periodic time then the oscillator adjustment is from 36.2Khz to 47KHz, allowing fine tuning for almost any appliance.


The final output stage uses a BC337 transistor in emitter follower. The output pulse will not be inverted, and the current through the IR photo emitters is around 30 mA dc. This is of course an average value, measured with a digital multimeter. The red led as always, is a visible indication that an input signal has been received. The circuit may be modified to use a fixed resistor in the timing chain as shown below. In this example a voltage regulator is also recommended to prevent changes in supply voltage altering the output pulse.


Setup and Testing:

Remove LED 2 and 3 and apply power. With no input signal LED 1 should be off. Press a button on a remote control in the same room as the circuit. LED 1 should flicker. If all is well, connect LED's 2 and 3 and point them in the direction of the appliance (TV or VCR etc). The cable to the LED's can exceed 100 metres if necessary, ordinary loudspeaker cable or bell wire is suitable. Set preset PR1 midway initially, it should work for all equipment. Most equipment is tolerant to within 5% so if you have for example a video that works at 42kHz and a TV that works at 38Khz tuning the modulation to 40KHz should allow both devices to operate. Any troublesome equipment, for example an Echostar receiver repeatedly press abutton on the handset while tuning PR1, you will find that it operates at some point. One IR LED may be used in place of LED2 & 3, but if there are two appliance in the same room, but in different locations, LED 2 can be aimed at a video, while LED3 aimed at a CD player for example. Below is how I discretely placed a photo emitter and plastered it directly into the wall: