Thứ Ba, 11 tháng 12, 2018

PCB Layout Tips and Tricks: Minimizing Decoupling Inductance

his article examines some subtle details associated with the high-frequency performance of decoupling capacitors.

Related Information


In the previous article we explored the question of whether to connect a decoupling capacitor to an IC power pin through a trace or through a pair of vias. We saw that the pair-of-vias technique is superior because it reduces inductance, and inductance is the primary obstacle that we have to overcome when we’re trying to ensure that decoupling capacitors will be effective at frequencies of 50–100 MHz and even up into the hundreds of megahertz.

Vias and Planes

In this article we’re going to explore the issue of decoupling-cap inductance as it relates to via and plane-layer configurations. Before we jump into that discussion, though, we need to be clear on the following point: as we go deeper into the realm of high-speed decoupling, we focus more and more on plane connections, until eventually it seems that traces are largely ignored. The following considerations will help to contextualize this phenomenon:

High Inductance

As we saw in the previous article, traces simply have too much inductance compared to connections that rely on vias in conjunction with plane layers.

Plane Capacitance

The way in which the decoupling capacitance interacts with the planes seems to become a dominant factor as operational frequency increases. The science starts to get complicated here, and I have limited ability to understand the details and even less ability to explain them. One interesting and straightforward statement that I found in this article indicates that in some cases the decoupling capacitor itself is so hindered by inductance that it cannot really supply current to the IC. Rather, the plane capacitance supplies the transient decoupling current, and the capacitor’s job is to recharge the planes.

Crowded Layouts

High-speed digital systems often involve complex, space-constrained layouts that dedicate most of the PCB real estate to components. There is little room for traces, and consequently board designers gladly use vias whenever possible.

Distributed Capacitance vs. Discrete Capacitance

If the plane capacitance is the true source of decoupling charge in some high-speed digital designs, does the capacitor really need to be “as close to the pin as possible”? Does the location even matter? It may seem shocking to question the validity of one of the essential principles of proper decoupling, but this is exactly what Hubing et al. did in this research paper. In the words of the authors of this other paper, Hubing et al. claimed that under certain conditions the location of the capacitor is “unimportant,” though they may have extended their conclusions “beyond the region of validity of the study.” In any event, this is another example of the importance of the interaction between the capacitor and the plane layers, which function as “distributed capacitance” present everywhere on the board.

Minimizing Inductance

The overall inductance of a decoupling capacitor depends on the area of the current loop formed by the capacitor, the vias, and the planes.


As you can see, the loop area is influenced by both the separation between the two vias and the distance between the capacitor and the plane layers. Thus, distance to the plane and via separation are critical factors that need to be addressed if the goal is to improve decoupling performance.

Distance to the Plane

If you’re designing a typical four-layer board, there’s not much you can do to reduce the distance to the plane—the decoupling cap will always be close to one plane layer and far from the other.


If the board has more than four layers, though, you have some flexibility in optimizing the location of your decoupling caps relative to the power and ground planes. Also, this is a good time to point out that you’ll lose a lot of distributed capacitance if you don’t place the power and ground planes on adjacent layers. It seems to me that a high-speed digital design would benefit greatly from the following configuration:
  1. Place as many high-speed ICs as possible on one of the two component layers (let’s say it’s the top).
  2. Arrange the power and ground planes so that they are adjacent and closer to the top layer.
  3. Place all the decoupling caps on the top layer so that they have short connections to the planes.

Via Separation

The first way to reduce via separation is to use smaller decoupling caps. On my boards I use 0603 packages because I often assemble them by hand; if the board will be assembled by machines, 0402 is a better choice.
Minimizing inductance is now a matter of choosing the optimal via configuration:

Adapted from the diagram on page 29 of this document.

Notice here that we’re primarily concerned about the distance between the two vias. Thus, the third diagram is labeled “good” and the second is labeled “decent” despite the fact that the “decent” configuration uses shorter traces to connect the capacitor terminals to the vias.

Conclusion

I hope that this article has given you some insight into the complicated world of high-speed digital PCB design. I think it’s pretty clear that minimizing loop area is the key to reducing inductance and hence improving high-frequency performance, but I’m not sure what to think about the possibility (in certain situations) of randomly distributing decoupling capacitors throughout the board. If you have any thoughts on this subject, feel free to share them in a comment.




Stereo VU Meter


Does your amplifier have a level indicator?
Have you always envied the fancy amps with LED level bar graphs?
Would you like to build your own STEREO LEVEL INDICATOR?
he complete kit can be purchased from Talking Electronics.
To place an order, click:  Stereo VU Meter kit 

This is it. It's a STEREO LED LEVEL METER. It's the cheapest and best bar graph display available and best of all, it uses readily available components.
You only need a handful of LEDs, 22 transistors, some resistors, diodes and a set of electros - it doesn't require any chips.

   You may be wondering why we didn't choose the LM 3914 or LM 3915 bar-graph LED driver chips. The reason is simple. We learnt our lesson from our Mini Frequency Counter Book. In it we used a relatively novel chip, the CD 4026. And after releasing 10,000 copies of the book, with printed circuit boards attached, the chip became almost unobtainable in Australia. This proved to us that many of the readers were making the Mini frequency Project.
Now, a chip such as the LM 3914 is scarce at the best of times. Can you imagine what would happen if we used it in a project? Ninety per cent of the readers would miss out. This means we must confine our projects to readily available components and avoid rare items, no matter how inviting they look.
We compared a LED level meter using the chip with our unit and the difference was negligible. Both had the same quick response-time and about the same readout values on the line of LED’s for the same input signal. But the big difference is in the cost of construction. By using transistors, you will save $4 over the cost of two chips. If you don't mind the additional time required to fit the extra components, the $4 is a valuable saving and by using discrete components, you can build it from parts you may already have in stock.
 
The Stereo VU Meter PC board with the components fitted. Only the battery and speaker are external, connected to flying leads.

A close up of the completed unit. The overlay makes construction easy. Make sure the left-hand row of resistors starts with 47k at the bottom and 4k7 at the top. I saw one unit with the whole row reversed. It made very little difference to the performance of the unit, but it was not quite as sensitive as the correct version.

The BAR GRAPH section of the Stereo VU Meter circuit. The "front end" section is below:

