Saturday, July 31, 2010

Optimised Semiconductor Noise Source

We have already published designs that use a transistor junction operating in Zener breakdown as a noise source. Anyone who has experimented with a reverse-biased transistor knows that the amplitude of the noise voltage generated in this manner is strongly dependent on the supply voltage. The variation between individual transistors is also rather large. An obvious solution is to use an adjustable supply voltage for the noise generator stage. A BC547B starts to break down at around 8V.

Optimized Semiconductor Noise SourceUsing P1 and R1, you can adjust the voltage across T1 and R2 between 8 and 12V. C3 decouples the reduced supply voltage. An impedance buffer in the form of T2 and R3 is added to the circuit, to prevent the connected load from affecting the noise source. This buffer is powered directly from the 12-V supply. To adjust this circuit, connect the output to an oscilloscope. Then adjust P1 to obtain the highest signal amplitude, combined with the best ‘shape’ of the noise signal. The output voltage is approximately 300mVpp, and the current consumption is around 2mA.
Continue[...]

RGB To Color Difference Converter

The circuit diagram shows two LT1398’s from Linear Technology used to create buffered color-difference signals from RGB (red-green-blue) inputs. In this application, the R input arrives via 75Ω coax. It is routed to the non-inverting input of amplifier IC1a and to 1.07-kΩ resistor, R8. There is also an 80.6-Ω termination resistor R11, which yields a 75-Ω input impedance at the R input when considered in parallel with R8. R8 connects to the inverting input of a second LT1398 amplifier (IC1b), which also sums the weighted G and B inputs to create a –0.5Y output.

RGB To Color Difference Converter circuit diagramYet another LT1398 amplifier, IC2a, then takes the –0.5Y output and amplifies it by a gain of –2, resulting in the +Y output. Amplifier IC1a is configured for a non-inverting gain of 2 with the bottom of the gain resistor R2 tied to the Y output. The output IC1a thus results in the color-difference output R–Y. The B input is similar to the R input. Here, R13 when considered in parallel with R10 yields a 75-Ω input impedance. R10 also connects to the inverting input of amplifier IC1b, adding the B contribution to the Y signal as discussed above.

PSU RGB To Color Difference ConverterAmplifier IC2b is configured to supply a non-inverting gain of 2 with the bottom of the gain resistor R4 tied to the Y output. The output of IC2b thus results in the color-difference output B–Y. The G input also arrives via 75-Ω coax and adds its contribution to the Y signal via resistor R9, which is tied to the inverting input of amplifier IC1b. Here, R12 and R9 provide the 75Ω termination impedance. Using superposition, it is straightforward to determine the output of IC1b. Although inverted, it sums the R, G and B signals to the standard proportions of 0.3R, 0.59G and 0.11B that are used to create the Y signal. Amplifier IC2a then inverts and amplifies the signal by 2, resulting in the Y output. The converter draws a current of about 30mA from a symmetrical 5-volt supply.
Continue[...]

Simple RF Detector For 2M

This simple circuit helps you sniff out RF radiation leaking from your transmitter, improper joints, a broken cable or equipment with poor RF shielding. The tester is designed for the 2-m amateur radio band (144-146 MHz in Europe). The instrument has a 4-step LED readout and an audible alarm for high radiation voltages. The RF signal is picked up by an antenna and made to resonate by C1-L1. After rectifying by diode D1, the signal is fed to a two-transistor high-gain Darlington amplifier, T2-T3.

Simple RF Detector For 2M circuit diagramAssuming that a 10-inch telescopic antenna is used, the RF level scale set up for the LEDs is as follows: When all LEDs light, the (optional) UM66 sound/melody generator chip (IC1) is also actuated and supplies an audible alarm. By changing the values of zener diodes D2, D4, D6 and D8, the step size and span of the instrument may be changed as required. For operation in other ham or PMR bands, simply change the resonant network C1-L1. As an example, a 5-watt handheld transceiver fitted with a half-wave telescopic antenna (G=3.5dBd), will produce an ERP (effective radiated power) of almost 10 watts and an e.m.f. of more than 8 volts close to your head.
Simple RF Detector For 2MInductor L1 consists of 2.5 turns of 20SWG (approx. 1mm dia) enameled copper wire. The inside diameter is about 7mm and no core is used. The associated trimmer capacitor C1 is tuned for the highest number of LEDs to light at a relatively low fieldstrength put up by a 2-m transceiver transmitting at 145 MHz. The tester is powered by a 9-V battery and draws about 15mA when all LEDs are on. It should be enclosed in a metal case.
Continue[...]

Serial To Parallel Converter

This converter may help if just the serial port on a personal computer is free, whereas the printer needs a parallel (Centronics) port. It converts a serial 2400 baud signal into a parallel signal. The TxD line, pin 3, CTS line, pin 8 and the DSR line, pin 6, of the serial port are used - see diagram. The CTS and DSR signals enable handshaking to be implemented. Since the computer needs real RS232 levels, an adaptation from TTL to RS232 is provided in the converter by a MAX232. This is an integrated level converter that transforms the single +5V supply into a symmetrical ±12V one.

Serial To Parallel Converter circuit diagramThe serial-to-parallel conversion is effected by IC1. This is essentially a programmed PIC controller that produces a Centronics compatible signal from a 2400 baud serial signal (eight data bits, no parity, one stop bit). The IC also generates the requisite control signals. If there is a delay on the Centronics port, the RS232 bitstream from the computer may be stopped via the Flow signal (pin 17). This ensures that no data is lost. The controller needs a 4 MHz ceramic resonator, X1.
Continue[...]

Sensitive Overload Sensor

The best way to measure the current in a circuit is to place a sense resistor in the current path. The higher the resistance, the more exact the measurement will be. However, the drawback of a high resistance is that it affects the operation of the circuit in which the measurement is being made. If an active sort of sensor is used, the sense resistance can be kept small. The circuit diagram shows how a sensitive overload indicator can be built using a simple opamp (such as an LF351) and a sense resistor in the current path.

table Sensitive Overload SensorA voltage difference is generated between the plus and minus inputs of the opamp with the help of a diode. Usually, the voltage drop across D1 (a Schottky diode) will be 0.2 to 0.3 V. This value can be influenced somewhat by R1, which affects the amount of current that flows through the diode. The larger the value of R1, the smaller the voltage drop across the diode. The inverting input of the opamp is connected to the positive supply voltage following the sense resistor Rs. Consequently, the voltage level at the output of the opamp will be equal to the negative supply voltage, for example –5 V.

