Showing posts with label a. Show all posts
Showing posts with label a. Show all posts

Monday, September 23, 2013

A Car Battery Monitor

A close call on the road can really focus your mind on the importance of having a battery monitor in a car. I had been enjoying a pleasant week of travelling around the countryside at a leisurely pace and taking in the beautiful scenery each day. It wasnt until the final day, with the big rush to return home, that I had to drive at night.My home is deep in the country and on the road I was travelling the closest petrol station may be 80km away. I was travelling through an area that is full of open-cut coal mines and large heavily loaded semi-trailers constantly pound the roads, travelling at quite high speeds. It was around 8pm at night and everything was very dark no street lights or house lights anywhere.

Just as I was going up a hill, the lights began to dim and the engine coughed. A large semi-trailer loomed in the rear-vision mirror as I pushed the clutch in and tried to restart. My speed was falling rapidly and my lights were blacked out - I was like a sitting duck in the middle of the road, as the semi-trailer came rapidly bearing down on me. I just managed to pull the car off the road, as the semi-trailer came screaming past, missing me by inches! After calling for assistance from the NRMA, the problem was found to be a fault in the alternator, which was failing to charge the battery. The battery voltage had been falling under the heavy load of the lights and at the worst possible time, there was not sufficient power for the lights or the motor.

After the initial shock wore off, I put on my thinking cap to come up with a PIC-based solution to the problem. What was really needed was a display and a buzzer, to get my attention should the voltage fall outside a specified range. So my design criteria was set, a series of LEDs could indicate the voltage and a buzzer would also be used to warn of problems.
Main Features:
  • Visual indication of battery voltage
  • Audible warning when voltage becomes low
  • Screw terminals for easy connection
  • Simple and easy to build
Circuit details:

The circuit is based on PIC16F819 18-pin microcontroller which has an analog-to-digital (A/D) input to monitor the battery voltage and outputs capable of driving LEDs directly, to keep the component count down. There are seven LEDs in all, giving a good range of voltage indication. The topmost LED, LED1, comes on for voltages above 14V which will occur when the battery is fully charged. LED2 indicates for voltages between 13.5V and 14V while LED3 indicates between 13V and 13.5V. Normally, one of these LEDs will be on. LED4 covers 12.5V to 13V while LED5 covers 12V to 12.5V. LED6 covers from 11.5V to 12V while LED7 comes on for voltages below 11.5V. These two LEDs are backed up by the piezo chime which beeps for voltages between 11.5V and 12V and becomes more insistent for voltages below 11.5V.

That might seem fairly conservative. After all, most cars will start with no troubles, even though the battery voltage might be a touch below 12V, wont they? Well, no. Some modern cars will happily crank the motor at voltages below 11V but their engine management will not let the motor start unless the voltage is above 11V. So dont think that a modern car will always start reliably. This little battery monitor could easily prevent a very inconvenient failure to start! So lets describe the rest of the circuit. The incoming supply is connected via diode D1 which provides protection against reverse polarity while zener diode ZD1 provides protection from spike voltages.

A standard 7805 3-terminal regulator is then used to provide a stable 5V to the microcontroller. The battery voltage is sensed via a voltage divider using 33kΩ and 100kΩ resistors. This brings the voltage down to within the 0-5V range for the A/D input of the PIC16F819. Port B (RB0 to RB7) of the microcontroller is then used to drive the various LEDs, with current limiting provided via the 330Ω resistor network. RB7, pin 13, drives a switching transistor for the piezo buzzer.

Software:

For the software, the design follows the basic template for a PIC microcontroller. Port A and its ADC (analog-to-digital converter) function are set up while port B functions as the output for the LEDs and buzzer. Once the set-up is complete, a reading will be taken at port RA2, the input for the A/D convertor. This reading is then compared with a series of values to determine the range of the voltage. This is similar to a series of "if" statements in Basic language. If the voltage is found to be within a certain range, the relevant port B pin will be turned on. If the voltage is below 12V, the buzzer will be turned on for a brief period, to signal a low battery condition. As the voltage falls below 11.5V, the frequency of the beeps will increase, to signal increased urgency.

Building it:

All the parts are mounted on a small PC board measuring 46 x 46mm (available from Futurlec). The starting point should be the IC socket for the PIC16F819, as this is easiest to mount while the board is bare. The next item can be the PC terminal block. The resistors and capacitors can then follow. Make sure the electrolytics are inserted with correct polarity.

Make sure that you do not confuse the zener (ZD1) with the diode when you are installing them; the diode is the larger package of the two.

