Wednesday, 8 April 2015

Sound Activated Switch

Micro Switch 
Consider a situation in a bank or any organization where a sudden invasion by the burglars has taken place. Now all the staff has been handcuffed by the robbers and the main locker room full of valuable resources is at the mercy of the robbers. So is there any way to prevent this theft?? Yes, there is, if any buzzer is connected which can start ringing, alarming the local police or a camera fitted along with a GSM modem that can send the video to the police stations. But still the problem lies in the way to switching on these devices.
Consider another situation, when a person is at his room (in a hostel or a hotel) and a thief tries to enter the room at night when the room is dark and the owner is fast asleep. There needs to be a system for automatic switching on of the light and ringing of the buzzer alarm.
In both these situations, the solution lies in devising a way for automatic operation of a switch and to achieve this, one of the most efficient ways is a Sound Operating switch.

Two ways to design your own sound operated switch
 
Using a audio Amplifier and a timer


A basic sound operating switch can be constructed using an audio amplifier IC, a comparator, a 555 timer operating in monostable mode, a relay and a load. Here the basic idea is to change the output of the timer with input from the microphone, in order to switch on the load. The load can be a incandescent lamp or a LED lamp or a motor.
The audio signal is received by the microphone, which converts the audio signal to electrical signals. The signal is given to the pin2 of comparator IC 741. The other input pin 3 of the comparator is given by the reference voltage set by the potentiometer arrangement.
 
In absence of any audio signal, pin 2 is at logic high and the output of comparator is at logic low, giving a low signal to the trigger pin of the 555 timer. The output of the timer is thus at logic high, keeping the relay at off condition. When a sound is heard the microphone detects it and converts it to electrical signal and the signal is applied to pin2 of the comparator and since this pin is now at logic low, the comparator output is at logic high, triggering a logic high signal to the trigger pin of the timer. The timer output is thus at logic low, driving on the relay, which in turn switches on the load( A bulb) for a time determined by the RC combination.
A Sound Operated Switch using Counter IC
You can use this circuit to operate a Relay through the sound of claps. It is highly sensitive and can detect the sound of the clap from a distance of 1-2 meters. AC loads such as lamps, fans etc can be connected through the relay. This circuit has three sections. A sensitive MIC amplifier, A Toggle switch based on IC CD4017 and a Relay driver. IC CD4017 is a decade counter where the output count number is shown by the corresponding output number pin going high.
Condenser Microphone picks up the sound vibrations and generates minute voltage across its terminals. These feeble signals are amplified by IC1. Resistor R1, R3 and variable resistor VR1 adjust the sensitivity of the amplifier. Resistor R1 set the sensitivity of Mic. The amplified output pulses from IC1 passes to the input of IC2 (CD 4017). Resistor R4 keeps the input (pin14) of IC2 low so as to prevent false triggering. IC2 is a decade counter IC which is wired as a toggle switch. That its outputs 1 and 2 (pins 2 and 3) becomes high and low alternately when the input pin14 receives pulses from IC1.  Pin4 (output4) is connected to the reset pin15 so that further counting will be inhibited. The high output from IC2 passes through the current limiter R6 to the base of switching transistor T1. When T1 conducts, Green LED and the Relay turns on. In the next clap, output pin 2 becomes low to switch off the relay and the Green LED. Red LED indicates the OFF position of the load.
In other words, when we first make a clapping sound, the audio signal gets converted by the microphone to electrical signal and amplified by the operational amplifier, which gives the output pulse. When the counter receives the first pulse the pin 2 goes high and the relay driver is switched on to energize the relay and thus switch on the LED. When we again make a clapping sound, the amplifier IC generates another pulse. This time the pin 2 goes low and pin 3 goes high, causing the red LED to glow. The relay is now switched off and the LED is in off condition.
 
Note: It is better to connect the Microphone directly on the PCB using two pieces of the trimmed leads of resistor or capacitor. If Microphone is connected with wires, sensitivity may be reduced. Enclosing the Microphone in a tube will increase the sensitivity considerably. Adjust VR1 to get maximum sensitivity and range.
Sound Operated switches available in the market

 
It is a sound operated electronic switch kit by Electro Kits. It operates on a 9V battery and uses a electrets microphone. It switches on and off an LED mounted on the kit.

Automatic Voice Activated Switch
 
Its switching time is up to 60seconds and supports loads upto 3A-115V or 5A-12V
 
It is a microprocessor controlled switch operating on 1 or 2 claps. It has a relay power rating of 24VDC/AC 3A. It works on a power supply of 12V dc.
 
It is a 1382313 model number sound operated switch operating on a power of 250W max with a supply voltage of 120V. It works in two modes. In Home mode, it can operate one or two appliances. In the Away mode, it will operate on any noise to switch on the connected appliance.

Smart DC fan

EMI signal line filters
In almost all flats the elevators (lifts) are essential. In high rise buildings there are 2 or 3 or even more lifts. These lifts are major source of electrical energy consumption. Why?
The lifts remain idle for most of the time and it is used during peak hours only like in morning from 6 am to 10 am and in evening from 5 pm to 9 pm. So out of 24 hours a lift is used mostly for 8 – 10 hours. Now the problem is, in a lift there is always a fan and a light that stays on continuously. Even if lift is not in used for longer period of time. Although the ON/OFF switches for fan and light are already given, no body turns it OFF. So the fan and light inside the lift stays ON continuously and makes complete waste of electrical energy. Such a waste of valuable electrical energy in this era is not at all desirable. Today all most all the countries are putting their strong efforts to save maximum electrical energy by all means. In India there is heavy scarcity of conventional energy sources from which electricity is produce. So saving electricity and thus these conventional energy sources is must.
On this thought an idea came into my mind that why not to add a kind of intelligence in lift fan and light so that it remains ON till there is atleast one person in the lift. And when lift is totally empty fan as well as light automatically turns off. So there should be a kind of sensor in the lift that senses person presence and automatically turns ON or OFF light and fan inside it.
So here i am presenting a simple circuit called smart DC fan that senses any person near by and turns on. when there is no any person it turns off automatically. Later on I have given one more circuit that is with a small change in the same circuit so that it can switch on and off 230 V AC light and fan at a time inside lift.

