Video of the Day

Sunday, August 16, 2015

0

Sequential Tilt-Motion Lock

Here is a project for locking and unlocking with a tilt sensor by tilting it in a defined sequence. It uses an accelerometer module to detect the tilt motion. If the sequence matches with the predefined motion sequence, the lock opens. You can build this lock for a briefcase, ballot box, portable cashbox or even as a door-lock using suitable mechanical arrangement.

Circuit and working
Fig. 1 shows circuit diagram of the sequential tilt-motion lock. The circuit is built around Arduino Uno board (Board1), accelerometer module (ACC.1), solenoid lock/electric strike and a few other components.

Circuit diagram of sequential tilt-motion lock
Fig. 1: Circuit diagram of sequential tilt-motion lock

Arduino Uno board. Arduino is an open source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists and anyone interested in creating interactive objects or environments.
Arduino Uno is a board based on ATmega328 microcontroller. It consists of 14 digital input/output pins, six analogue inputs, a USB connection for programming the on-board microcontroller, power jack, an ICSP header and a reset button. It is operated with a 16MHz crystal oscillator and contains everything needed to support the microcontroller. It is very easy to use as the user simply needs to connect it to a computer with a USB cable, or power it with an AC-to-DC adaptor or battery to get started. The microcontroller on the board is programmed using Arduino programming language and Arduino development environment.

Pins A0, A1, A2, A3, A4 and A5 of Board1 are connected to pins ST, Z-axis, Y-axis, X-axis, GND and Vcc of the accelerometer module, respectively. Pin 10 of Board1 is connected to solenoid driver transistor through which the solenoid lock is connected.

Accelerometer module. An accelerometer is an electromechanical device that measures acceleration. The accelerometer module used here is based on ADXL335 triple-axis accelerometer from Analog Devices. The sensor has a full sensing range of ±3g.

The microcontroller in Board1 receives data at pins A1, A2 and A3 for z, y and x axes, respectively, from the accelerometer. This data is continuously compared by Board1 with predefined values for each axis. If the received sequence matches, Board1 unlocks the lock, which is either a solenoid lock or any other suitable magnetic lock. (We used a 12V electric strike for testing.) Glowing of LED1 indicates that the lock is open.

Software
The software for this project is written in Arduino programming language. The Arduino Uno is programmed using Arduino IDE software. ATmega328 on Arduino Uno comes with a boot loader that allows you to upload new code to it without the use of external hardware programmer. It communicates using the STK500 protocol. You can also bypass the boot loader and program the microcontroller through in-circuit serial programming (ICSP) header, but boot loader programming is quicker and easier. Select the correct board from ‘Tools → Board’ in Arduino IDE and burn the program (sketch) through standard USB port in the computer.

Fig. 2: An actual-size PCB layout for the sequential tilt-motion lock

Fig. 3: Component layout for the PCB


Construction and testing

An actual-size (Arduino shield type), single-side PCB for the sequential tilt-motion lock is shown in Fig. 2 and its component layout in Fig. 3. Assemble the circuit on the recommended PCB to minimize assembly errors.

To test the circuit for proper functioning, switch on S1 and verify correct 12V supply for the circuit at TP1 with respect to TP0.

The neutral position of accelerometer module is parallel to the earth’s surface. The +Y and +X axes are marked on the accelerometer module. The default tilt sequence of this circuit defined in the source code is -X, -Y, -X, +Y, -Y. If the tilt sequence is correct, you can observe the glowing of an in-built LED (not shown here) connected to pin 13 of Arduino board. If you want to change the sequence, change it in the source code, recompile the program and burn into the microcontroller.

To open the lock, switch on S1 and tilt the circuit sequentially, as mentioned above, within one minute. If correct action is not completed within one minute, you need to repeat the tilt sequence from the start to unlock it. To close the lock, just switch off the circuit using on/off switch S1.



Soueced By : EFY Author:  Akhil Kaushik


Saturday, August 8, 2015

0

12V, 1A SMPS Circuit Diagram

Most electronics enthusiasts require DC power supplies to operate various devices and accessories. The most popular and common supply is a 12V DC supply that can be easily derived from the household AC supply with transformation, rectification, filtering and stabilisation. These power supplies have a bulky steel- or iron-laminated transformer that provides a safety barrier for the low-voltage output from the AC input, and reduces the input from typically 230V AC to a much lower voltage. The low-voltage AC output from the transformer is then rectified by two or four diodes and smoothed into low-voltage DC by large electrolytic capacitors.


Fig. 1: The author’s prototype

A switched mode power supply (SMPS) offers the same end results at a lower cost and higher efficiency. For a given output power, an SMPS is lighter and smaller. This is because, if the frequency of operation is increased, one can get away with using a smaller core cross-sectional area. Besides, an iron-core transformer works only up to about 10 kHz, and if we need something in 50-100kHz range, we need a ferrite core.



Circuit and working

Fig. 2 shows the circuit of a simple 12V, 1A SMPS. The circuit is built around a low-power offline switcher TNY266 (IC1), photo-transistor photo-coupler EL817 (IC2), a flyback transformer (X1) and some other easily-available components.

Low-power offline switcher (TNY266). The SMPS here has been designed using a TNY266 chip, which is affectionately called the ‘555’ of SMPS. This device has a 700V power MOSFET, an oscillator, a high-voltage switched current source, a current limiting and thermal shutdown circuitry integrated onto a monolithic device. The start-up and operating power is derived directly from the voltage on the drain (pin 5), eliminating the need for a bias winding and associated circuitry. In addition, the device incorporates auto-restart, line under-voltage sense, and frequency jittering.