Even more important, dont get the 78L05 3-terminal regulator and the 2N3906 transistor mixed up; they come in identical packages. The 78L05 will be labelled as such while the 2N3906 will be labelled "3906". And make sure you insert them the correct way around. The buzzer must also be installed with the correct polarity. The 330Ω current limiting resistors are all in a 10-pin in-line package. There are four green LEDs, two yellow and one red. They need to be installed in line and with the correct orientation.

Testing:

Before you insert the PIC16F819 microcontroller, do a voltage check. Connect a 12V source and check for the presence of 5V between pins 14 & 5 OF IC1. If 5V is not present, check the polarity of regulator REG1 and the polarity of the diode D1. If these tests are OK, insert the IC and test the unit over a range of voltage between 9V and 15V. Make sure that all LEDs come on in sequence and the piezo buzzer beeps for voltages below 12V.

Now it is matter of installing the unit in your car. It is preferable to install the unit in a visible position for the driver. However, it should not obscure any other instruments. The unit should be connected to the cars 12V supply after the ignition switch. This will turn the unit off with the other instruments and prevent battery drain while the motor is not running.

Author :Alan Bonnard Copyright : Silicon Chip Publications Pty Ltd

ReadMore....

Friday, April 12, 2013

A Discharger for Receiver Battery Packs

You may have read about cycling NiCad batteries. If not, read a little here ( Reds R/C Battery Clinic) for an excellent overview. Overcharging apparently leads to voltage depression, which can be corrected by one or two complete discharges (to 1 to 1.1 volts per cell). On the other hand, over discharging the batteries to a low or zero voltage can damage them, and if the batteries have not been overcharged and have no voltage depression, cycling just uses up regular battery life. I designed and use this discharger occasionally to remove voltage depression and insure battery capacity is still ok for those planes that have no low voltage alarm.

Note that the 100 ohm resistors are 1/2 watt (these are the load resistors), the rest are 1/4 watt. The red LED lights while discharging, buzzer sounds and discharge rate drops to 15-25mA (for the buzzer) when complete. The discharge load is 60mA to 110mA depending on the battery voltage. Since thats about the same current draw as my Hitec receiver and two HS-80s draw while flying handlaunch, I can use discharge time almost directly to indicate flying time. The buzzer uses enough current to keep a 150mA battery down, but when discharging a 600mA battery, the battery recovers quickly when the load is removed--the buzzer/discharger cycles on and off. Threshold voltage of the discharger is set to 4.2 volts. Since the discharger still draws some current when buzzing, try to disconnect the discharger once the alarm sounds--dont leave it going for hours lest the battery be over discharged.

Discharger for Receiver Battery Packs circuit

There are a couple ways you could modify the circuit to work with a 5-cell 6-volt receiver battery pack. The two 1k resistors are a divider network, so one way would be to change the resistors to change the sampling voltage at the comparator. The formula for a divider network is Vout=Vin(R2/(R1+R2)) or R1=R2*((Vin/Vout)-1). Here, R1 is the resistor connected to the positive lead and pin 7 of the comparator, Vin is 5.25 volts (1.05 volts per cell discharge shutoff threshold), and Vout is the reference 2.1 volts (the voltage produced by the LM317T and the 180 and 270 ohm resistors). You can use R2 as the same 1k value that was there before. So R1=1000*((5.25/2.1)-1)=1500=1.5k. So swap the top 1k resistor in the schematic for a 1.5k, and the new shutoff voltage for your device will be 5.25 volts.

To increase the discharge rate, decrease the resistance of the load resistors. You could use four 100 ohm resistors in parallel instead of two, for example, and it would discharge twice as fast. Resistance of a number of resistors in parallel is the value of the resistor devided by the number of the resistors. Here, 100 ohms/ four resistors is 25 ohms. At five volts, current is (5 volts)/(25 ohms)=0.2 ampere or 200mA. Be careful not to decrease resistance too much however--the small signal transistor used in this particular circuit is probably only rated for maximum 500 mA.

Circuit diagram :
Discharger for Receiver Battery Packs circuit 1 Discharger for Receiver Battery Packs1
Parts:
273-074 Miniature Piezo Buzzer, 12v, PC board mount
271-312 1/4 watt 5% carbon film resistors, 500 pieces (Just do it!)
276-1778 LM317T adjustable voltage regulator
276-1712 Quad comparator LM339
276-1622 LED assortment (20 count)
276-2009 NPN Silicon transistor MPS2222A (2N2222)

Custom electronics:
 
I post this design not because I think this is a brilliant piece of circuit design but because the design works, and it can give you a start on your own experimentation. The idea is to use the power available from the discharging battery to monitor the voltage of the battery, shut off discharging at a preset voltage (here 1.05 volts/cell), and sound an alarm when discharging is complete. To do so means a voltage reference powered by the changing voltage of the battery, here the LM317T and the 180 with 270 ohm resistors. You could just as easily use a LM336 (see the low voltage warning buzzer page) or a zener with resistor, or something else as a reference. Since the reference voltage must be below the ambient battery voltage, a pair of 1k resistors provides the divided test voltage. The LM339 is a four way comparator.
 