Sensitive Overload Sensor circuit diagramAs the current that flows through the sense resistor Rs increases, the voltage on the inverting input of the opamp decreases. As soon as the voltage drop across Rs (= Is × Rs) becomes slightly greater than the voltage drop across D1, the output of the opamp will switch to the positive supply voltage level. An indicator lamp or relay can be connected to the opamp output. The maximum supply voltage for the opamp is ±15 V, so the circuit can readily be used to monitor symmetric power supplies with voltages between 5 and 15V.
Continue[...]

Rainwater Storage Gauge

Not only on ecologically grounds but also economically it makes sense to collect rainwater for use in the garden and increasingly for `grey water` domestic use. People who take rainwater collection seriously use large underground tanks for storage. The problem now arises, how can the water level be determined without lifting the tank hatch and peering in? One solution is to use float switches mounted at different heights in the water tank, and to use a row of LEDs mounted remotely to show the water level in the tank. Transferring this information to a remote display will involve long cable runs so it is of interest to reduce the number of cables to a minimum.

The circuit here shows how information about the water level in a tank can be sent over two wires to a remote LED display. R1 together with the resistor chain made up of R2-R6 form a voltage divider, float switches are wired across the resistors R2-R6 in one arm of the voltage divider. As water flows into the tank and the level rises, switch S5 closes followed by S4, etc. Each time a switch closes, it will short out its parallel resistor in the chain thereby changing the output voltage of the divider. When the tank is full, all five switches will be closed and all the LEDs will be on. The voltage output from this divider chain is applied to the inputs of five op amps that are configured as comparators.

Rainwater Storage Gauge circuit diagramA voltage chain comprising R7-R12 supplies the reference voltage for each of the five comparators. Both divider chains use the same supply so they will be insensitive to supply fluctuations. The maximum supply current for the circuit is less than 25mA. Some of the resistors chosen to make up the voltage dividers are not standard values but can be easily made up from combinations of 10kΩ and 100kΩ resistors. If you need to expand this five level display to give a better resolution of the tank contents, it is a simple job to add more float switches and to expand the voltage divider chain. IC2 also has three spare op amps; these can be pressed into service as further comparators.

Underground tanks inevitably require a pump to move the water to where it will be used. An optional feature of this design is the pump protection circuit. When LED D1 goes off indicating that the tank is almost empty, the solid state relay SSR1 can be used to switch off the mains power to the pump. This will prevent damage to the pump when the tank runs dry. The S202 SE1 solid-state relay (SSR) from Sharp has an isolation voltage between its input and output of 3000V (Class 1). It is important to note here that any mains equipment near the water tank installation must be supplied from an RCD safety socket for the sake of your own health!
Continue[...]

Symmetric Noise Source

If a transistor junction operating in Zener breakdown is used as a noise source, the amplitude of the noise signal is asymmetric. This problem can be solved by using two transistors as two independent noise sources. One of these has a series resistor to earth, and the other has a series resistor to the supply line. Each of these noise sources produces an asymmetric noise voltage, with opposite asymmetry. If these two voltages are combined, the amplitude of the result will be symmetric. In the circuit diagram, T1 and T2 are the noise sources. The series resistors are R2 (to earth) and R4 (to the positive supply line).

The supply voltage for the noise sources has been made adjustable, to allow the noise generation of the transistors to be optimized. This is because the amount of noise produced depends on the power supply voltage. P1 and R1 provide an adjustable supply voltage between 8 and 12 V for the noise stage around T1, while P3 and R3 perform the same function for T2. C3 and C5 smooth these voltages. Since the amplitudes of the two noise sources will never be the same, it is necessary to take a weighted sum of the two signals. Consequently, P2 is included between the outputs of the noise sources as a sort of balance control.

Symmetric Noise Source circuit diagramSince the DC levels of the two noise sources are not the same, C4 is also included in the balance network. The weighted sum of the two signals is present on the wiper of P2, superimposed on the DC signal of noise source T1. This DC level is also used for the DC bias of the buffer stage T3. The buffer isolates the noise sources from whatever circuit is connected to the output. To adjust the circuit, connect an oscilloscope to the output. First, turn P2 all the way to the left. Now rotate P1 until a maximum noise signal is seen on the oscilloscope. Next, turn P2 all the way to the right, and then adjust P3 for the best noise signal. Finally, adjust P3 so that the noise signal looks symmetric. The circuit provides an output voltage of approximately 150mV pp. The current consumption is 2mA. The oscilloscope shows the asymmetric noise signal on channel 2, and the symmetric noise signal on channel 1.
Continue[...]

Two-Position Dimmer

This super-simple dimmer consists of only two components, and it can easily be built into a mains switch. If you do this, don’t forget to first switch off the associated branch circuit in the fuse box, since the mains voltage is always dangerous! The circuit does not need much explanation. When S1 is closed, the lamp works at full strength, and the position of S2 does not matter. When S1 is open and S2 is closed, the capacitor causes a voltage drop, so the lamp is dimmed. The power dissipation of the capacitor is practically zero, so the circuit does not generate any heat.

Two-Position Dimmer circuit diagramThe resistor prevents sparking when S2 is closed while S1 is already closed. The value of the capacitor can be matched to the power of the lamp to be dimmed; it should be between 2 and 6µF. Be sure to use a class X2 capacitor. Also, don’t forget that this circuit works only with resistive (non-inductive) loads. Unpredictable things can happen with an inductive load!
Continue[...]

PC-Powered Battery Charger

Some workbenches can’t help ending up looking like a rats nest of cables and equipment, so its always an advantage if a piece of mains equipment can be removed from somewhere to free up an extra mains socket. Here we are using the ubiquitous PC as a battery charger. An unused serial interface port can supply enough current to charge (or trickle charge) low-capacity Nickel Cadmium (NiCd) batteries. You could for example, use the batteries in a radio and charge them during use.

PC Powered Battery Charger Circuit DiagramThe three serial port connections TxD, DTR, and RTS, when not in use, are at –10 V and can supply a current of around 10 to 20mA (they are short-circuit protected). The circuit shown supplies a charging current of approximately 30mA. If it is necessary to alter the polarity of the charging circuit then it is a simple job to reverse the diodes and using software, switch the port signals +10 V. Those interested could also write a software routine to automatically recharge the batteries.
Continue[...]

One Transistor Radio

Here is a simple circuit for a one transistor Audion type radio powered by a 1.5 V battery. It employs a set of standard low-impedance headphones with the headphone socket wired so that the two sides are connected in series thus giving an impedance of 64 Ω. The supply to the circuit also passes through the headphones so that unplugging the headphones turns off the supply. Using an Audion configuration means that the single transistor performs both demodulation and amplification of the signal.

