PCB design needs inputs! - Page 1
Forum section: electronics / projects

author: chiaTu
author_rank: Newbie
timestamp: April 10, 2010, 03:31:25 am
content: Hello all!I am working on this simple display PCB that controls local 15 LEDs on the back and 2 external graphical LCDs (128 x 64). Also, it has a UART that connects to another PCB that has Xbee on it.6 out of 10 PCBs that I assembled failed. The PCB fails after a period of time (1~2 days). I tested the PCBs by keeping them turned on with LED turning on and off (period of 2 seconds) and with LCDs printing a few different pages continuously. When the PCB failed, LEDs froze or not light up at all, and LCD froze too. The micro-controller's pins seemed broken but I still was able to program the micro-controller. After seeing a few PCBs failed, I built 4 PCBs with LEDs related components only and another 4 PCBs with LCD related components only, and I let these PCBs to run for 2 days. 3 of the 4 LED PCBs failed; the other 4 LCD PCBs worked fine. Thus, I think there is something wrong with LED circuits.For the next PCB revision, I am planning to make the following modification:- Change BJTs to MOSFET (I think it would be better using voltage driven switch rather than current driven switch)- Put fixed supply voltage for LEDs (currently using LM317 with a potentiometer to change the brightness)- Put heat sinks for voltage regulators (7805, LM317)- Surge protection components like TDK Varistors AVR-M Series- More decoupling capacitors- Separate 7805 regulator for LCDs- Thicker traces, thicker copper weight, and larger trace spacingI would like to get some inputs on the schematic and PCB layout (see attachments). My electronic design skill is self-taught, and there is no senior electronic designer that I can go to in this project, so I am pretty much alone doing the designs.Thanks!

author: Zad
author_rank: Super Contributor
timestamp: April 10, 2010, 09:07:40 pm
content: Do you have a meter or an oscilloscope to fault-find this? From what you say, I guess that simply resetting power to the processor doesn't help. Generally speaking (I realise its dangerous to make generalisations) once you have a PCB populated and working, then the PCB is fine, what are you seeing to make you think the PCB is becoming faulty? I have had plated-through holes fail as a PCB gets warmer, but they tend to be an intermittent fault.First of all, do a sanity check, are the regulators getting power and outputting the correct voltage?Putting a volt meter or scope on the base of the LED driver transistors, are they getting a signal?Are the LED anodes still getting a supply voltage from the LM317? My thought is that a non-heatsinked regulator could be getting hot and failing.I notice that the LM317 has no output capacitor, and the 5v reg only has a 0.1uF. Try putting a 1 to 10uF capacitor on the output of the regulators, just to help some of the bigger current spikes as you turn the LEDs on.I know this sounds strange, but does anything smell hot? Over the years, my nose detecting hot components has saved many a circuit from death.Mike

author: chiaTu
author_rank: Newbie
timestamp: April 10, 2010, 10:10:31 pm
content: Hello Zad,Those PCBs didn't fail in front of me. They all failed during the nights after I went home. My observations are: 1. uC pins no longer output logics, but still programmable. 2. because of 1., LEDs and LCDs do not work. 3. Occasionally, when I pressed my fingers on components and uC, LEDs would work....it seemed like there were bad connections, but I am pretty confident about my soldering skill, and I am using big IC packagesHere are answers to your questions:The regulators are working well. They output what they should output.The base of the LED driver transistors are not receiving any signals from uC for the failed PCBs.LEDs anode are getting supply voltage from LM317.BJTs and LM317 got pretty warm when I turned the voltage output of LM317 too high. I will try to find out more over heating components.

author: mkissin
author_rank: Regular Contributor
timestamp: April 11, 2010, 12:18:42 am
content: Here's a couple of things to check:Did you change the code in the micro between the two boards at all, or just the populated components? It sounds to me like there might be a code bug which is causing your micro to go bananas after a long run time. Perhaps try implementing the watchdog timer in the micro. That won't prevent the problem, but if it helps, then you'll know it's a code problem.Check how much current you're asking the micro to sink or source from each pin and the total from each port and the whole micro. There will be upper limits specified in the datasheet.I agree with Zad. If the PCB works at all then it and your soldering are probably OK. It could be a dodgy solder connection though, but I'd say it's more likely to be code-related.The finger-pressing thing is interesting, but could be any number of things. There's a possibility that your finger is adding just enough capacitance to part of the circuit that the micro resets or restarts oscillating or something similar, especially if you're touching around the crystal.