The BOOTSTRAP circuit connects to the LED bar graph via A B C. Only one BOOTSTRAP circuit is provided on the board. It is capable of driving both bar graphs in a mono mode. For a stereo readout, you will need to build another bootstrap circuit. This will give a STEREO SOUND LEVEL INDICATOR.

The Circuit
The circuit basically consists of two identical channels feeding two rows of LED’s. A high­gain bootstrap front-end is also provided to allow the board to be coupled to an inbuilt speaker/microphone which will give a mono readout of the sounds being picked up.
A mini trim pot is provided to set the sensitivity. This makes the project completely portable and it can be used as a SOUND LEVEL meter in a disco or other noisy situation. To give a read-out in dB it would require calibration. The simplest method of calibration would be to compare it with a commercial unit and give each LED a value in dB.
If you build another bootstrap circuit, a portable stereo sound detector can be made. It will be able to compare sound level in different parts of a room or compare the relative outputs from 2 speakers.
As designed, each stereo section can be connected across the terminals of a speaker and the unit mounted in some prominent place for an eye-catching display.
Construction 
Before you begin, lay the components on the work-bench in a position relative to that on the PC board. Some of the parts have the same value, such as the 330R resistors. These should be positioned on the board with their tolerance bands all around the same way. Separate the two BC557's from the other two transistors and be sure you can identify the 22u electrolytic from the 4.7u.
The board looks deceptively simple because most of the components are placed in rows. It will take at least one and half hours to construct the project and the most important point throughout construction is to create a neat appearance. This means aligning each component with the next and keeping the heights all the same. Otherwise the neat appearance will be destroyed.


The Stereo VU Meter printed circuit board

The suggested method of construction is to start with the resistors and diodes. These should be inserted alternately as required by the board so that you have maximum room when placing them in position.
Slow and sure wins the race. It is best to insert the parts one at a time and push them firmly onto the board. Nothing looks worse than a mass of floating components, some high, some bent this way, others bent the other way. Once you push them onto the board, bend their wires outwards so that the component is held in position. Turn the board over and solder the two connections quickly. Check that the component has not shifted, then snip the two wires. Continue down each row, adding one item at a time.
If you find you are closing over some of the holes with solder when you are soldering, I suggest you only tack-solder the leads and wait for the other component to be inserted, before finishing the joint. Tack-soldering is very fast and requires almost no solder. This prevents the solder flowing over other lands and filling up the holes.
You may have noticed that the two channels are a mirror-image of one-another. This means the cathodes of the LED’s face outwards and before inserting each LED you should look into their opaque body to make sure they are being inserted correctly. In our prototype, the two top LEDs of each channel are a different colour, mainly to add interest to the display. You may choose to add another colour for the bottom two or three LEDs and produce an even more exotic display.
The driver transistor for each channel and the bootstrap circuit fits onto the right-hand end of the board. All the component values are identified on the overlay and the two BC557's are shown as 'filled in', whereas the BC547's are open 'D's'.
There are no jumpers on the board. However we have made provision for connecting the bootstrap circuit to either one or both channels via one or two links. These links are taken from the 'pre-amp OUT' point to either the left hand channel or the right hand channel.
The Stereo VU Meter Kit

PARTS LIST:
18 - 330R resistors
2 - 470R
1 - 1k
1 - 2k2
5 - 4k7
5 - 10k
2 - 22k
2 - 33k
4 - 39k
4 - 47k 
4 - 4.7mfd 16v PC electrolytic
2 - 22mfd 16v PC
20 - BC 547 transistors
2 - BC 557 transistors 
18 - 1N 914 or 1N 4148 diodes
14 - 5mm red LEDs
4 - 5mm green LEDs
2 - 100k mini trim pots
1 - 9v battery snap
1 - speaker 8 ohm
1 - VU METER PC board
 
HOW THE CIRCUIT WORKS 
The VU METER consists of 3 sections:
1. BOOTSTRAP CIRCUIT
2. BUFFER TRANSISTOR
3. STAIRCASE VOLTAGE DETECTOR 
The BOOT-STRAP circuit is very successful at allowing a dynamic microphone in the form of a 2¼in speaker to detect small sounds and have them amplified sufficiently to be fed into a normal amplifier.
The BOOTSTRAP is rather unique in its operation. It uses 2 directly coupled NPN transistors wired in a similar mode to cascade to give an enormous gain. In our prototype we measured this to be about 1,000 times!
In the quiescent condition, the transistors in the bootstrap circuit are slightly turned on. This means they will accept a few millivolts from the speaker and turn the circuit on harder or turn it off. During quiet conditions 2 millivolts is developed across the speaker due its resistance of 8 ohms.
Take the case where the speaker produces 2 millivolts which is in phase with the quiescent voltage. This will turn the lower transistor slightly off. The collector voltage will rise and in doing so, take the base of the top transistor with it. The top transistor is partially an emitter-follower. Under normal circumstances, the collector voltage of the top transistor would rise about .2v. This will make the emitter voltage of the top transistor rise .2v (which is normal for an emitter follower).
Now the top 22u electrolytic will transfer this .2v to the join of the 10k and 2k2 resistors and cause the top transistor and turn it ON further. This action feeds around the transistor until the transistor can rise no more.
The top 22u was previously charged and some of its voltage is lost through the 2k2 resistor. This reduces the base voltage and the transistor begins its downward excursion.
I have taken the extreme case. If the first transistor does not turn on to quite the same extent, the emitter-follower will rise until the loss from the top electrolytic prevents the transistor from rising any more, and it begins to fall. The lower 22u prevents this swing from appearing on the base of the lower transistor. It acts as a damper.
The output from the BOOTSTRAP can be as high as 2v p-p and this is ample to drive the buffer stage. In fact the signal needs to be attenuated by a pot so that the range can be set according to the amplitude of the input signal.
The 470R resistor in series with the pot is only needed when the VU Meter is connected directly across speaker lines.
The BC557 is not an emitter follower. Don't get confused. It is wired as a normal common emitter stage for a PNP transistor. Thus it will provide a high gain in this situation. The AC voltage appearing at the wiper of the 100k trim pot will pass through the 4u7 electrolytic and become rectified by the 1N4148 diode. With no signal present, the voltage on the base will be 9v. As the input signal increases, the voltage on the base will drop to 8.35v and this is sufficient to turn the transistor ON fully.
The voltage on the collector will range between 0v and 8.5v. This voltage is stored in the lower 4u7 and applied to the chain of 8 diodes. The 4u7 dictates the decay rate and gives the LEVEL METER its rapid attack, slow decay characteristic and allows even brief peaks to be detected. To reduce the decay time you can increase the electrolytic to 22u and this will keep the LED’s illuminated for a longer period, similar to the commercial units.
Between each diode is a high value resistor. As the voltage rises to about .6v, the first transistor turns ON. At this stage the voltage on the cathode of the first diode is 0v since the .6v has been dropped across it.
The voltage needs to rise to about 1.2v before the second transistor turns ON. This continues down the line with each transistor turning ON at its allotted voltage level.
The set of 330R resistors limit the current through the LEDs to a safe value and the base resistors serve as a voltage dropper so that the base will not be forced to go higher than .6v. The number of transistors which can be operated in this Staircase arrangement is limited by the battery voltage available since each transistor and diode will take .6v from the voltage.