One Transistor Radio Circuit DiagramThe sensitivity of this receiver is such that a 2 m length of wire is all that is needed as an antenna. The tap on the antenna coil is at 1/5th of the total winding on the ferrite rod. For details of the antenna coil see the article Diode Radio for Low Impedance Headphones. This circuit is suitable for reception of all AM transmissions from long-wave through to shortwave.
Continue[...]

Low Power 12V Transformerless Power Supply

Many circuits can be powered directly from the mains with the aid of a series capacitor (C1). The disadvantage of this approach is that usually only one half cycle of the mains wave-form can be used to produce a DC voltage. An obvious solution is to use a bridge rectifier to perform full-wave rectification, which increases the amount of current that can be supplied and allows the filter capacitor to be smaller. The accompanying circuit in fact does this, but in a clever manner that uses fewer components. Here we take advantage of the fact that a Zener diode is also a normal diode that conducts current in the forward direction. During one half wave, the current flows via D1 through the load and back via D4, while during the other half wave it flows via D3 and D2. Bear in mind that with this circuit (and with the bridge rectifier version), the zero voltage reference of the DC voltage is not directly connected to the neutral line of the 230-V circuit.

Low Power 12V Transformerless Power Supply circuit diagramThis means that it is usually not possible to use this sort of supply to drive a triac, which normally needs such a connection. However, circuits that employ relays can benefit from full-wave rectification. The value of the supply voltage depends on the specifications of the Zener diodes that are used, which can be freely chosen. C2 must be able to handle at least this voltage. The amount of current that can be delivered depends on the capacitance of C1. With the given value of 220nF, the current is approximately 15mA. A final warning: this sort of circuit is directly connected to mains voltage, which can be lethal. You must never come in contact with this circuit! It is essential to house this circuit safely in a suitable enclosure.
Continue[...]

Tuesday, July 27, 2010

A 12V Car Charger For ASUS Eee Notebook

The ASUS Eee is a fantastic ultra-portable notebook with almost everything required for geeks (and nothing that isn’t). Plus it features fantastic build quality and is very well priced. If you live in New Zealand you can get them from DSE; at the time of writing they are the exclusive supplier. I worked out it’s the same cost as importing one once you include all the duties and tax, plus you get the advantage of a proper NZ-style mains charger. Anyway, being so small I thought it would be nice to be able to carry this around in the car. Unfortunately I couldn’t find a car charger available anywhere at the time so I decided to tackle the problem myself. As a bonus this provides an opportunity for an external high-capacity battery.

Commercial Equivalent:
I thought at this stage it would be worth noting that a commercial car charger is now available for less than it cost me to build this from Expansys and is available in most countries (select your location on their site). It outputs 9.5v from 10-18v in at up to 2.5A. I’d actually recommend it over the design here is it seems to perform better at lower voltages (that one works down to 10V). However I have kept this page up as a reference for those who enjoy tinkering.

Design:
The charger included with the Eee is rated at 9.5v, 2.315A. There isn’t a fixed voltage regulator available for this exact voltage, so the circuit needed to be designed around an adjustable regulator. I decided to design the charger around the LM2576 “Simple Switcher” IC from National Semiconductor. There are tons of ICs like this available, many of which are a bit more efficient, however I selected this one because it is readily available and relatively cheap. It also has a lower drop-out voltage (~2V) than many other chips I looked at which is important when powering the device from a car or 12v SLA battery.

This circuit could have used a standard three pin regulator IC such as the LM317, however most types require an external transistor when handling so much current and not to mention the fact that they are very inefficient; they draw the same amount of current from the input as the load and the difference in power is dissipated as heat. The main problem with using the LM2576 is the fact it needs quite a large inductor due to its somewhat low switching frequency. The inductor I used is made by Pulse Engineering, part number PE92108KNL. I’d prefer a smaller one, however I couldn’t find one capable of supplying the required current that I could purchase in single units. Besides the PE92108KNL is apparently designed specifically to work with the LM257x series.

The circuit also includes a low voltage cut-out based on a 9.1v Zener diode and BC337 transistor that will shut down the regulator if the input voltage is below 11.5V. This prevents unstable operation of the regulator at lower input voltages, and also helps prevent accidental flattening of the supply battery. Substituting this transistor for similar type may affect the cut-out voltage; the Vbe of the transistor should be 1.2v.All of the components used should be pretty readily available in most areas. I got everything from Farnell. Jaycar also sells everything except the inductor. Make sure you specify high temperature, low ESR capacitors as these help result in more stable operation and better efficiency of the charger.

Unfortunately the end result is a charger that is slightly bulkier than I would really like. I attempted to fit this inside an old mobile phone charger case so the whole thing could hang out of the cigarette lighter, however I ran into trouble making the circuit stable enough and dissipating all the heat. Due to the high current involved compared to a mobile phone charger the components are much bulkier so it’s pretty tricky to get all to fit! If I do get it finished I’ll add an update.

Parts List:
  • 2x 10k resistor (R1 & R4)
  • 2x 22k resistor (R2 & R3)
  • 1x 1.5k resistor (R5)
  • 1x 120μF 25v electrolytic capacitor (C1)
  • 1x 2200μF 16v electrolytic capacitor (C2)
  • 1x 1N5822 Schottky diode (or equivalent)
  • 1x 9.1v 0.5W Zener diode
  • 1x BC337 NPN transistor
  • 1x LM2576T-ADJ IC
  • 1x 100uH, 3A inductor (e.g. Pulse PE92108KNL)
  • 25°C/W or better minature heatsink (e.g. Thermalloy 6073)
  • Cigarette lighter plug with 3A fuse and 2.1mm DC plug (e.g. DSE P1692)
  • 2.1mm DC chassis mount socket
  • 1.7mm x 4.75mm (ID x OD) DC plug and cable
  • Small plastic enclosure
Building It:
Make yourself a PCB using the template below (600dpi). I simply laser print (or photocopy) the design onto OHP transparency sheet and then transfer the toner onto a blank PCB using a standard clothes iron. Any missing spots can be touched up with a permanent marker before etching. This is quick, usually results in pretty tidy boards and hardly costs a thing. There is a tutorial on a variation of this method at http://max8888.orcon.net.nz/pcbs.htm.
Install the components on the PCB and triple check the layout before soldering. It is much easier to start with the low profile components such as resistors and diodes, then install the larger components after-wards. Don’t forget the wire link; this is shows as a red line on the layout guide above. Remember to smear a small amount of heatsink compound on the regulator tab before mounting the heatsink.