author: chiaTu
author_rank: Newbie
timestamp: April 11, 2010, 12:32:04 am
content: Mkissin,I used the same code for every micro-controller that I finished assembled, except when I test LED and LCD parts individually, I put in much simpler codes. For LED, simply just toggling output pins on and off with a delay of 1-5 seconds.Is it possible for the code to do permanent damages to micro-controllers? I tried reprogram, erase, and reset the micro-controllers for those failed ones, but none of them came back to function normally. I will try watchdog to see if that would revive the failed micro-controllers..I am asking the micro-controller to source 0.5mA to each base of the BJT, and the maximum is 40mA on the datasheet. As for LCDs, each pin is sourcing 7 mA from the micro-controller according to the LCD datasheet.

author: TechGuy
author_rank: Regular Contributor
timestamp: July 26, 2010, 11:12:47 pm
content: Some Recommendations1. Use a 74HCT245 buffer between your MCU and the BJTs. They will provide a buffer to isolate your MCU from any current drain. At worse your blow the inexpensive 245 and preserve your more expensive MCU. Or use a Digital LED controller that is designed to power LED from a MCU or digital logic interface. Seehttp://www.st.com/stonline/products/literature/ds/12569.pdffor 16 Channel LED controller.2. Replace the LM317 with a switching Buck regulator since it will operate much more efficiently. Its possible that the LM317 is overheating causing excessive current draw and dropping the source voltage too low, or its making your voltage source unstable causing it to produce too much noise. On one of your failed PCBs remove the LM317 that connnect to the LEDs (there is a good chance it has failed) and see if the MCU returns to proper operation. Be sure to check the MCU supply voltage too and make sure it at 5V. Use a scope to see how much noise there is at the MCU input pins. If its above 75 mV, try soldering on a 0.1uf ceramic cap.3. Add decoupling caps as close as you can to the MCU Voltage supply inputs to help filter out noise in the voltage supply. Most MCU are sensitive to supply noise. You can reduce the noise problem if you reduce the clock speed.

author: mukulkhairatkar
author_rank: Contributor
timestamp: July 28, 2010, 08:59:43 pm
content: Which Crystal oscillator are you using??I doubt with your configuration bits. There is a separate mode for two different frequencies....If you want to do a quick test do this ground your Crystal input pin (X1) momentarily and release. You will see your circuit worked for one instance. if you repeat this, every time it should work.MAK

author: chiaTu
author_rank: Newbie
timestamp: July 28, 2010, 09:05:43 pm
content: Thank you all for the inputs.I am surprised this old thread is brought up.It turned out that the PCB, because it is hand soldered, had many hairline bridges. So to solve it, the final PCBs will be assembled by a PCB manufacturer.Though, I am very interested what kind of equipment do you use at home for surface mount soldering. I was using hot air gun + electric grill + soldering iron + solder paste for those bad PCBs.

author: joelby
author_rank: Frequent Contributor
timestamp: July 29, 2010, 12:26:40 pm
content: Quote from: shafri on July 29, 2010, 11:55:34 amWasn't that flux rather than solder paste?

author: chiaTu
author_rank: Newbie
timestamp: July 29, 2010, 01:07:18 pm
content: Quote from: shafri on July 29, 2010, 11:55:34 amI forgot which solder paste I used, but it is from Kester. The solder paste is in a syringe; the nozzle part is quite big, so a lot of time I found myself accidentally applied too much solders. I didn't know it would cause shorts until I look at the PCBs under microscope and found these tiny BB-like solder everywhere on the boards.

author: DJPhil
author_rank: Frequent Contributor
timestamp: July 29, 2010, 01:48:56 pm
content: Quote from: chiaTu on July 29, 2010, 01:07:18 pmI know what you mean, I get those little gobs of solder from hand soldering too. You can clear the loose ones out by scrubbing with a toothbrush, and a quick tap with a soldering iron will pick up the ones that are stuck to traces as well as reflow bridged pins (usually). I get a lot of those little solder balls when using a heat gun to desolder, probably because the one I have is way too large for the job and the airflow is very high. I can see where oven reflow would cause a lot of spray from flux boiling in the paste, it would probably spatter like a frying pan. Board houses run a finished board through a sort of solvent dishwasher after soldering to remove all the gunk and the solder mask does a good job of keeping spatter from adhering anywhere, so for them it's much easier to avoid the problem.You might try using a toothpick to move the paste between the syringe and the pads. It'll give you a little more control and makes it easy to add or remove small amounts that are already on a pad.Hope that helps.