TESTING 
To test the stereo VU meter, connect the two links as shown on the board and connect the dynamic microphone (speaker). Solder a battery snap to the board and connect a 9v battery. This project is now a self-contained level meter and will give a dual readout of the sound detected by the speaker. We are using a small speaker as a microphone as we have had a great deal of success with its sensitivity. No calibration is required. You only need to position the pick-up (spkr) near a radio or stereo that is playing at normal listening level and adjust the sensitivity controls. These are the two 100k mini trim pots in the buffer stage. First you must set each one so that the top led is just illuminated when a loud passage is being received. Then you need to trim the two displays so they produce equal readouts for the same information.  

FAULT FINDING

Since each channel is identical, you will be able to reference off one channel to repair the other.
The ‘chain of transistors’ are all DC coupled, and you can test their operation by using a 10k resistor connected to a set of jumper leads. Connect one jumper to the positive of a battery and touch the other onto the cathode of the lowest diode in the staircase. You cannot do any damage to any component when probing around either channel and I suggest you take this opportunity of seeing the effect of a turn-on voltage when applied to a set of transistors.
When the 10k resistor is touching the cathodes, almost all the LEDs should light up. By moving the resistor up the chain, the top LED will light. This will show the channel to be functioning and you should test the other channel for the same effect. If one LED fails to light, you may have a base-emitter short in one of the transistors or the LED itself may be faulty. If any LEDs above number 6 fail to light, one of the diodes may be open or you may have a dry joint.
If you have trouble getting one channel to function, you can use the components from the other channel as test pieces. This is the great advantage of having two identical channels. But by using parts from the good channel, you could finish up with two bung channels. That's the risk you take.
The buffer transistor can now be tested by connecting the 10k to earth and touching the other end on to the base of the BC557 transistor. This will illuminate one complete row of LEDs. The remainder of the circuit is AC coupled via the 4u7 electrolytic.
Only the DC conditions of the bootstrap section can be tested with simple equipment. Use a multimeter to detect voltages similar to those given here:


BOOTSTRAP VOLTAGES

Both transistors will be turned on very slightly and because it is a very high gain circuit, you cannot remove one transistor and hope to get a smaller amplification. 
It will completely fail to work.
Here is an application by Gerry Holt:

He attends live music events in pubs and clubs. These "open mic" events enable anyone with an act or instrument to put on a 15 minute performance. To curb the enthusiasm of some 'artists' and reduce the pressure on the organisers, I saw the need for a visible indication of the noise level in the room.
I built the Stereo VU Meter and mounted the LEDs separately and fitted a tube over all the components. I painted the tube to make the whole project look impressive. It worked so well, those running the event were ecstatic. 
The tube is closed at the top and bottom with jam jar lids, the base lid having sufficient clearance to house the battery (on a clip) and a small power switch. The mesh allows the sound to reach the microphone (the speaker acts as a dynamic microphone).



PIC-2 USB BURNER

PIC-2 USB BURNER
PICkit-2 set-up software (4MB)(22-2-2014)

Kits are available

See more projects using micros:
Pic A PIC Project

Notepad2.zip     Notepad2.exe  
Library of Sub-routines "Cut and Paste
"Library of routines:   A-E   E-P    P-Z
 


This project is a clone of PICkit-2, (the most successful and cheapest PIC programmer on the market). But PICkit-2 is being phased out and will not be available in the near future. The replacement is more expensive and has less features!
PICkit-2 is fully assembled and does not satisfy those who want to construct their own programmer.
PIC-2 USB Burner is a kit and contains a pre-programmed PIC18F2550 chip with 3200.hex 
All the other components are standard items, except the 1mH choke. This is supplied as a 10mH choke and you need to remove exactly 340 turns of the winding to create a 1mH inductor. 
Our kit has two additional features, It comes with a 6 pin to 5 pin adapter to connect PIC-2 USB Burner to the project you are designing and an 8 pin to 18 pin adapter, so you can burn 18 pin chips. You can also get a "burner board" containing an 8 pin socket (for the chip you will be programming). See below for all these extras.

To program a PIC chip you need the following:

1.   PIC-2 USB Burner and CD titled: "PIC-2 USB Burner software"
2.   6 pin to 5 pin adapter
3.  "Burner Board" with 8 pin socket and
4.   A project from the list below:


Here are  the costs:
PIC-2 USB Burner: $25.00
6 pin to 5 pin adapter:  $2.50
8 pin to 18 pin adapter  $1.50
"Burner Board" with 8 pin socket: $2.50

CD (700MB) containing software to write your program (NotePad-2), software to convert your program to .hex file (MPASM) and software (titled: PICkit-2 Programmer v2.60) to take the .hex file and burn the PIC chip. This program will appear on your desktop. Plus 180MB of data files, .pdf's, programs and projects as well as a PIC course and electronics course, The CD is titled: 
"PIC-2 USB Burner software" and costs $10.00
extra PIC12F629 chips  $5.00 each
Postage within Australia: $6.50  Overseas: $7.50

Projects using PIC12F629:
Alarm Space Gun uses PIC12F629
Happy Birthday - uses a piezo and PIC12F629  to produce Happy Birthday tune
It's A Small World - uses a piezo and PIC12F629  to produce It's A Small World tune 
Lego Chaser - Seven routines on two sets of 10 LEDs - uses a PIC12F629
Lift Counter Uses a PIC12F629 with LED display and up/down buttons.
Music Box  Uses PIC12F629 and plays 11 melodies
Sky Writer  Uses a PIC12F629 to put messages "in the air."
Whistle Uses a PIC12F629 to detect a whistle - similar to Whistle Key Finder. 
2 Digit Counter using a PIC12F629
2 Digit Up/Down Counter  5 different designs. Uses PIC12F629 or PIC16F628 chips.
40 LED Badge  - uses a PIC12F629 to show effects on 40 LEDs 
 