For a case I used a small plastic enclosure from DSE, part H2840, as it was all the local store had in stock that was remotely suitable. The PCB is designed to fit into this particular case, however any small box should be suitable. If you have a dead laptop charger lying about it might be worth ripping the guts out of that and salvaging the case. If your enclosure is different you may need to modify the design to suit, so I have provided the schematic and PCB design files for download. They were created using Eagle. The Eee uses a standard 1.7mm DC power connector with a positive tip.
Testing:
Connect the circuit to a 12v supply. If you use a car or lead acid battery ensure you have a 3A fuse fitted in line with the circuit before connecting it, just in case. Use your multimeter to check that the circuit outputs about 9.45v with no load. Connect a 12V, 21W lamp (e.g. old brake lamp from a car) or similar load across the output and check that the voltage doesn’t vary much. You should now be able to connect your Eee. The circuit design should be good for up to 2.5A, so there is plenty of margin for the Eee to fully function and charge its own battery off this supply.

SLA Battery Carry-bag:
Jaycar have a really cool carry bag with a shoulder strap designed to perfectly fit a 12v 7AH sealed lead acid battery. The bag features a fused cigarette lighter socket and is the perfect compliment to this charger. It works well with the Eee and provides hours of extra use. The shoulder strap means it’s not too bothersome to carry about and the charger circuit itself zips up neatly inside the bag. The under-voltage cut-off means the battery will never run completely flat, and the Eee will simply cut over to its internal battery once the SLA runs out. I got my SLA battery from Rexel as they are much cheaper (approx NZ$18 including GST last time I bought one) and they don’t sit as long on the shelf as many other suppliers.

Disclaimer:
This circuit is intended for people who have had experience in constructing electronic projects before. The circuit design and build process are provided simply as a reference for other people to use and I take no responsibility for how they are used. If you proceed with building and/or using this design you do so entirely at your own risk. You are free to use the content on this page as you wish, however I do ask that you include a link or reference back to this page if you distribute or publish any of the content to others.
Continue[...]

220V AC Powered Blinking LED

I needed a pulsating light for a certain signaling. Voltage was 230V. So I decided to make a simple circuit, consisted of a LED diode, two capacitors, two resistors, a diac and a diode. Activity of the circuit is extraordinarily simple. The capacitor charges by the diode and the resistor. When the voltage on the capacitor achieves 30V the diac "releases" the electrical tension and the capacitor empties thorough the diac, LED blinks. Time base is dependent from the capacitor and the resistor, which is in series with diode 1N4007. Capacitor must be at least for 40V.

220V AC Powered Blinking LED circuit project220V AC Powered Blinking LED circuit diagram
Continue[...]

Baud Rate Generator

In this article, an RC oscillator is used as a baud rate generator. If you can calibrate the frequency of such a circuit sufficiently accurately (within a few percent) using a frequency meter, it will work very well. However, it may well drift a bit after some time, and then…. Consequently, here we present a small crystal-controlled oscillator. If you start with a crystal frequency of 2.45765 MHz and divide it by multiples of 2, you can very nicely obtain the well-known baud rates of 9600, 4800, 2400, 600, 300, 150 and 75. If you look closely at this series, you will see that 1200 baud is missing, since divider in the 4060 has no Q10 output!

Baud Rate Generator circuit diagramIf you do not need 1200 baud, this is not a problem. However, seeing that 1200 baud is used in practice more often than 600 baud, we have put a divide-by-two stage in the circuit after the 4060, in the form of a 74HC74 flip-flop. This yields a similar series of baud rates, in which 600 baud is missing. The trimmer is for the calibration purists; a 33 pF capacitor will usually provide sufficient accuracy. The current consumption of this circuit is very low (around 1mA), thanks to the use of CMOS components.
Continue[...]

Comparator Based Crystal Oscillator

Although a simple crystal oscillator may be built from one comparator of an LT1720/LT1721, this will suffer from a number of inherent shortcomings and design problems. Although the LT1720/LT1721 will give the correct logic output when one input is outside the common mode range, additional delays may occur when it is so operated, opening the possibility of spurious operating modes. Therefore, the DC bias voltages at the inputs have to be set near the center of the LT1720/LT1721’s common mode range and a resistor is required to attenuate the feedback to the non-inverting input. Unfortunately, although the output duty cycle for this circuit is roughly 50%, it is affected by resistor tolerances and, to a lesser extent, by comparator offsets and timings.

Comparator Based Crystal Oscillator circuit diagramIf a 50% duty cycle is required, the circuit shown here creates a pair of complementary outputs with a forced 50% duty cycle. Crystals are narrow-band elements, so the feedback to the non-inverting input is a filtered analogue version of the square-wave output. The crystal’s path provides resonant positive feedback and stable oscillation occurs. Changing the non-inverting reference level can vary the duty cycle. The 2k-680Ω resistor pair sets a bias point at the comparator + (Comparator IC1a) and – (Comparator IC1b) input. At the complementary input of each comparator, the 2k-1.8k-0.1µF path sets up an appropriate DC average level based on the output.

IC1b creates a complementary output to IC1a by comparing the same two nodes with the opposite input. IC2 compares band-limited versions of the outputs and biases IC1a’s negative input. IC1a’s only degree of freedom to respond is variation of pulse width; hence the outputs are forced to 50% duty cycle. The circuit operates from 2.7V to 6V. When ‘scoping the oscillator output signal, a slight dependence on comparator loading, will be noted, so equal and resistive loading should be used in critical applications. The circuit works well because of the two matched delays and rail-to-rail outputs of the LT1720.
Continue[...]

Electronic Ear for Lego RCX Module

One interface that is missing in the Lego MindStorms system is an electronic ear. We don’t mean that the RCX should respond to spoken commands (which requires a large amount of electronics and software), but it would be handy if it could respond to basic sounds (or sound levels). The circuit presented here allows the RCX to sense different sound levels. The sound is picked up by a crystal microphone, which is an inexpensive component that is available in every electronics shop. The signal from the microphone is converted into a variable quasi-resistance value. The RCX, in turn, can use this value to determine if a particular sound level has been exceeded. If the trigger threshold is set to the right level, the RCX will then react to a previously set sound level. The RCX input must be configured as a light sensor input for this function.