author: TechGuy
author_rank: Regular Contributor
timestamp: July 30, 2010, 12:09:46 am
content: Quote from: chiaTu on July 28, 2010, 09:05:43 pmA hot plate using the reflow method works pretty well:1. Get a Solder mask - Laser cut stencil (http://www.ohararp.com/Stencils.html)2. Get Solder Paste (http://www.zeph.com/zephpaste.htm- Need to keep refrigerated)3. Clamp or tape solder mask to PCB board and apply Solder paste to all SMT contacts4. Remove solder mask and place PCB on a metal pan or metal plate (you can buy Alum plate fromwww.onlinemetals.com)Place SMT devices on PCB board. I use tweezers and a desk magnifier for small SMT devices (ie 805 402, etc)5. Move PCB with metal pan\plate on to hot plate. Turn on hot plate until solder melts. turn off hot plate and move metal pan\plate off the hot plate (place on pot holder so it does damage your counter\desk).Alternatively you can apply solder (using solder wire and solder iron) to each SMT pad and then add the SMT parts and use the hot plate to reflow the solder. This will avoid the costs for using solder paste. But this method is only effective with large SMT parts such as 1206, 1812,2010, and SOIC). Smaller parts (ie 402, TQFP) are harder to place because the solder iron leaves an uneven surface that prevents the parts from stating in the correct place. Perhaps if after you apply the solder, you heat up the PCB using a hot plate the solder will even out over all of the pads before applying the SMT parts to the board (I have not tried this).Tip: for small SMT devices after applying solder paste, check for solder bridges between pads on small devices. Sometimes the solder paste moves when you remove the solder mask stencil or paste gets underneath. You can remove the excess with a dental pick (sold by most online SMT soldering suppliers) or an exacto knife.Tip: I store my Solder mask stencils in ziplock baggies after use. I lay down paper over the work area to trap any excess solder paste. Remember that the solder paste contains lead or other heavy metals. Some of the lead freel solder may contain other poisonous heavy metals. Always assume all solder contains toxins. Its very easy to contaminate yourself or others with solder paste since it sticks to everything. Its very easy to get it on the floor that might be picked up by small children or pets when they touch the floor with their hands or paws and lick their paws\hands or touch food.Note: that some some lead free solders are suspectable to tin-whiskers that form over time and can create bridges beween connections:http://en.wikipedia.org/wiki/Solder""Tin whiskers" were a problem with early electronic solders, and lead was initially added to the alloy in part to eliminate them."Tip: If you use non-lead solder and you expect your PCB to be operable over 5 years, I recommend applying a conformal coat over the PCB after you finished the board. The conformal coat (usually spray Poly Urethane) will help prevent the formation of tin whiskers from forming. But conformal coats make it difficult to rework the board since all of the connections become coated with plastic.

author: chiaTu
author_rank: Newbie
timestamp: July 30, 2010, 02:44:57 am
content: Thank you for such detailed guide!I will try that for next designs. Sure can save a lot of money without using PCB manufacturer's assembly service.

author: DJPhil
author_rank: Frequent Contributor
timestamp: July 30, 2010, 05:05:36 am
content: Quote from: TechGuy on July 30, 2010, 12:09:46 amVery true. I tried salvaging parts from a busted lamp ballast and wound up with a headache after removing just one 5 pin header. I was using a big desoldering pump so I wasn't seeing the smoke or char from the coating as I was heating up the joints. As soon as I noticed, I got out a UV light and the entire board was aglow. I should have known, as it's common to use conformal coating where humidity is high. Often manufacturers will use a coating that has a UV dye in it for quality control. If you need to rework this type, you can scrape off a solder joint somewhat before applying heat to save brain cells. There are solvents designed to remove conformal coating as well, but they're pretty nasty.I'd read somewhere where someone was using a spray coating made to tint model car windshields light blue. Apparently it draws away from the iron a bit, and doesn't give you (too much) brain damage when it melts, so this person just sprayed down their boards right after etching. I guess it worked, but I can't find the reference at the moment.