THE CIRCUITThe circuit consists of a high-voltage section plus components to connect the PIC18F2550 chip to the 8-pin programming socket on the "Burner Board."
The PIC18F2550 is a specially-designed chip that interfaces to the USB port and handles data from your computer to the chip your are burning, as well as data from the chip on the "Burner Board" to the computer.  This saves the need for any other chips in the burner project. The 20MHz crystal must be 20MHz as the chip must handshake, at the correct speed, with the program on the computer.
The only other requirement is to generate approx 13.5v to open up a chip, so it can be read and programmed. Some chips require slightly less than 13v but some need nearly 14v.
This is done via the fourth transistor in the circuit. It receives a waveform from the PIC18F2550 to turn it ON for a short time then it is turned OFF. This action delivers a brief pulse of current through the 1mH inductor and when the transistor is turned off, the inductor produces a high voltage. This voltage is stored in the 22u electrolytic and appears across a voltage divider made up of a 6k8 and 3k3. The chip detects the voltage at the join of the two resistors to maintain a constant 13.5v 
This voltage is passed to the chip being programmed by the first three transistors.
The remaining resistors are safety resistors to prevent the PIC18F2550 being damaged if a short is present on any of the lines on the "Burner Board."
THE PIC18F2550 CHIPThe heart of the circuit is a PIC chip. This chip is pre-programmed in the kit because you need a programmer to program it! It's a "Catch-22" situation or a "Chicken-and-the-egg.  You need a programmer to program the chip so you can program chips.
This means you cannot build this project yourself from components you have "on-hand" as you will also need a programmer to load the operating program into the PIC chip. The kit is not expensive and comes with a neat PC board. So it's best to get a kit. You can also purchase the 6 pin to 5 pin adapter and a board to hold an 8 pin IC socket as well as an 8 pin to 18 pin adapter.
This gives you all the tools needed to program 8 pin and 18 pin PIC chips.
If you have one of our other programmers, you can burn a PIC18F2550 and build this project.
To program a PIC18F2550 you will need 3200.hex   Datasheet for PIC18F2550
If your USB lead does not have the same colours as shown on the circuit above, use the USB plug shown above to work out the colours. Use a multimeter set to low ohms range and find the +5v wire, the Data- wire, the Data+ wire and the Ground wire.  Any copper wire wrapped around the leads is a shield and is not connected to any of our circuitry. 



Programmer connected to project via Adapter

THE INDICATOR LEDsThe project has 3 LEDs. The green and red LEDs connect to the incoming Data+ and Data- lines of the USB port and show when signals are present on these lines. These LEDs show activity and do not have any special importance. They show when PICkit 2 Programmer software is installed and when your laptop recognises the PIC-2 USB Burner.
The yellow LED has three features.
It is the high-speed rectifying diode in the voltage-pump section and allows the positive portions of the high-voltage pulses from the 1mH inductor to pass to the "accumulator section" where a 22u stores the high voltage. Two resistors in a voltage-divider network tap this voltage and send it to a pin on the chip, where the chip controls the pulses sent to the oscillator transistor. When this voltage is 3.6v the voltage at the top of the divider is about 13v.
In idle mode, the yellow LED detects 5v and it illuminates at a very low level.
When the programmer is activated, it "opens-up" the chip you are programming by supplying 13v to the programming pin and reads the type-number of the chip.
The yellow LED will flash very brightly when doing this.
The yellow LED also indicates at high brightness when the programmer is burning a chip. 

1. ASSEMBLING THE KIT 
The kit is complete with all components, a pre-programmed PIC18F2550 chip and USB lead.
All the components fit on the PC board and the IC fits into the 28 pin IC socket.
You may have to file the edges of the 6 pin socket to make it look neat.
The 1mH choke is made from the 10mH choke provided. Carefully unwind the winding and leave the last few turns on the core. Now start winding 160 turns then twist the wire twice around the unused pin. With a hot soldering iron, heat up the wire and pin with a small amount of solder and this will remove the insulation and connect the wire.
The USB lead is cut to 30cm so the burner can be used close to your laptop without cluttering the desk with a long lead.
The 4 coloured wires inside the cable must be fitted into the correct holes.
Fit the chip after all the components are soldered in place and the project is ready for testing.
You will need the 6 pin to 5 pin connector.
Make sure you look at the photo before soldering the pins as they are soldered to the track-side of the board.
If you solder the pins to the wrong side of the board, the connector will operate in reverse and damage the burner.
Finally you need a board and socket to hold the chip you are going to "Burn." (program). The following photo shows this board with 5 pins and wire to the 8-pin socket.
You are now ready to "burn" a chip.
You need to select a kit from the list below. All kits come with a pre-programmed chip, but with the "Burner" you are able to modify the program and create different or additional effects.  

2. SETTING-UP THE 
PIC-2 USB BURNER
The CD that comes with PIC-2 USB Burner contains all the software needed to set up the burner and program a wide variety of chips.
All the latest chips are recognised by the burner and will program automatically. 


3. IF IT DOESN'T WORK
Both prototypes worked immediately so the circuit is very reliable. Any faults will be due to wrong components or a short-circuit between tracks.
The program in the PIC18F2550 (PK2V023200.hex) must match the correct version of PIC 2 Programmer software (v2.60).
Note: The PIC-2 USB Burner leaves 5v on the chip after programming and the Burner should be removed so the chip (in the project you are burning) will reset and execute the program when the power to the project is turned ON. This only applies when you are burning a chip "ICSP." 

To test the PIC-2 USB Burner, connect the 6 pin to 5 pin connector, build the Burner Board with 8 pin socket
 and make sure all the wiring has been added to the board to connect the programming pins to the pins of the chip. Fit a chip that has already been programmed (from one of the kits) and install PICit-2 v2.60 software on your computer and provide a link to your desktop. Plug the programmer into one of the USB ports on your laptop and it will produce a message to show the programmer is recognised when it is plugged in the first time. (It may not be identified on some laptops - this does not matter).