Electronic Ear for Lego RCX ModuleThe operation of the circuit is simple. IC1, which is wired as a non-inverting amplifier, amplifies the microphone signal by a factor of 100. The output signal from the opamp is rectified by D1 and smoothed by C1. Resistor R2 allows the capacitor to discharge. The resulting DC voltage drives IC2, which acts as a buffer. The output of this opamp is connected to the sensor input of the RCX via a 1-kΩ resistor (R1). Just as with the analogue input adapter described elsewhere in this website, the RCX sees a variable resistance value at the sensor input, and it converts this into a measurement value between 0 and 100.

In the idle state, when no sound is sensed, the measurement value lies between 90 and 100. The louder the sensed sound, the lower the measurement value. You can use the light-sensor routine of the Lego software to set the responses to various sound levels. If you use a threshold value of around 85, then a level under 85 will be sensed as a sound signal, while a level above 85 will be sensed as silence. If you clap your hands near the sensor, the circuit will detect this. If you use these ‘observations’ to increment a counter, it is even possible to measure the number of sound pulses within a defined interval, and then to carry out some action based on the result.
Continue[...]

High Input Voltage Linear Regulator

Commonly used 3-pin linear voltage regulators, for example the LM317, cannot handle input voltages in excess of about 30V. The LR8A from Supertex Inc is a new, adjustable three pin regulator that can accept input voltages up to 450V and can supply an output current of 0.5mA to 10mA. Using this device it is possible to work with rectified 230VAC. The LR8 has a wide input voltage range of +12 V to +450V. Two external resistors (R1 and R2) allow the output voltage to be adjusted from 1.20 V to 440 V provided that the input voltage is at least 10 V greater than the output voltage. The LR8 adjusts the voltage difference between the Vout and ADJ pins to a nominal value of 1.20V.

High Input Voltage Linear Regulator circuit diagramThis 1.20V is amplified by the external resistor ratio of R1 and R2. An internal constant bias current of 10µA is connected to the ADJ pin so that Vout is increased by a constant voltage of 10µA times R2. The formula for calculating the output voltage is given next to the circuit diagram. To ensure stable operation of the regulator a minimum output current of 500µA is necessary and a bypass capacitor of minimum 1.0µF should be used. Protection circuits in the LR8 limit the output current to 15mA typically and temperature protection ensures that the device temperature will not exceed 125oC.

High Input Voltage Linear RegulatorWhen the device reaches its temperature limit, the output voltage/current will decrease to keep the junction temperature within limits. The two circuit diagrams show the LR8 used as a voltage regulator and as a constant current source. The current source can be used to a drive an LED. This configuration would give an LED with super-wide input voltage range, i.e., from +12V to +450V. The LR8 was originally designed to be used for switch mode supply start-up applications so it incorporates a feature which shuts down the LR8 when the output voltage exceeds the input voltage. Diode D1 is therefore necessary in the voltage regulator circuit diagram to prevent the output voltage exceeding the input voltage at any time.

LR8 PinoutThe minimum value of the input capacitor C1 can be calculated from the following formula: C1(min) = (IL t ) / (Vpk – Vout – 10V) Where IL is the load current, and t the period between two voltage peaks. At 50 Hz, using one rectifying diode this will give a value t = 20 ms. Vpk is the peak input voltage, while Vout is the selected output voltage. The LR8 is available in two package outlines. The LR8N8 is a SOT89 SMD package while the LR8N3 is the familiar TO92 Transistor outline (e.g. BC 238). The TO-92 package can dissipate a maximum of 0.74W while with suitable heatsinking, the SMD package can dissipate 1.6W.
Continue[...]

Flip-Flop Timer Using 4017

This circuit shows how a 4017 CMOS decade counter can be used to build a timer circuit. Push-button S1 will discharge capacitor C1 through resistor R2. When S1 is released, C1 will charge up through R1 causing a rising edge at the clock input of IC1. This causes the output Q1 to go high (to the supply voltage). Current will flow through R4 and LED D2 will light. At the same time C2 will begin charging through preset P1 and R6. When the voltage on C2 reaches approximately half the supply voltage it will reset IC1. Q1 will go low, the LED will go off and C2 will discharge through D1 and R3. The circuit will now remain stable in this reset condition until S1 is pressed again. Preset P1 allows the ON time of the circuit to be adjusted between 5 seconds and 7 minutes.

Flip-Flop Timer circuit diagram Using 4017The current consumption of this circuit in its reset state is only a few micro-amps, rising to approximately 8mA mainly due to the LED current, when S1 is pressed. When power is applied to the circuit IC1, can be in an indeterminate state and the LED may be on. Pressing S1 until the LED goes off clears this condition. Alternatively C2 may be connected to the supply rail (as shown dotted in the diagram) this will ensure that IC1 will always power up in a reset state. A disadvantage of this configuration is that any noise on the supply rail will be coupled through to the reset pin of IC1 and may affect the timing period.
Continue[...]

Bipolar Stepper Motor Control

First, we want to explain how such a controller works and what’s involved. A bipolar motor has two windings, and thus four leads. Each winding can carry a positive current, a negative current or no current. This is indicated in Table 1 by a ‘+’, a ‘–‘ or a blank. A binary counter (IC1) receives clock pulses, in response to which it counts up or down (corresponding to the motor turning to the left or the right). The counter increments on the positive edge of the pulse applied to the clock input if the up/down input is at the supply level, and it decrements if the up/down input is at earth level.

Bipolar Stepper Motor Control circuit diagramThe state of the counter is decoded to produce the conditions listed in Table 2. Since it must be possible to reverse the direction of the current in the winding, each winding must be wired into a bridge circuit. This means that four transistors must be driven for each winding. Only diagonally opposed transistors may be switched on at any given time, since otherwise short circuits would occur. At first glance, Table 2 appears incorrect, since there seem to always be four active intervals. However, you should consider that a current flows only when a and c are both active. The proper signals are generated by the logic circuitry, and each winding can be driven by a bridge circuit consisting of four BC517 transistors.

table 1Two bridge circuits are needed, one for each winding. The disadvantage of this arrangement is that there is a large voltage drop across the upper transistors in particular (which are Darlingtons in this case). This means that there is not much voltage left for the winding, especially with a 5-V supply. It is thus better to use a different type of bridge circuit, with PNP transistors in the upper arms. This of course means that the drive signals for the upper transistors must be reversed. We thus need an inverted signal in place of 1a. Fortunately, this is available in the form of 1d.

table 2The same situation applies to 1b (1c), 2a (2d) and 2b (2c). In this case, IC4 is not necessary. Stepper motors are often made to work with 12V. The logic ICs can handle voltages up to 15 to 18 V, so that using a supply voltage of 12 V or a bit higher will not cause any problems. With a supply voltage at this level, the losses in the bridge circuits are also not as significant. However, you should increase the resistor values (to 22 kΩ, for example). You should preferably use the same power supply for the motor and the controller logic. This is because all branches of the bridge circuit will conduct at the same time in the absence of control signals, which yields short-circuits.
Continue[...]