The drain-source breakdown voltage of the MOSFET in TNY266 is important. During the ‘off’ period, the MOSFET sees rectified 317V DC approximately. Additionally, it sees the reflected voltage of the secondary, which is about 130V AC. It also encounters the ringing voltage from the leakage inductance, and the drain-source capacitance of the MOSFET. Therefore a MOSFET with a Vdss of 650V DC is expected to keep the necessary safe operating margin. Fortunately, a MOSFET with these properties is included in TNY266.

The 230V AC input is connected at CON1, which is rectified by diode D1. The neon lamp (NL1) glows when the input supply is present. Resistor R1 limits the current through the lamp. The rectified output goes to the first terminal (A) of coil L1 and the second terminal (B) is connected to the drain of the inbuilt MOSFET in IC1. Diodes D2 and D3 are essentially the snubbers, and are used to protect the MOSFET from going above 600V.

Flyback transformer. A flyback circuit is simply a pair of coupled inductors. If a current is passed through one inductor, it will store energy E = ½ (L.I2), where ‘L’ stands for inductance in henry, and ‘I’ for current in amperes. This energy can later be taken out of the second inductor, which is coupled to the former at a different volt-current ratio. The flyback’s energy storage and extraction mechanism is interesting. The key point is the polarity of the winding; the secondary is out of phase with the primary, as is evident in Fig. 2 (the dots indicate polarity).

12V, 1A SMPS Circuit Diagram

Fig. 2: Circuit of the 12V, 1A SMPS


Fig. 3: An actual-size, single-side PCB for the 12V, 1A SMPS


Fig. 4: Component layout for the PCB

When the MOSFET of IC1 is ‘closed,’ the current flows through L1. Point A on L1 goes positive and by transformer action, and considering the polarity of dots, point C on L2 goes negative. This reverse biases diode D4, and no current flows in the secondary winding. Similarly, when the MOSFET is ‘open,’ the current flow through L1 is interrupted and, by Lenz’s Law, a voltage of polarity opposite to the applied voltage appears on L1 and L2. Thus, point A on L1 goes negative and point C on L2 goes positive. This situation forward biases diode D4. The energy stored in the core causes the current to flow through winding L2. This charges capacitor C2 and also powers the load. The charge on C2 is used in the next half of the cycle to keep the current through the load somewhat constant. The cycle repeats endlessly. The MOSFET is switched on/off continuously at a frequency of around 120 kHz to keep this process running.

The design data for the transformer is as follows:
1. Duty cycle = 0.45 (max. duty cycle for DCM flyback = 0.5; less 10% safety margin)
2. Core saturation magnetisation Bsat = 0.24T
3. Core area of EE20 = 25mm2

Winding details computed for the SMPS are shown in Table I.

The feedback circuit. Regulated output needs feedback to control the pulse width modulation (PWM) of the MOSFET. TNY266 has a fabulous control feature; it stops the switching cycle as soon as any current is taken out of pin 4 of the device. If SMPS output exceeds the zener break-down voltage then ZD1 conducts. This lights the opto-LED and the opto-transistor grounds pin 4 of IC1, resulting in immediate stoppage of the switching cycle. Also, when the primary is conducting, diode D4 on the secondary side is reverse biased. At this time, if the voltage across D4 exceeds its reverse breakdown voltage, the SMPS will fail. Here we have used an SB160 Schottky diode with breakdown voltage= 60V.

Connector CON2 provides 12V regulated DC supply.

Construction and testing
A general core-selection ‘rule of thumb’ for SMPS below 50 watts is 2-3 mm2 core area per watt. For a primary input power of 16W, a core with a core area of 32-48 mm2 is needed. EE20 core will work well for this design.

Transformer wire. Any wire that can carry the required current can be used. To know how much current a given wire can carry, SMPS designers use a number called current density [J] for this calculation. Empirically, a good starting point is J = 5 amps/mm2. The primary carries 0.3 amps, so it can be wound using SWG 38. The secondary carries 5 amps, so it can be wound with SWG 26. A good practice would be to wind the secondary using two parallel strands of SWG 28. This reduces the skin effect. The key problem in flyback transformers is leakage inductance, which is caused by poor coupling between the primary and secondary windings. So wind them tight, with full overlap.

The air gap. Flybacks made from power ferrites must have an air gap. The energy stored in a flyback primary is E = ½ L.I2. Peak primary current depends inversely on primary inductance. An air gap increases the energy storage capacity of a flyback transformer. It is calculated as follows:
Air gap = (µ0 x N2 x Ac)/Lprimary
where:
µ0 = permeability of free space, 4π x 10-7
Ac = Core area (m2)
N = Primary turns
Lprimary = (Vprimary.pk × Ton.primary)/ Iprimary.pk

The primary inductance computes to ~3mH, so the air gap is approximately 0.2mm. However, this value is not critical, as was experienced by the authors during their experiments. Any air gap in the neighbourhood of the calculated value works well. A thin sheet of plastic or paper works fine.

An actual-size, single-side PCB for the simple 12V, 1A SMPS is shown in Fig. 3 and its component layout is shown in Fig. 4. Assemble the circuit on the recommended PCB to minimise assembly errors. Use IC base for IC1.

To test if the circuit is functioning properly, first check the regulated output at TP1 with respect to TP0. The voltage should be stable with or without a load.



Sourced By: EFY Author : AshvinI Vishvakarma and Atanu Dasgupta
 


Social Time

Google Plus
Follow Us
Pinterest
Follow Us

Subscribe to our newsletter

(Get fresh updates in your inbox. Unsubscribe at anytime)