Click on PICkit 2 Programmer icon and the programming screen will appear. At the same time, the software will send a signal to the Burner to "open up" the chip and read its part number. Activity on the USB port can be observed via the Data+ and Data- LEDs flashing slightly and via the yellow LED flashing very brightly, indicating 13v Vpp is being produced by the "high voltage" circuit.
If the Data+ and Data- LEDs do not illuminate, the PICkit 2 program on the laptop has not identified the correct USB port.
This could be due to the PIC-2 USB Burner not sending a recognition signal to the laptop when first connected.
Disconnect the Burner and re-connect to the computer. Watch the data+ and - LEDs. They will flash to indicate activity.
If not, the PIC18F2550 chip on the Burner is not being accessed and sending the initial "handshaking" signal.
Check the yellow LED as it will be dimly lit to indicate 5v.
Remove the 6 pin to 5 pin connector and re-connect it to the Burner socket or the pins on the  "Burner Board." The yellow LED will flash brightly to indicate it is trying to open up the chip on the "Burner Board."
If this flash does not occur, the high voltage section is not working.
Make sure the 1mH inductor has continuity as the winding you created may not be connected to one of the pins.
Make sure the yellow LED is around the correct way and make sure it still works and has not been damaged during soldering.
Place a LED with 470R on pin 2 to make sure the chip is sending a signal to the oscillator (buffer) transistor that produces the high voltage.

4. PROGRAMMING (BURNING) AN 8 PIN PIC CHIP
The photo shows an 8 pin chip being programmed via the 6pin to 5 pin connector:
5. PROGRAMMING (BURNING) AN 18 PIN PIC CHIP
The burner will also burn 18 pin chips and 28 pin PIC18F2550 chips by using the following two adapters. These are easy to build using sockets and small pieces of matrix board with tinned copper wires between the sockets. The 8 pin fits the socket on the boar and this joins an 18 pin socket. The 18 pin socket joins a 20 pin socket and the 28 pin PIC18F2550 fits into this socket with pin 1 at the end and it overhangs the socket. Some of the pins in the socket have been removed and this makes it easy to insert and remove the chip.




PROGRAMMING PROBLEMS ("burning " or "write" problems)
If you have problems burning a chip, here are some helpful notes.
1. Create a new folder and place the following two files in it:
PICkit2v2.61.exe  or PICkit2v2.61.zip     and  PK2DeviceFile.dat
If you cannot download an .exe file, download the .zip and extract it into the folder to produce the .exe file.
2. Create a short-cut to the .exe file and place it on your desktop.
3. Connect the USB programmer to the USB port on your laptop and add the 
6 pin to 5 pin connector board. Make sure the board holding the chip does not have any components connected to the programming pins. The programmer is very sensitive to any loads on any of the pins and will not detect the chip.
4. 
Click on the PICkit-2 desktop icon and the programming window will appear and detect the chip you will be programming.
If it does not detect the chip, go to the folder and remove PICKit2.ini   This file is produced at the end of each time you use the programmer and holds data that is not wanted.
5. If a window appear with Low Vpp, simply click on it to remove it and click to get the main programming window.  

6. Go to Tools and click on "Force PICkit 2" so the 5 volt window appears on the screen. 

QUESTIONS ANSWERED
PICkit 2  can be used as a debugger. We are not introducing the debugger section as this involves additional software and an additional "learning curve."ICD2 and PICkit2 have almost the same capability. PICkit-2 is cheaper.
PICkit 2 software is designed for MS Windows and a program called “pk2cmd.exe” is used for Linux based computers. All our discussion is based on Microsoft Windows computers.
PK2DeviceFile.dat must be in the same folder as PICkit2V2.exe
PK-2 Lite (PICkit2 Lite SE ) is PICkit-2 Student Edition and has fewer components than PICkit 2 from Microchip. It is exactly the same as PIC-2 USB Burner. The Student Edition uses through-hole components whereas the original design used surface-mount components. PIC-ICD2 is an In Circuit Debugger and Programmer. It is an old design and has many problems. PICit-2 supersedes this device.
MicroChip forums: http://www.microchip.com/forums/tt.aspx?forumid=15 

MPASM is the program that converts the program you write in TextPad to .hex for PIC-2 USB Burner to download into the PIC chip. ICSP  - ICircuit Serial Programming. If a PIC chip is soldered to the PC board and three programming lines are available (as well as 5v and 0v), the chip can be re-programmed without removing it. There can be a problem with this. If a load is connected to any of the programming pins, the chip may not see full-amplitude signals and will fail to program.
We suggest removing the chip and burning it on the Burner Board, then putting it into the project you are working-on.
 

GOING FURTHER
This project provides you with a programmer for the whole range of PIC chips, but we have concentrated on two of the smallest chips in the range, the PIC12F629 and PIC16F628 - to keep things simple. No matter if the project is large or small, it has to be designed and the best board to use is a PROTOTYPE BOARD such as the one shown in photo above. All the components and wiring can be seen at the same time. This save turning the board over and making mistakes.
Alternatively you can build the project on MATRIX BOARD as shown in the following photo:
This Matrix Board has been designed by Talking Electronics and contains circular lands for each hole so the parts can be placed in any hole and do not have to correspond to grids or conductors under the board.
The lands under the board can be connected with fine tinned copper wire and they will eventually become the tracks of the PC board. 

The most absurd design ever invented is STRIP BOARD. It consists of conductors running the length of the board and you have to either cut the conductor or place your components to correspond with the conductors. When a cut is made, the hole cannot be used!


PIC-2 USB BURNER 
Parts List
 
Cost: au
$25.00 plus postage 
Kits are available
1  -  22R  resistor   1/4watt
3  -  100R
3  -  470R 
1  -  2k2
1  -  3k3
1  -  6k8
5  -  10k 
1  -  22k 
1  -  100k

2  -  27p ceramics
1  -  100n monoblock

1  -  2u2 16v electrolytic
1  -  22u 16v electrolytic1  -  47u 16v electrolytic1  -  3mm red LED
1  -  3mm green LED
1  -  3mm orange LED

3  -  BC 547 transistors 
1  -  BC 557 transistor

1  -  1mH choke
1  -  20MHz crystal
1  -  28 pin IC socket
1  -  USB plug on 30cm lead


6cm tinned copper wire
30cm  very fine solder
1  -  PIC18F2550 chip (with 3200.hex routine)
1  -  USB Burner PC board

