I am working on a volt meter / pressure gauge that uses two 3 digit 7-segment displays (one for voltage one for pressure).
When I tested this on the breadboard, everything was working well.
However, I needed to miniaturize the project and have had printed circuit boards made using surface mount components in place of standard size bread board compatible components. The micro controller I used for the surface mount is an ATMEGA 328-AU.
With the surface mount PCB, I have a few problems I did not encounter on the bread board version.
Both of the 7 segment displays flicker really fast. I don't understand why the breadboard version showed a steady display but the surface mount version blinks rapidly using the same code.
The voltage regulator in my circuit gets really warm on the surface mount version (using the exact same regulator for both surface mount and bread board). Why would changing the other circuit components to surface mount versions cause additional heat buildup in the voltage regulator? I changed the current limiting resistors from 220 Ohms to 1 kOhm on the pcb and the voltage regulator produces much less heat now but of course the led's are dimmer.
The micro controller is not displaying the correct voltage on the pcb version. It is proportional to the actual voltage, but is displaying lower than actual. It displays approximately 12 volts when the actual voltage is 14.
I am a new user, so the forum wont let me upload attachments so I can't attach my code or circuit schematic yet. I'm not sure how long before I get that permission.
I have been reading and learning from this forum for some time, but this is my first post.
Quite possible your power distribution on the PCB is inadequate. Images (JPG, PDF) of both sides would be required.
Here's how you solve that. You're at Trust Level 0. Please visit this page: New User Limits
As explained there, you need to do something to achieve Trust Level 1.
That sounds like a decoupling problem in that the regulator is oscillating. Did you follow the manufacturer's recommendations or just hook it up. The flashing of the display is probably the regulator cutting in and out. The 1K would damping that but it will also take the input voltage to the regulator below its dropout voltage. Posting the schematic would be a big help.
Unfortunately, but as I suspected, you've left the power traces the same width as the signal traces. This is very likely the source of your flickering. You also don't appear to have added any decoupling capacitors near your IC. Both of these will contribute to your noise issues.
Decoupling can be added, as a hack, by carefully soldering the capacitor leads as close as you can get to the power pins, though it's suboptimal. The issue of your power traces can be mitigated with a tinned copper wire running above the power and ground traces, though if they're on the top, or swapping sides, it's a pitn, and it's suboptimal at best.
Let me see if I understand what you all are telling me.
The trace size on the power traces may be able to handle the current flowing through them, but they have too much resistance inductance (parasitic features) to provide clean power to the micro controller and / or regulator. Because the input power to the MC and or regulator is dirty, its causing the MC to power cycle and makes the displays flash? I can see how this might also cause inaccurate readings.
It does make sense that the PCB would experience these problems and the bread board would not.
I do have capacitors in the circuit. Are they not sized properly for my application or do I have them in the wrong location?
Thanks for the schematic, it probably saved about 40 questions. I know you worked hard on this but I see several problems that need fixing. Q2 through Q7 will draw excessive current from the microprocessor. You must put resistors in the base leads. This in itself will explain the warm regulator. All of the current is passing through the MMBT4401, I am surprised it has not shorted. If so this will also cause the regulator to get warmer. What are the values of the capacitors? The ZM4742 Zener is not rated for the amount of current you are passing, I expect it is shorted. You are light on both bulk and bypass capacitors. What does D1 do? This should get you started. I expect it worked on your bread board because of the resistance in the plug board etc. Good Luck and let us know how you do.
The diode is a 1Watt diode. If the MC is maxed out 5 Volts and 200 mA it can only get to 1 watt, but it shouldn't be anywhere near that with PWM. Maybe its borderline with the other resistors in the circuit, but the diodes haven't been a problem. They are still working.... Perhaps a long term durability problem.
It has been a while since I originally worked on the circuit. I think we decided to add D1 to prevent anything from leaving the circuit and messing with any other electronics connected to the power source (its powered up in a vehicle).
When you say I am light on capacitors, are suggesting I need more of them at other parts in the circuit? Can you elaborate?
Thanks for your input, I am researching the resistor on the base of the transistor and seeing lots of circuit schematics done as you suggested. Unfortunately, I can't think of a quick way to test if that is the only issue other than removing the transistors and trying to solder in components on surface mount pads. I may end up trying this at some point, but it will test my soldering abilities.
Yes, you need to beef up the amount of copper for the power connections, all the way to the processor. No question. One or more 0.1 uF capacitors should be connected from power to ground as close to the processor as possible.
IIRC, the design info for 78xx regulators is very clear, mount 0.1 uF caps as close to the regulator as possible, one input-to-ground, and one output-to-ground.
Not sure if your circuit needs it, strictly speaking, but a bulk storage cap, between 100 and 500 uF, should reside near the regulator input, to provide peaking current when the load shifts. Again, that may not be necessary depending on your 12V source, but I'd be putting one in.
The schematic is a little misleading on the regulator part number. The Fritzing software just has the part in the database. Actual regulator is LM317, but this detail is probably not important, and I do have capacitors to ground on the input and output of the regulator.
I'm going to get to soldering wire to the power connections. Ill let you know what happens when I am through.
I did not realize this was for a car, the design becomes more difficult. You could replace your whole voltage regulator circuit with an automotive qualified regulator and a few caps from such sources as infineon and ST. They will tolerate reverse battery and stay off during the fault, reverse battery, double battery etc. They will have the AEC qualifications, note: there are several sections in the AEC standards. Something I do is base the bulk capacitors at their lowest rating, pick the capacitor a then insert two in the circuit. This is much more cost effective then recalling something for a bad part. If one fails the customer and the circuit never know.
Many times as a patch I have been able to scratch away the silk screen and cut the foil. Then solder an 0603.
You probably have better soldering skills than I do, but I will find a way to get resistors added for testing purposes.
I may re-create the circuit on a breadboard again and see if I can reproduce the problem there.
I soldered wires in place to duplicate the traces on the current path from from the source through the regulator and to the MC. It did not change the performance of the PCB in any way, but that doesn't mean it doesn't need bigger traces in the future. It just means its not causing the flashing issues on the displays.
Something I learned in the late 70's is wire wrap is the best for jumpering PCBs and you can hold it in place with hot melt glue. Most use 30AWG. Your soldering is getting there, just leave the iron in contact another second or two.
I managed to get 2.2kOhm resistors soldered in between each transistor and the MC.
I used the schematic shown here as a reference.
I have seen schematics with 1kOhm to 4.4kOhm resistors. I used a 2.2KOhm mostly because that is what I had available in that range.
I first scratched away the trace until the I measured infinite resistance between each end of the traces. Then I soldered the resistors in. I did a final check with the ohm meter to make sure everything was connected correctly.
When I tested the display, it still blinked rapidly. However, this time the MC got very hot and burned up quickly within 10 to 20 seconds.
Turns out the burned up micro controller was my fault. While soldering in the resistors one of the wires I added on the power circuit broke and I soldered it back in the wrong place without checking the schematic. This meant I fed the microcontroller 8 volts instead of 5. Oops!
So I started over on a new PCB and added all the 2.2kOhm resistors to the transistor base.
This time I did not grenade the micro controller, but also saw no improvement in the displays.