This design uses really three comparators: in addition to the one driving the transistor, a comparator drives the LED and another drives the buzzer. But you could use a single comparator (like the LM311) with the buzzer across the emitter and collector of the transistor, and the LED in series with a 270 ohm resistor across (parallel with) the 100 ohm load resistors. With the transistor conducting, the voltage drop across base and emitter is low, and the buzzer is quiet. The tiny current in a piezo buzzer (7 mA), when the transistor is not conducting, would be divided between the load resistors and the LED, and the LED is dark.
A word about the comparator.

 
Source :  http://www.ecircuitslab.com/2011/06/discharger-for-receiver-battery-packs.html
ReadMore....

Build a Digital Stopwatch 0 60sec

Now Build a Digital Stopwatch 0-60sec By using the same circuit of the Digital Stopwatch 0-99sec , we can add an AND gate, and transform the 0 – 99sec stopwatch to a 0 – 60sec stopwatch.We must find a way to control the RESET function of the BCD counter, which is responsible for the counting of the seconds. As we studied above, the circuit resets when we have 99 to 100, that is 1001 1001 à 0001 0000 0000. To make a transformation successfully we must force the pulse from 59 to 60 0011 1001 à 0100 0000 on the output of the BCD counter.

 By placing the AND gate, with its inputs on the Q1 and Q2 of the BCD counter of the decades, we make sure that when the gate closes, the RST input of the BCD counter will be set to logical “1”, which on its turn, will force the circuit to start over. The transformed circuit appears in picture 2.
ReadMore....

Monday, April 8, 2013

How to Make a Small Homemade Automatic Voltage Stabilizer for TV sets and Refrigerator

A voltage stabilizer is a device which is used to sense inappropriate voltage levels and correct them to produce a reasonably stable output at the output where the load is connected.
Here we will study the design of a simple automatic mains AC voltage stabilizer which can be applied for the above purpose.

How the Circuit Functions

Referring to the figure we find that the whole circuit is configured with the single op amp IC 741. It becomes the control section of the whole design.

The IC is wired as a comparator, we all know how well this mode suits the IC 741 and other op amps. Its two inputs are suitable rigged for the said operations.

ReadMore....

Saturday, April 6, 2013

Build a LT3582 12 DC 5V to 12V DC Converter

Using LT3582-12 dual channel DC DC converter integrated circuit, manufactured by Linear Technology, can be designed a very simple step up dc converter. This 5 to 12V c converter electronic project provide both positive and negative outputs required in many biasing applications such as active matrix OLED (organic light-emitting diode)displays as well as CCD (charge coupled device) applications.

Build a LT3582-12 DC 5V to 12V DC Converter

The LT3582 offer an I2C interface that can dynamically program output voltages, power sequencing and output voltage ramps as the application requires. The LT3582’s positive output voltage can be set between 3.2V and 12.775 in 25mV steps, whereas the negative output can be set between -1.2V and -13.95V in 50mV steps. The LT3582-12 is preconfigured with ±12V output, requiring no future programming.
ReadMore....

Friday, April 5, 2013

How to Drive a Relay through an Opto Coupler Circuit

The following post describes how to drive a relay by using an isolated method, or through an opto coupler device.


The question was asked by one of the interested members of this blog, Miss Vineetha.

Before studying the proposed design, lets first understand how an opto coupler works.

An opto-coupler is a device  which encapsules an LED and a photo-transistor inside a hermetically sealed, water proof, light proof package in the form of an 8 pin IC (resembling a 555 IC).

The LED is terminated over a couple of pin outs, while the three terminals of the photo-transistor is terminated over the other three assigned pin outs.

The idea is simple, its all about providing an input DC from the source which needs to be isolated to the LED pin outs via a limiting resistor (as we normally do with usual LEDs) and to switch the photo transistor in response to the applied input triggers.

The above action illuminates the internal LED whose light is detected by the photo-transistor causing it to conduct across its relevant pin outs.

The photo-transistor output is normally used for driving the preceding isolated stage, for example a relay driver stage.

As shown in the following circuit diagram, the relay driver may consist a NPN transistor or a PNP transistor.

If its a PNP transistor, the base is coupled at the collector of the photo transistor, alternatively, if a NPN transistor is used in the relay driver, the trigger is received from the emitter of the photo transistor quite like a Darlington paired configuration.

The rest of the operations are self evident.










ReadMore....