AUTOMATIC AA NICAD CHARGER

 
Charges AA cells on a 5-hour or 14-hour rate
 with automatic turn off

Rechargeable batteries are very popular for use in all sorts of devices, especially those requiring a high current.
The most common type of cell is the AA or penlight and although thousands have been sold, there are very few low-cost chargers to keep them in tip-top condition.
Most of them simply charge them at the slow rate and never turn off - you have to remember. Charging a cell for longer than necessary reduces its life so it’s important to cease the charging operation when the time is up.
To solve this problem we have designed an automatic charger to charge any number of AA cells, from 1 to 8 and turn off when the cells are charged.


Two photos of the Automatic AA Nicad Charger

Automatic AA Nicad Battery Charger Circuit

Rechargeable batteries are very popular for use in all sorts of devices, especially those requiring a high current.
The most common type of cell is the AA or penlight and although thousands have been sold, there are very few low-cost chargers to keep them in tip-top condition.
Most of them simply charge them at the slow rate and never turn off - you have to remember. Charging a cell for longer than necessary reduces its life so it’s important to cease the charging operation when the time is up.
To solve this problem we have designed an automatic charger to charge any number of AA cells, from 1 to 8 and turn off the power when the cells are charged.

When designing this project we assumed two things:
1. The user will only be charging AA cells, and
2. The cells will be almost totally dis­charged.

This will normally be the case as most nicads are used until the equipment starts to falter, such as a toy car going slow or a radio starting to distort. This is when the cells must be removed and recharged as it is an indication that one of the cells has reached its point of complete discharge and any further use will allow current to flow through the cell in the reverse direction and damage it.
All our discussion in this article will concentrate on the AA cell as the charger is specifically designed for this type of cell.
However C cells can be charged, simply by charging them at the 5 hour rate for two complete cycles. Just disconnect and re-connect when the first 5-hour timing is up.

 Automatically charges AA cells at 5Hr rate or 14Hr rate.
 Charges 600mAHr AA cells and 1.2AHr AA cells.
This keeps the circuit simple and prevents possible overcharging of any of the cells, if you are alternately charging AA and C cells.
There are currently two types of AA nicad cells on the market.

Also Required:
8.5v AC 400mA plug pack or
15v AC 1amp transformer  
Use 9v5 tap for up to
8 x AA cells or 15v tap for 12v Gel cell battery.
The ampere-hour capacity of the old-style cell is 450mAHr. Some of them are 500mAHr, 550mAHr or 600mAHr.
Newer AA cells are 1.1AHr or 1.2AHr. Fortunately, most cells have the amp hour rating on them and this will help you set the charge-rate and/or time.
The first thing you cannot do is combine old-style cells with the new style. If you do, you will either over-charge the old-style ones or only partially charge the new ones. Stick to one type of cell at a time and select the time and charge-rate you require.
If you intend to charge the 1.2Ahr cells, we have added two components on the circuit diagram to change the charging current to 90mA for 14 hours to cater for this type of cell. This consists of a 12R resistor and slide switch that can be mounted on the top of the box and labelled 600mAHr when in one position and 1.2AHr in the other position. We have not provided a quick charge facility for the 1.2AHr cells.
Instead of adding this switch, you can simply give them three cycles at the 5 hour-rate or two cycles at the 14 hour rate.
We have lumped all the old-style cells in to one category as the difference between a 450mAHr cell and 600mAHr will be very small as far as the charging is concerned and in use you will hardly detect the difference as you will rarely be able to use all the energy in a cell.
The full capacity of a 450mAHr or 600mAHr cell is only obtained when the cell is discharged under fairly low laboratory conditions such as 10 - 15mA. Most toys and radios take 2 - 30 times more than this and the amp-hour capacity you get from the cell falls considerably as the current-demand increases.
Every cell and every condition is different but you can easily reduce the Amp-hour capacity to 200 - 300mAHr if you use it in something that takes 200 - 300mA.
That's why you only get one or two hour's life (or even less) out of a set of cells when you are using them in a toy such as a remote control car.
However the 1.1 and 1.2AHr cells will provide twice the energy of the old-style cells, under the same conditions.
No matter which type of cell you choose, the cost of powering high-performance toys will drop considerably by using rechargeable types.
And with this charger you can keep them fully charged without over or under charging.
To get the best performance out of rechargeable cells you must remember four things:

1. Cells must not be left in an uncharged state,
2. They must not be over­charged,
3. They must not be totally discharged (cell voltage must remain above 1v) and
4. They must not be discharged at more than 500mA (for more than a few seconds).

Any abuse of these rules will reduce the capacity of the cell. Nicads (and all their closely allied variations) also have another unusual characteristic that reduces the capacity. It's called "memory."
If you recharge a cell that is only say 25% discharged, the cell will think its new capacity is only 25% of the true value. Thus you will only be able to get 25% of its energy before the cell starts to falter.
This means it is very important to almost fully discharge a cell before starting the charging process.
Some of the new cells do not have this "memory" problem but their cost at the moment is more than twice the older style cells - so, it's the old saying: you get what you pay for. This project will enable you to care for AA cells and even rejuvenate some of them that have generated a memory. If a cell with a memory is discharged fully and charged completely, over a number of cycles, its poor performance can be improved and some can be restored to near full capacity. There is another device, called a nicad Zapper, that will rejuvenate some of the cells that have developed an internal fault, such as a short, that prevents it from receiving a charge. Now back to our circuit.

HOW THE CIRCUIT WORKS
The heart of the circuit is a 4541 timing chip. It has a built-in oscillator that requires only two external components for timing. A chain of sixteen binary dividers inside the chip is capable of producing a division of 65,536. With this we can produce very long time delays by making the internal clock of the chip a low-frequency oscillator and using it to clock the divider chain.
The other feature of this project is the constant-current charging circuit that allows you to fit any number of cells, up to 8, in the charging holder. Some chargers only accept 1,2 or 4 cells at a time while ours will accept any number providing the unused parts of the holder are connected with a jumper lead to make a complete charging path.
The BC 547 and BC 557 in the Automatic charger detect when a battery has been fitted to the circuit and turn on the 4541 timing chip. The green "Charge" LED comes on to show the battery is charging.
The orange LED shows you have selected the 14 hour rate and the red LED indicates you have selected the 5 hour rate.

