Friday 17 April 2015

Bridge Power Audio Amplifier

Here is simple circuit of bridge power audio amplifier used in application requiring more power than is provided by the single LM380 amplifier, the two LM380s can be used in the bridge configuration shown in figure 1. In this arrangement (bridge power audio amplifier) the maximum output voltage swing will be twice that of a single LM380 amplifier; therefore, the power delivered to the load by bridge power audio amplifier will be four times as much. For improved performance, potentiometer R3 should be used to balance the output offset voltage of the LM380s. Here R2 C3 for stability with high-current loads.
 

Resistors (all ¼-watt, ± 5% Carbon)

R1 =2 MΩ potentiometer
R2 = 2.7 Ω
R3 = 1 MΩ

Capacitors

C1, C2, C3 = 0.1 µF
C4 = 51 pF

Semiconductors

IC1, IC­2 = LM380 audio power amplifier

Miscellaneous

8Ω 1-W speaker

Friday 10 April 2015

Bidirectional Logic Level Converter Circuit

Often, it becomes necessary to interface an existing or new 5V AVR / PIC / MCU project to new devices that use 3.3V logic, like memory cards, sim cards, etc. Described here is a circuit that converts +5V to +3.3V logic or +3.3V to +5V logic. This compact circuit makes it perfect for embedded systems that need to interface with different logic levels. The design is based on 74LCX 245 IC, which is a low voltage bidirectional transceiver with 5V tolerant inputs and outputs, from Fairchild.
The 74LCX245 IC contains eight non-inverting bidirectional buffers with 3-STATE outputs and is intended for bus oriented applications. The device is designed for low voltage (2.5V and 3.3V) VCC applications with capability of interfacing to a 5V signal environment. 74LCX245 IC is fabricated with an advanced CMOS technology to achieve high speed operation while maintaining CMOS low power dissipation
 Schematic of the Logic Level Converter Circuit
 
The presented circuit features improvements that set it apart from other published logic level converter circuits. The improvements include on-board +3.3 low-drop voltage regulator, direction selection jumpers, easy-to-use input/output terminals and power on indicator LED. The circuit can be easily interfaced via standard jumper wires. The whole circuit can be fabricated on a small piece of prototyping board, with the help of an SOIC/SOP/SSOP – to – DIP adapter. Or you can prepare your own SMD printed circuit board for the construction task. In order to configure the circuit as +5V input and +3.3V output, the jumper (JP1) must be set to position A -> B. For configuring the circuit as +3.3V input and +5V output, the jumper (JP1) must be set to position B -> A. The onboard +3.3V can be used to supply power to the connected +3.3V device(s).
Logic Level Converter Features
  • 8- non inverting bidirectional buffers
  • On-board +3.3V/500mA low-drop fixed voltage regulator
  • User only needs to supply dc power to +5V pin
  • Power on LED
  • Direction selection Jumpers
  • Small and compact circuit
IC1 is configured to enable output (OE pin -pin 19 of IC1- pulled down), and the default direction is A -> B (DIR pin -pin 1 of IC1- pulled up by jumper JP1). You can manage the OE and DIR signals by applying the desired logic value to these signals
Lab Note: Prototype was tested with 74LCX245 IC in ‘Thin Shrink Small Outline Package’ (TSSOP). The prototype on the common circuit board was built with the help of a 20-pin TSSOP to DIP adapter.
MOSFET I2C Level Converter Circuit
he above circuit is built with the BSS138 MOSFETs and can be used when you need only the an I2C level converter from 5V to 3.3V or from 3.3V to 5V.

ICSP custom cables and Arduino

As soon as we start getting familiar with the basics of Arduino, we start noticing some interesting components that are not commonly used on the Arduino. One of these things are the ICSP headers. They are those six pins that stick out, organized in a two-row three-column orientation.
As Arduino enthusiasts become familiar with the concept of microcontroller programming, they realize that programming is not as simple as plugging a USB cable into the microcontroller and pressing upload. However, technology is growing and there are already microprocessors that support USB protocol out of the box, yet they still have to be loaded with a specific firmware or program to run in a desired way. The main controller on the Arduino is a microcontroller that has a specific firmware on it in order to receive serial data and be programmed that way through USB. Without this firmware the code found in the Arduino IDE would not be compatible with the microcontroller. It is the ICSP header that allows the microcontroller to receive the firmware or program that does all the advanced functionalities that are desired.
ICSP stands for In Circuit Serial Programming, it is a standard way to program AVR chips. You may be asking what AVR is? AVR is a standard abbreviation used to classify Atmel microcontrollers. Atmel, a company that manufactures microcontrollers, has created a microcontroller (chip) that Arduino uses in its prototyping boards like Arduino UNO, make sense?


 