ATX Power Switch Substitute

An additional push-button switch is normally required for the ATX Power Switch/Soft Power Switch signal, but you can do without it if you use this simple circuit. It is an artful design, but it has been repeatedly tested. The zener diode is intended to provide protection against excessive voltages and reverse-polarity connection. In the latter case, the resulting short-circuit current (approximately 1A) will exceed the allowable limit and cause the ATX power supply to shut down after around five seconds. It might be possible to use a smaller capacitor; this must be tested experimentally in actual use.

ATX Power Switch Substitute circuit diagramIf the motherboard documentation is poor, you should verify the earth pin using a continuity tester. The resistor is only needed if you want to be able to switch on the PC within ten seconds after switching it off. It discharges the capacitor quickly enough to make this possible. With a 1-kΩ resistor, the time constant is around 0.5 s. Since the capacitor also tends to stabilize the voltage, this circuit could also help in situations in which the ATX power supply switches off unintentionally due to voltage fluctuations on the PWR Supply On line.
Continue[...]

Monday, July 26, 2010

10 to 1000 MHz Oscillator

Nowadays, it is no longer necessary to use discrete components to build oscillators. Instead, many manufacturers provide ready-made voltage-controlled oscillator (VCO) ICs that need only a few frequency-determining external components. One example is the RF Micro Devices RF2506. This IC operates with a supply voltage between 2.7 and 3.6 V (3.3V nominal) and provides a low-noise oscillator transistor with integrated DC bias setting. In addition, it has an isolating buffer amplifier that strongly reduces the effects of load variations (load pulling) on the oscillator. If a voltage less than 0.7V is applied to the power-down input (pin 8), the oscillator is shut down and the current consumption drops from 9mA to less than 1µA. The VCO is enabled when the voltage on pin 8 is at least +3V.

10 to 1000 MHz Oscillator circuit diagramConnecting the feedback capacitors C1 and C2 to pins 3 (FDBK) and 4 (VTUNE) transforms the internal transistor into a Colpitts oscillator. A resonator is also needed; here this consists of C4 and L1, and it is coupled via C3. Keep the Q factor of the coil as high as possible (by using an air-core coil, for example), to ensure a low level of phase noise. Since most applications require a tuneable oscillator, the varicap diode D1 (BBY40, BBY51, BB804 etc) can be used to adjust the resonant frequency. The tuning voltage UTune is applied via a high resistance. The value of the tuning voltage naturally depends on the desired frequency range and the variable-capacitance diode (D1) that is used. The table shows a number of suggestions for selecting the frequency-determining components. If the frequency range is narrow, a parallel-resonant circuit should be connected between the output pin and +Vcc, to form the collector load for the output transistor.

10 to 1000 MHz Oscillator This can be built using the same components as the oscillator resonator. With a broadband VCO, use a HF choke instead, with a value of a few microhenries to a few nanohenries, depending on the frequency band. In this case C6 is not needed. The output level of this circuit is –3dBm with an LC load and –7 dBm with a choke load. The table that accompanies the schematic diagram provides rough indications of component values for various frequencies. It is intended to provide a starting point for experimentation. The coupling between the variable-capacitance diode and C5 determines the tuning range of the VCO. The manufacturer maintains an Internet site at www.rfmd.com, where you can find more information about this interesting oscillator IC.
Continue[...]

0-44dB RF Attenuator

Anyone who has to reduce the amplitudes of RF signals in a controlled manner needs an attenuator. Linearly adjustable attenuation networks using special PIN diodes are available for this, but they require quite intricate control circuitry. A simpler solution is to use an integrated attenuator that can be switched in steps. The RF 2420 is an IC built using gallium-arsenide (GaAs) technology, which works in the frequency range between 1 MHz and 950 MHz. It can thus be used as an attenuator for cable television signals, for example. The attenuation can be set between 0 and 44 dB in 2-dB steps. An insertion loss of 4 dB must also be taken into account. This base attenuation can be measured in the 0-dB setting, and it forms the reference point for switchable attenuation networks that provide 2, 4, 8, 10 and 20 dB of attenuation.

0-44dB RF Attenuator circuit diagramThese are all controlled by a set of 5 TTL inputs. The control signals must have Low levels below 0.3 V and High levels of at least +2.5 V. The RF 2420 works with a supply voltage between +3 V and +6 V, with a typical current consumption of 4 mA. A power-down mode, in which the current consumption drops to 0.8 mA, can be activated by removing power from the bussed VDD- pins. The sample circuit diagram for the RF 2420 shows that the only external components that are needed are decoupling capacitors. The coupling capacitors at the input and output determine the lower operating frequency limit. The table lists possible capacitor values. The input and output are matched to 50-ohm operation, but they can also be used with 75-ohm cables with a small increase in reflections. The RF 2420 is available in a 16-pin SOP-16 SMD package. Its data sheet can be found at ww.rfmd.com.
Continue[...]

Thursday, July 22, 2010

Diode Radio For Low Impedance Headphones

If you ever look at construction notes for building old detector type radios the type of headphones specified always have an impedance of 2 × 2000Ω. Nowadays the most commonly available headphones have an impedance of 2 × 32 Ω, this relatively low value makes them unsuitable for such a design. However, with a bit of crafty transformation these headphones can be used in just such a design. To adapt them, you will need a transformer taken from a mains adapter unit, the type that has a switchable output voltage (3/4.5/6/9/12 V) without the rectifying diodes and capacitor. Using the different taps of this type of transformer it is possible to optimize the impedance match.

Diode Radio Circuit Diagram For Low Impedance HeadphonesFor the diode radio (any germanium diode is suitable in this design) the key to success is correct impedance matching so that none of the received signal energy is lost. The antenna coil on the 10 mm diameter by 100 mm long ferrite rod is made up of 60 turns with a tap point at every 10 turns; this is suitable for medium wave reception. If a long external aerial is used it should be connected to a lower tap point to reduce its damping effect on the circuit. You can experiment with all the available tapping points to find the best reception. With such a simple radio design, the external aerial will have a big influence on its performance.

Tip:
If your house has metal guttering and rain water pipes, it will be possible to use these as an aerial, as long as they are not directly connected to earth. Those who live in the vicinity of a broadcast transmitter may be able to connect a loudspeaker directly to the output or if the volume is too low, why not try connecting the active speaker system from your PC?
Continue[...]