CHARGING
During charging, no gases are generated. However during the latter part of the charge-cycle, during over­charge and during heavy discharge, hydrogen and oxygen gases are generated as well as electrolyte fumes. These gases can normally react with each other and not increase the pressure inside the cell however if they are produced at a fast rate, this equilibrium condition cannot be maintained and the pressure inside the cell builds up.
A pressure release valve is built into the cell but any gases that escape will include some of the electrolyte in the fumes and the cell will eventually dry out. For this reason it is important to limit the charging cycle.

ADAPTING THE CHARGER
The charger can be adapted to charge AA, C, or D cells or any combination of these by modifying the circuit slightly or by adding extra constant-current sections as shown in the circuit diagram below.

It will even charge 1.2AHr or 1.9AHr Gel cells of the 12v type as used in alarm systems, simply by making sure the rail voltage is above 18v, (but not more than 22v) to take into account the 3v minimum voltage drop across the BD 679 transistor.
If you want to charge only C or D cells, the circuit can be modified by changing the current-determining resistors R1 and R2 as follows:

 
C cell
D cell
14Hr rate
(R1)
4R7
2R2
5Hr rate
 (R2)
2R7
1R0
The current-determining resistors for “C” and "D" cells
The wattage of the resistors in the above table will have to be taken into account due to the high current that will be flowing through them The following table shows you how to "make-up" the resistors:
4R7 = two 10R resistors in parallel
2R2 = 4 x 10R resistors in parallel
2R7 = Four 10R resistors in  parallel
1R = two 2R2 10Rresistors  in parallel
If you want to charge AA, C and D cells, you can add extra circuitry consisting of the constant-current section shown above to cater for the C and D cells.
To charge these cells, the BD 679 transistor will have to be heat-sinked with a larger heat-sink than is provided in the kit and the plug pack will have to be upgraded.
For a C cell, the 14 hour rate is 150mA and the 5 hour rate is 300mA. For a D cell, the 14 hour rate is 350mA and 700mA for the 5 hour rate.
Most plug packs have very poor regulation and the output voltage will drop considerably when full current is delivered. You will need a 500mA plug pack to deliver 350mA and a 1amp plug pack to deliver 700mA. Otherwise a 300mA or 400mA plug pack will be sufficient for the AA version.
Alternatively you can charge C and D cells with the original circuit by giving these cells two or three charge-cycles as show in the following table:

CHARGING:
5 Hour rate:
C cells
2 time-cycles
D cells
5 time-cycles
When choosing a plug pack, you must be careful not to supply the circuit with more than 15v AC as this becomes 22v DC when rectified and will create extra heat loss in the transistor.
The PCB, showing the overlay and the track work

Automatic AA Nicad Charger kit, showing all the components

PARTS LIST
1 - 8R2
1 - 18R
1 - 470R
1 - 1k
1 - 4k7
5 - 10k
1 - 1M2
2 - 3M3
3 - 100n monoblock capacitors
1 - 100u 25v PC mount electrolytic
1 - 1N 4148 diode
6 - 1N 4004 power diodes
1 - 12v Zener diode 400mW
1 - BC 547 transistor
1 - BC 557 transistor
1 - BD 679 transistor
1 - 4541 IC
1 - 14 pin IC socket
1 - 3mm orange LED
1 - 3mm red LED
1 - 5mm green LED
1 - battery snap
1 - DPDT slide-switch
1 - 10cm tinned copper wire
1 - Auto Nicad Charger PC board
Extras:
1 - plug pack
1 - 2 cell or 4 cell AA battery holder
1 - 12R (for charging 1.2AHr cells)
1 - slide switch
1 - 3cm x 5cm heat-sink
1 - 12mm bolt with nut for heat-sink

CONSTRUCTION
 
All the components fit on the PC board shown on the previous page with the small metal heat-sink fitted to the transistor.
Take care with the orientation of the diodes, LEDs transistors and electrolytic. Don't get the BC 547 and BC 557 mixed up and note; that the BD 679 has the metal face down and the writing up.
Fit all the rest of the components, remembering to fit the IC socket so that the cut-out at one end indicates pin 1. Fit the chip and the board is complete.
Solder the lead from the plug pack to the AC input terminals and connect a battery snap to the output terminals to take a 4-cell battery holder.
All you need to do is plug in the plug pack. The 5Hr or 14Hr LED will come on and the charge LED will come on when the cells are fitted to the holder.
Keep watching the charge LED. It will go out after the 5 or 14 hour period and your cells are ready for use.

TESTING
Remove one cell from the battery holder and measure the current being delivered to the other three cells. It should be about 45mA for the 14 hour rate or 90mA for the 5Hr rate.
If you have the switch and 12R fitted for the high performance 1.2AHr AA cells, the 14Hr current will be about 90mA.
You can charge up to 8 cells in series at a time however you must remember that to do this you need 17v - 18v on the supply rail. The same applies to 12v gel cells.
It is best to keep everything simple by charging one set of cells at a time and using two or more time-cycles to charge the larger cells. This way you won't over­tax our little charger.

Arc Welder Simulator