All this may seem like great knowledge but what can be done with this knowledge and just an Arduino? The webpage by Arduino explains a way to go from an Arduino UNO to an Arduino clone on a breadboard. Very exciting, we can actually create our own Arduino. Looking at all the wires that are required to connect the Arduino to the microcontroller to upload the boot loader, is disappointing and seems like too much. How about if a USB to serial converter cost too much for us? Are we expected to connect these wires every time we want to program this chip? What a hassle. I have a cheap and easy way to program your chip without much effort.
Enough with the learning let’s get our hands working and build a custom ICSP cable to program/bootload an Arduino, an ATMEGA328P (chip used in Arduino UNO) , or any other AVR microcontroller.
Things you will need:
  • Arduino0
  • IDE cable.
  • Bread Board and an Atmega328p or another Arduino
  • Jumpers and male headers if you are using a Bread board instead of another Arduino
Step 1: The IDE cable has one side that has a red wire coming to it. Count three pins in from the edge of the ide cable and make a mark, there are two rows so three times two will be six pins altogether. Do this on both sides of the cable.
 
Step 2: Cut the IDE Cable connector at the mark do this also on both sides of the cable. When the cable is cut, there will be more than six wires that are still attached to the connector. Count off six wires from the edge and strip the rest away from the connector
Step 3: This requires to gain some knowledge about ICSP pinouts. ISCP uses six pins to program the microcontroller and instead of spending my time, trying to explain what each pin does here (http://en.wikipedia.org/wiki/Incircuit_serial_programming) is a good Wikipedia article that explains it quite well.
Basically there is a power and ground, a clock signal, two signals for data, and most importantly a reset pin. I spent some time going down into the core of how everything is connected from an Arduino to an Arduino for Bootloading and noticed that there are predetermined pins on AVR microcontrollers for each of those pins on the ICSP connector. When doing a Bootloading/programming from Arduino to Arduino every pin is connected directly from chip to chip, meaning the data is connected directly to the data and so one. Only the reset pin is different, that is what makes this so nice. The programming Arduino sends the reset signal from one of its pins (pin 10 if using ArduinoISP sketch) and it connects to the reset of the programmed chip. In order to get the right configurations all we have to do is peel away the fifth wire on our new cable and solder a jumper to it.
\
Step 4: Clean up the connector by adding some heat shrink, plug it into you programming Arduino and you are set to go.
This is the best way to use your Arduino as a programmer. It allows you to use your Arduino for other projects but when you need a program all you have to do it plug in this custom cable. Instead of having 50 Arduinos for all our projects, we have shields that plug in and out making Arduino easy to use, This is a good comparison to an Arduino shield as it allows you to quickly add functionality of your Arduino with not much thought.

Android Password Based Remote Door Opener System Project

Our project aims at remote password based door opener system through an android application. The system tends to make a secure door opening mechanism such that the door only unlocks when a security personnel opens it by entering the right password through an android application.
The authorized personnel needs to be present within Bluetooth range of the door but need not open the door manually. He just needs to enter the right password through his android application in order to unlock the door. This is a useful concept in places where the security needs to open gates quite usually or need to operate a door from a vehicle without needing to get down from it.
The command sending functionality is achieved through an android application. The application provides an interactive user friendly GUI for this purpose. The android application can be operated from any device running on android OS and uses Bluetooth as a medium for sending commands.
As soon as commands are sent through the android device a Bluetooth receiver is used to receive those commands. These commands are then sent to the 8051 microcontroller. The microcontroller processes these commands and then tallies the password to check its correctness. If the right password is encountered it sends command to open the door.
In case of wrong password it sounds a small buzzer.

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.