Compact Switching Step-Down Converter By MAX639

Switch-mode power supplies are used in electronic circuits to increase (step up) or reduce (step down) voltage levels in the most efficient manner possible. Compared to linear voltage regulators, switch-mode supplies convert relatively little energy into heat. Their efficiency is thus high. This is a major advantage with compact power supplies in particular, since it sometimes makes forced-air cooling unnecessary. Building a switch-mode supply is considerably easier if you use components that have been specially developed for this application. One example of such an integrated step-down converter is the Maxim MAX639.

Compact Switching Step-Down Converter Circuit Diagram By MAX639This is designed for a fixed output voltage of +5V, with an input voltage ranging between +5.5 and +11.5V. Although this IC is primarily designed for a fixed output voltage, the output voltage can be tailored using a simple feedback network. With the given component values, resistors R3 and R4 determine the output voltage, with R3 = R4 [(Vout / 1.28) – 1] The value of R4 may lie between 10kΩ and 10MΩ, but a value of 100 kΩ is a good choice for most applications. The maximum output current is 100mA. If desired, a different type of Schottky diode with similar specifications can be used in place of D1 (a 1N5817). Inductor L1 must be suitable for a maximum current of 500mA.
Continue[...]

Frequency Doubler

If you are working at frequencies of the order of 850MHz to 4GHz and find that a frequency multiplier is required, the HMC 187, HMC 188 and HMC 189 (see table) frequency doubler may be just the solution you are looking for. The isolation performance of these devices ensures that the input frequency (fin) and its harmonics 3fin and 4fin are attenuated by 35dB relative to the wanted output frequency 2fin. This excellent isolation specification reduces the need for additional output filtering and is also an advantage where several doublers are connected in series to produce four or eight times the input frequency.

Frequency Doubler Circuit DiagramThe tiny outline of the HMC18x- series device occupies a board area of 3mm by 4.8mm and measures just 1.07 mm high. Internally the device contains balanced to unbalanced transformers (baluns) to match the doubler circuit with the output and input. The doubler circuit itself is passive and comprises a full wave Schottky diode bridge rectifier. The monolithic baluns which are integrated on-chip give the device a relatively high low-frequency roll-off at 850MHz.

Table of Frequency Doubler Circuit DiagramLower frequencies can also be multiplied but the conversion loss factor (given as typically 15 dB) will increase. The input and output are matched for 50 Ohm operation and the input signal level should be of the order of +15dBm which will give a output level of approximately 0dBm. The main characteristics of the three versions of this device are summarized in the table above.
Continue[...]

Infra-red Light Barrier Using 555

This is a short-range light barrier for use as an intruder alarm in doorposts, etc. The 555 in the transmitter (Figure 1) oscillates at about 4.5 kHz, supplying pulses with a duty cycle of about 13% to keep power consumption within reason. Just about any infra-red LED (also called IRED) may be used. Suggested, commonly available types are the LD271 and SFH485. The exact pulse frequency is adjusted with preset P1. The LEDs are pulsed at a peak current of about 100 mA, determined by the 47 Ω series resistor. In the receiver (Figure 2), the maximum sensitivity of photo-diode D2 should occur at the wavelength of the IR LEDs used in the transmitter. You should be okay if you use an SFH205F, BPW34 or BP104. Note that the photo-diode is connected reverse-biased! So, if you measure about 0.45 V across this device, it is almost certainly fitted the wrong way around.

transmitter Infra-red Light Barrier Circuit DiagramThe received pulses are first amplified by T1 and T2. Next comes a PLL (phase lock loop) built with the reverenced NE567 (or LM567). The PLL chip pulls its output, pin 8, Low when it is locked onto the 4.5 kHz ‘tone’ received from the transmitter. When the (normally invisible) light beam is interrupted (for example, by someone walking into the room), the received signal disappears and IC1 will pull its output pin High. This enables oscillator IC2 in the receiver, and an audible alarm is produced. The two-transistor amplifier in the receiver is purposely over-driven to some extent to ensure that the duty cycle of the output pulses is roughly 50%.

Receiver Infra-red Light Barrier Circuit DiagramIf the transmitter is too far away from the receiver, over-driving will no longer be guaranteed, hence IC1 will not be enabled by an alarm condition. If you want to get the most out of the circuit in respect of distance covered, start by modifying the value of R2 until the amplifier output signal again has a duty cycle of about 50%. The circuit is simple to adjust. Switch on the receiver, the buzzer should sound. Then switch on the transmitter. Point the transmitter LEDs to the receiver input. Use a relatively small distance, say, 30 cm. Adjust P1 on the transmitter until the buzzer is silenced. Switch the receiver off and on again a few times to make sure it locks onto the transmitter carrier under all circumstances. If necessary, re-adjust P1, slowly increasing the distance between the transmitter and the receiver.
Continue[...]

DC/DC Converter From +1.5V To +34V

An interesting DC/DC converter IC is available from Linear Technology. The LT1615 step-up switching voltage regulator can generate an output voltage of up to +34V from a +1.2 to +15V supply, using only a few external components. The tiny 5-pin SOT23 package makes for very compact construction. This IC can for example be used to generate the high voltage needed for an LCD screen, the tuning voltage for a varicap diode and so on. The internal circuit diagram of the LT1615 is shown in Figure 1. It contains a monostable with a pulse time of 400 ns, which determines the off time of the transistor switch.

If the voltage sampled at the feedback input drops below the reference threshold level of 1.23 V, the transistor switches on and the current in the coil starts to increase. This builds up energy in the magnetic field of the coil. When the current through the coil reaches 350 mA, the monostable is triggered and switches the transistor off for the following 400 ns. Since the energy stored in the coil must go somewhere, current continues to flow through the coil, but it decreases linearly. This current charges the output capacitor via the Schottky diode (SS24, 40V/2A). As long as the voltage at FB remains higher than 1.23V, nothing else happens.

DC/DC Converter From +1.5V To +34VAs soon as it drops below this level, however, the whole cycle is repeated. The hysteresis at the FB input is 8mV. The output voltage can be calculated using the formula Vout = 1.23V (R1+R2) / R2 The value of R1 can be selected in the megohm range, since the current into the FB input is only a few tens of nano-amperes. When the supply voltage is switched on, or if the output is short-circuited, the IC enters the power-up mode. As long as the voltage at FB is less than 0.6V, the LT1615 output current is limited to 250mA instead of 350mA, and the monostable time is increased to 1.5µs.