INTRODUCTION
Detailed workshops and maintenance yards can be the highlight of many model railways or dioramas. Unfortunately they usually suffer from one common problem. They are static. At the scale involved, it is not an easy problem to overcome either. Moving parts at this size present quite a challenge.
However making things move is not the only way to animate a scene. One classic sight in any industrial workshop or construction site is a man hunched over something he is welding, a fairly slow process that doesn't require much movement. None the less, anyone glancing in that direction is sure something is going on because of the flashes of light caused by the process.
Simulating such flickering is not difficult in electronics, and with the advances in LED technology, can be quite convincing.
HOW IT WORKS
The arc welder simulator is made up from several functional blocks: five oscillators, two gates and the output driver.
IC1A, IC1B and IC1C are all wired as square wave oscillators, each operating at a different frequency under 100 Hz. The three outputs of these oscillators are gated together by a NOR gate consisting of three 1N4148 diodes, a 100k resistor and IC1D. Only when the output of all three oscillators are LOW, is a HIGH present at the output from IC1D. This output is a pulse of semi-random duration and occurring at semi-random intervals. This is used to generate the occasional bright flashes associated with arc welding.
IC1E is also wired as an oscillator operating at a similar frequency to the previous three, though unlike them, its pulse length is adjustable from nearly 0 percent to 50 percent. This is used to generate the consistent flicker. The adjustment is provided to give some control over brightness, which is particularly important when using a lamp as the output. If a fixed mark space ratio was used, some lamp filaments would not achieve enough heat to glow during the short pulse.
The outputs of the NOR gate (IC1D) and the output of the flicker oscillator (IC1E) are gated together by an OR gate consisting of two diodes. This combines the flicker and flash, feeding them to the base of the Darlington driver transistor via a 1k5 resistor.
An onboard LED is provided to allow monitoring of the output.
The circuit as described above would result in a never-ending welding effect, and that would be as bad as not having any animation at all, so the remaining Schmitt inverter IC1F was added to the circuit to switch the effect on and off periodically. IC1F is wired as a square wave oscillator with a cycle of several seconds. Its output is fed to the same OR gate as the flash oscillators, and also to the flicker oscillator via 1N4148 diodes. When the output of IC1F is HIGH, the output of IC1D and IC1E are both forced LOW, preventing any output, thus darkening any LED or lamp connected to the output. When the output of IC1F is LOW the output of both the flicker and flash sections are enabled, giving the welding effect.
While this cycle is predictable because of its square wave nature, the period is long enough that is isn't that noticeable.
One other note about this oscillator: unlike the other oscillators in this circuit, the timing capacitor is between the input of the Schmitt inverter and the positive rail. This has been done so that when the unit is first powered, the discharged 4u7 capacitor will hold the output of IC1F LOW, allowing the effect to start immediately.
As the arc welder simulator is designed to be used with the uncontrolled DC output of model railway transformers, a 1N4001 diode has been used to provide polarity protection, and a simple zener/transistor regulator has been included to limit the voltage to the chip to around 12 volts. Without this, the voltage of the model railway transformers could push the power to the chip to over 15 volts, destroying it. The uncontrolled DC output is usually rectified, but unsmoothed, and may be as high as 15 to 18 volts, despite being labelled as 12v on the transformer.


CONSTRUCTION 


Arc Welder 
PARTS LIST
2  -  470R
1  -  1k
1  -  1k5
2  -  47k
1  -  68k
3  -  100k
1  -  2M2
1  -  20k trim pot

4  -  2u2  25vw
1  -  4u7  25vw
1  -  22u  25vw
1  -  100u  25vw
1  -  470u  25vw

1  -  1N4001 or similar
8  -  1N4148 signal diodes
1  -  12v 400mW Zener>

1  -  BC547 transistors
1  -  BD679 power transistor
1  -  3mm red LED
1  -  CD40106 Hex Schmitt Trigger IC
1  -  14 pin IC socket
2  -  2 way terminal blocks
1 - Arc Welder PCB PC board
Kits can be obtained from Talking Electronics:
http://www.talkingelectronics.com

Extra parts required (not included in kit)LED version:
6000mcd High bright white LED
Lamp version:
12V to 18V 3 watt lamp
The arc welder simulator is built on a single sided PCB measuring about 5.5 cm by 4 cm. Before you start assembly, check the board for etching faults. Look for any shorts between tracks, or open circuits due to over etching. Take this opportunity to sand the edges of the board, removing any splinters or rough edges.
When you are happy with the printed circuit board, construction can proceed as normal, starting with the diodes and resistors first, followed by the IC socket, then moving onto the taller components.
Take particular care with the orientation of the polarized components, the diodes, LED, electrolytics and the transistor. The metal side of the transistor is indicated on the PCB by and extra line on that side of the component outline.
When inserting the IC in its socket, take care not to accidentally bend any of the pins under the chip. Also, make sure the notch on the chip is aligned with the notch marked on the PCB overlay.

USE
The four external connections to the circuit are all at one end of the board, via the terminal block. The two left most terminals, marked "-" and "+" on the overlay are connected to the power supply. This can be a regulated power supply providing 12V D.C., such as the Economy Power Supply presented in Electronics for Model Railways book 2, or the uncontrolled DC output of the model railway transformer. The kit for the Economy Power Supply is also available from Talking Electronics.
The right most connections on the board, marked "+L" and "OP", are the outputs for driving a LED or lamp respectively.
One of the relatively new high brightness 6000mcd white LEDs can be used. These put out a bright bluish-white light quite reminiscent of the output of an arc welder.
If you choose to use one of these LEDs, connect its anode (the long lead) to the terminal marked "+L" and its cathode (short lead) to the terminal marked "OP".
If you wish, a lamp may be connected here giving a reasonable effect. The lamp should be rated around 3 watts, giving enough brightness for the effect to work properly. The connections to the lamp are a little different, and there may be issues with its voltage. The lamp should be connected between the positive side of the power supply at the terminal marked "+", and the terminal marked "OP". Ideally a 12 volt lamp can be used, but depending on the actual output voltage of the uncontrolled DC output of the model railway transformer, you may find yourself needing to use a lamp that is rated as high as 18 volts. Be prepared to test the lamp beforebuilding it into your layout. If you notice and silvering occurring in the lamp after it has been running for a while, you will need to find a lamp with a higher voltage rating. An alternative would be to use several identical lower-voltage lamps in series. For example, three 6 volt lamps will give an overall rating of 18 volts.
By now you are probably wondering how a 5mm LED or 3 watt lamp are to be hidden on the layout, as neither is particularly small. The trick is to position them so that they throw light onto the scene around where the arc welding it taking place, possibly under, or in front of the welding scene. The source of the light (LED or lamp) should be hidden, for example in a crate that has one side open, facing away from the viewing angle. Clever use of reflective material can give the impression that an item is being welded. Alternately, you may chose to hide the job being welded with the body of the model welder, instead relying on the effect to show what is happening.
When mounting the arc welder PCB, if you use metal spacers, make sure they do not make contact with any of the PCB tracks, or short circuits may result.

ADJUSTMENT
There is only one adjustment on the circuit board, that for the flicker pulse width. Simply adjust it for the best effect. When driving a lamp from the arc welder simulator, a portion of this adjustment will have no visible effect as the pulse length is too short to heat the filament enough for it to glow.

Kits for this project are available from Talking Electronics
.

Article, art & circuit design by Ken Stone. 

Bài đăng mới nhất

ALEPH-M CLASS A ANFİ DEVRESİ N KANAL MOSFET

Aleph-M çıkış gücü yaplaşık olarak 35w Class A sınıfı anfi için oldukca iyi bir değer çıkış modfetleri n kanal 2 adet irfp240 kullanılmış be...

Bài đăng phổ biến