Thursday, April 4, 2013

How to Make a Long Duration Timer Circuit

A timer in electronics is essentially a device which is used for producing time delay intervals for switching a connected load. The time delay is set externally by the user as per the requirement.


A simple timer can be built through many countless options. You can transistors, CMOS gates like NAND gates, NOT gates, linear ICs like 555, 741, 324, or simply more specific type of CMOS IC like the 4060.

All these devices besically generate oscillations which are adjustable right from a few Hz a second to a atomic fraction of a Hz.

Further more these ICs can be integrated together to form more complex timer circuits that may be used for generating very long time intervals.

In this post we see how two different modes of ICs are coupled together to form a long duration timer circuit.

Referring to the circuit diagram.

IC1 is an oscillator counter IC consisting a built in oscillator stage and generates clock pulses with varying periods across its pins 1,2,3,4,5,6,7,9,13,14,15.

The output from pin 3 produces the longest time interval and therefore we select this output for feeding the next stage.

The pot P1 and the capacitor C1 of IC1 can be used for adjusting the time span at it pin 3.

The higher the setting of the above components the longer the period at pin #3.

The next stage consists of decade counter IC 4017 which does nothing but increase the time interval obtained from IC1 to ten folds. It means if the the time interval generated by IC1s pin #3 is 10 hours, the time generated at pin #11 of IC2 would be 10*10 = 100 hours. Similarly if the time generated at pin #3 of IC1 is 6 minutes, would mean a high output from pin#11 of IC1 after 60 minutes or 1 hour.

When power is switched ON, capacitor C2 makes sure that the reset pins of both the ICs are appropriately reset, so that the ICs begin counting from zero rather than from some irrelevant intermediate figure.

As long as the counting progresses, pin #11 of IC2 remains at logic low, such that the relay driver is held switched OFF.

After the set timing lapses, pin#11 of IC2 goes high activating the transistor/relay stage and the subsequent load connected with the relay contacts.

The diode D1 ensures that the output from pin#11 of IC2 locks the counting of IC1 by providing a feed back latch signal at its pin #11.
Thus the whole timer latches until the timer is switched OFF and restarted again for repeating the entire process.
Parts List

R1, R3 = 1M
R2, R4 = 1K,
C1, C2 = 1uF/25V,
D1, D2 = 1N4007,
IC1 = 4060,
IC2 = 4017,
T1 = BC547,
POT = 1M linear
RELAY = 12V SPDT


ReadMore....

A Simple Function Generator

Simple triangle-wave generators have a weakness in that the waveform of their output signal normally cannot be modified. The circuit presented here makes it possible to smoothly alter the waveform of a linearly rising and steeply trailing saw-tooth signal through a symmetrical triangle-wave to a slowly trailing, steeply rising linear sawtooth. The wanted waveform may be selected independently of the frequency, which can also be varied uniformly from 0.2 Hz to 8 kHz. At the same time, a rectangular signal with variable duty cycle (also independent of frequency) is available at the rectangular-signal output of the circuit.
Simple_Function_Generator_Circuit_Diagram1 
The circuit consists of integrator IC1b, whose output is applied to comparator IC1c. The output of the comparator is a rectangular signal The output of IC1b is raised by amplifier IC1d to a level that allows the full output voltage range of the operational amplifier to be used. Op amp IC1a provides a stable virtual earth, whose level is set to half the supply voltage with P1. The smooth setting of the frequency is made possible by feedback of part of the output of the comparator to the input of the integrator via P2. This preset is usually not provided in standard triangle-wave generators. Network D1-R1-D2-R2-P3 makes it possible to give integrator capacitor C3 different charging and discharge times.
This arrangement enables the output signal at A1 and the duty cycle of the rectangular wave signal at A2 to be varied. Varying the amplification factor with P5 has no effect on the frequency set with P2. The slope of the signal edges, the transient responses, and the output voltage range (rail-to-rail or with some voltage drop) depend on the type of op amp used. The TL084 used in the prototype offers a good compromise between price and meeting the wanted parameters. The circuit is best built on a small piece of prototyping board. The circuit draws a current of not more than 12 mA.
Brief parameters:
Provides triangle-wave, sawtooth or rectangular signal
Waveform variable independently of frequency (triangle wave and sawtooth)
Duty cycle of rectangular signal can be set independently of frequency
Applications:
Test and measurement
Pulse-width control
Summary of preset action:
P1 – sets virtual earth to a level equal to Ucc/2;
P2 – sets the frequency;
P3– sets the waveform;
P4 – sets the hysteresis of the comparator (frequency and amplitude of the triangle-wave signal)
P5 – sets the amplification of the triangle-wave and sawtooth signals.
ReadMore....