These measures reduce the power dissipation in the coil and diode while the output voltage is rising. In order to minimize the noise voltages produced when the coil is switched, the IC must be properly decoupled by capacitors at the input and output. The series resistance of these capacitors should be as low as possible, so that they can short noise voltages to earth. They should be located as close to the IC as possible, and connected directly to the earth plane. The area of the track at the switch output (SW) should be as small as possible. Connecting a 4.7-µF capacitor across the upper feedback capacitor helps to reduce the level of the output ripple voltage.

DC/DC Converter From +1.5V To +34VThe selection of the coil inductance is described in detail in the LT1615 data sheet at www.linear-tech.com. Normally, a 4.7µH filter choke is satisfactory for output voltages less than 7V. For higher voltages, a 10-µH choke should be used. In the data sheet, the Coilcraft DO1608-472 (4.7 µF) and DO1608-100 (10 µF) are recommended. The Schottky diode must naturally have a reverse blocking voltage that is significantly greater than the value of the output voltage. The types MBR0530 and SS24 are recommended. The shutdown input (/SHDN) can be used to disable the step-up regulator by applying a voltage that is less than +0.25V.

If the voltage at this pin is +0.9 V or higher, the LT1615 is active. You must bear in mind that even when the IC is disabled, the input voltage still can reach the output via the coil and the diode, reduced only by the forward voltage drop of the diode. The second circuit diagram for the LT1615 (Figure 2) shows how you can make a symmetric power supply using this switching regulator. Here the switch output of the IC is tapped off and rectified using a symmetrical rectifier. The voltage divider at the positive output of the rectifier determines the output voltage.
Continue[...]

Dual Polarity 5 Volt Converter Using LM2685

A symmetrical ±5V power supply is often needed for small, battery-operated operational amplifier projects and analogue circuits. An IC that can easily be used for this purpose is the National Semiconductor LM2685. It contains a switched-capacitor voltage doubler followed by a 5-V regulator. A voltage inverter integrated into the same IC, which also uses the switched-capacitor technique, runs from this output voltage. The external circuitry is limited to two pump capacitors and three electrolytic storage capacitors.

The IC can work with an input voltage between +2.85V and +6.5V, which makes it well suited for battery-operated equipment. The input voltage is first applied to a voltage doubler operating at 130kHz. The external capacitor for this is connected to pins 13 and 14. The output voltage of this doubler is filtered by capacitor C3, which is connected to pin 12. If the input voltage lies between +5.4 and +6.5V, the voltage doubler switches off and passes the input voltage directly through to the following +5V low-dropout regulator, which can deliver up to 50mA. C4 is used as the output filter capacitor.

±5-V Voltage Converter Circuit DiagramAll that is necessary to generate the –5-V output voltage is to invert the +5-V voltage. This is done by a clocked power-MOS circuit that first charges capacitor C2, which is connected between pins 8 and 9, and then reverses its polarity. This chopped voltage must be filtered by C5 at the output. The unregulated –5V output can supply up to 15mA. The LM 2865 voltage converter IC also has a chip-enable input (CE) and two control inputs, SDP (shut down positive) and SDN (shut down negative). If CE is set Low, the entire IC is switched off (shut down), and its current consumption drops to typically 6µA.

The CE input can thus be used to switch the connected circuit on or off, without having to disconnect the battery. The SDP and SDN inputs can be used to switch the VPSW and VNSW outputs, respectively. These two pins are connected to the voltage outputs via two low-resistance CMOS switches. This allows the negative output to be separately switched off, whereby the voltage inverter is also switched off. Switching off with SDP not only opens the output switch but also stops the oscillator.

There is thus no longer any input voltage for the –5V inverter, so the –5V output also drops out. The SDP and SDN inputs are set Low (<0.8v)>2.4V) for switching off the associated voltage(s). The positive output of the LM 2865 is short-circuit proof. However, a short circuit between the positive and negative outputs must always be avoided. The IC is protected against thermal destruction by an over-temperature monitor. It switches off automatically at a chip temperature of around 150C. The full type number of the IC is LM2685MTC. It comes in a TSSOP14 SMD package. National Semiconductor can be found on the Internet under www.national.com.
Continue[...]

9V DC Adapter With Battery Backup

With just a low cost DC adapter and the circuit described here it is possible to build a low cost stabilized, uninterruptable 9V supply. On the grounds of safety and economy, a simple unstabilized 12V D.C. adapter is used as the power source, a universal adapter with its output set to 12 V will do equally well. The output voltage of an adapter under low load conditions (up to approximately 1/3 of the rated output current) is over 15 V, even at the rated output current, there will be sufficient voltage to supply a 9 V voltage regulator. The rating of the DC adapter should be chosen according to the output current required at 9V. Common values are 300mA, 500mA and 1A.

The 9V voltage regulator used in this circuit has a built in thermal shutdown mechanism so that if too much current is drawn from the device, it simply turns off as it overheats and will not supply any current until the case temperature returns to normal. If the unit is intended to supply more than say 150-200mA then to prevent thermal shutdown it will be necessary to fit a heatsink to the voltage regulator. The rule of thumb used to calculate the size of heatsink is that you should be able to touch it during operation at maximum load, without burning you finger. When choosing the DC adapter, it is always better to select one with a higher current rating than is needed this will ensure that its output voltage is high enough to be able to also charge the 12V cells.

DC Adapter with Battery Backup Circuit DiagramAs long as mains voltage is on the DC adapter, the voltage across C1 will be higher than the voltage of the cells. Charging current will flow through R1 and D1 to the cells. Current also flows to the voltage regulator and out to the load connected at the output. Diode D2 in this situation will not conduct because the voltage at its cathode is greater than that at its anode When the mains voltage fails or is turned off, diode D2 conducts and current will now flow from the Nickel Cadmium cells to the voltage regulator, thereby automatically keeping the output voltage at 9V. The value of resistor R1 is chosen so that a charging current to the cells is not greater than 1/10th of the cells capacity (if the cells are rated at 1100mAh, the charging current must not exceed 110mA).

From the point of view of cell longevity it is better to reduce this charging current even further (1/20 or 1/50 C). When calculating this resistor, the value of the no-load voltage should be used. This will give the highest charging current. To calculate the charging current using R1 with a value of 180 Ω. The cells measure 13.8 V when fully charged and the no-load output voltage of the DC adapter is 17V. Charging current is given by the formula: (17V – 13.8V – 0.7V) / 180 = 13.9mA. Substituting the actual measured values in this formula will enable you to calculate the value of R1 to give the correct charging current for the cells.
Continue[...]