Arduino Due Pinout

 
Input and Output
Digital I/O: pins from 0 to 53
Each of the 54 digital pins on the Due can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 3.3 volts. Each pin can provide (source) a current of 3 mA or 15 mA, depending on the pin, or receive (sink) a current of 6 mA or 9 mA, depending on the pin. They also have an internal pull-up resistor (disconnected by default) of 100 KOhm.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX) Serial 1: 19 (RX) and 18 (TX) Serial 2: 17 (RX) and 16 (TX) Serial 3: 15 (RX) and 14 (TX)
Used to receive (RX) and transmit (TX) TTL serial data (with 3.3 V level). Pins 0 and 1 are connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip.
PWM: Pins 2 to 13
Provide 8-bit PWM output with the analogWrite() function. the resolution of the PWM can be changed with the analogWriteResolution() function.
SPI: SPI header (ICSP header on other Arduino boards)
These pins support SPI communication using the SPI library. The SPI pins are broken out on the central 6-pin header, which is physically compatible with the Uno, Leonardo and Mega2560. The SPI header can be used only to communicate with other SPI devices, not for programming the SAM3X with the In-Circuit-Serial-Programming technique. The SPI of the Due has also advanced features that can be used with the Extended SPI methods for Due.
CAN: CANRX and CANTX
These pins support the CAN communication protocol but are not not yet supported by Arduino APIs.
“L” LED: 13
There is a built-in LED connected to digital pin 13. When the pin is HIGH, the LED is on, when the pin is LOW, it’s off. It is also possible to dim the LED because the digital pin 13 is also a PWM outuput.
TWI 1: 20 (SDA) and 21 (SCL) TWI 2: SDA1 and SCL1.
Support TWI communication using the Wire library.
Analog Inputs: pins from A0 to A11
The Due has 12 analog inputs, each of which can provide 12 bits of resolution (i.e. 4096 different values). By default, the resolution of the readings is set at 10 bits, for compatibility with other Arduino boards. It is possible to change the resolution of the ADC with analogReadResolution(). The Due’s analog inputs pins measure from ground to a maximum value of 3.3V. Applying more then 3.3V on the Due’s pins will damage the SAM3X chip. The analogReference() function is ignored on the Due.
The AREF pin is connected to the SAM3X analog reference pin through a resistor bridge. To use the AREF pin, resistor BR1 must be desoldered from the PCB.

DAC1 and DAC2
These pins provides true analog outputs with 12-bits resolution (4096 levels) with the analogWrite() function. These pins can be used to create an audio output using the Audio library.
Other pins on the board: AREF
Reference voltage for the analog inputs. Used with analogReference().

Reset
Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

Arduino Ethernet Pinout

 
Input and Output
Each of the 14 digital pins on the Ethernet board can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, and 10. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.
LED: 9. There is a built-in LED connected to digital pin 9. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off. On most other arduino boards, this LED is found on pin 13. It is on pin 9 on the Ethernet board because pin 13 is used as part of the SPI connection.
The Ethernet board has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function. Additionally, some pins have specialized functionality:
TWI: A4 (SDA) and A5 (SCL). Support TWI communication using the Wire library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

Arduino Mega 2560 Pinout

 
Input and Output
Each of the 54 digital pins on the Arduino 2560 Mega can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
 In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX).
Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip.
External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 2 to 13 and 44 to 46. Provide 8-bit PWM output with the analogWrite() function. SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication using the SPI library. The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.
TWI: 20 (SDA) and 21 (SCL). Support TWI communication using the Wire library. Note that these pins are not in the same location as the TWI pins on the Duemilanove or Diecimila.
The Mega2560 has 16 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and analogReference() function.

There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference(). Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

Arduino Uno Pinout

 

Input and Output
Each of the 14 digital pins on the Arduino Uno can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:


Serial: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function. Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

Midget Emergency Torch Circuit

Here is a tried and tested design of an ultra-simple emergency torch built around the inexpensive dc-dc converter chip MC34063. Beyond a handful of simple components, a lithium coin cell and a small key fob case no additional parts are needed!
The MC34063 (IC1) is a monolithic control circuit containing the primary functions required for dc−to−dc converters. MC34063 consists of an internal temperature compensated reference, comparator, controlled duty cycle oscillator with an active current limit circuit, driver and high current output switch.
This chip was specifically designed to be incorporated in buck and boost (and voltage−inverting) applications with a minimum number of external components. Here, the IC-MC34063 is used to drive three high-efficiency white LEDs using 3V dc supply available from the built-in CR2032 lithium coin cell.
 In this circuit, designed to drive ultrabright white LEDs at constant current, IC1 (MC34063) compares the external voltage at its pin 5 with an internal reference voltage of 1.2 V in order to stabilize its output. Here, resistor R3 (connected to pin 5 of IC1) sets the operating current of the series-connected white LEDs (LED1-LED3). Note that the circuit can provide a variable intensity by making R3 to be a variable resistor. If R3 is linear then the perceived light intensity will be approximately linearly variable with the variable resistor’s shaft position.