EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: SirAlucard on May 11, 2020, 10:11:08 pm

Title: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 11, 2020, 10:11:08 pm
So I've made my first PCB, granted I probably should have gotten a couple of eyes on this first to make sure I didn't miss anything, however I've already made the PCB and have assembled it. However after the fact I would like to get some of your input on it. See if there is anything I missed or should have done.

This was to mirror my breadboard that worked fine. Using an arduino a couple of power regulators, and it drives a motor(H1, pin 5+6), and two solenoids(H1, Pin 3+4 w/+5v) with a sensor(H1, Pin2 + 5v). 

Hopefully the schematic makes more sense than me trying to explain it.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: NivagSwerdna on May 11, 2020, 10:46:52 pm
I would have brought TX, RX, GND  and RESET out to a separate header and added the pull-up and the diode you find on UNO reset... that way you could program it via a serial bootloader (and make it pretend to be an UNO)
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: WattsThat on May 12, 2020, 01:26:05 am
Something is weird with the crystal circuit, pins 7 & 8 shorted and grounded? Don’t know, it may not have shown up in the net as a ground. The 1M resistor is wrong as well, that’s something that appeared on the Mega schematic and has no basis in fact from any Atmel datasheet. Depending upon the crystal, you typically need 15-20 pf loading caps from each crystal pin to ground to get it to resonate.

AVCC should be fed through a 100uh choke and have a 100nf bypass cap on it, especially since you’re suppling from a switch mode regulator. You may find the analog to be very noisy due to the combination of the lack of filtering and the presence of supply noise. Board layout/grounding will be a factor as well.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: bson on May 12, 2020, 08:30:40 am
Are you driving a solenoid with a pair of MMBT3904s?  Those a very low current devices...
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 12, 2020, 04:45:11 pm
Something is weird with the crystal circuit, pins 7 & 8 shorted and grounded? Don’t know, it may not have shown up in the net as a ground. The 1M resistor is wrong as well, that’s something that appeared on the Mega schematic and has no basis in fact from any Atmel datasheet. Depending upon the crystal, you typically need 15-20 pf loading caps from each crystal pin to ground to get it to resonate.

AVCC should be fed through a 100uh choke and have a 100nf bypass cap on it, especially since you’re suppling from a switch mode regulator. You may find the analog to be very noisy due to the combination of the lack of filtering and the presence of supply noise. Board layout/grounding will be a factor as well.

I'm using a 16mhz Ceramic Resonator. I'm actually using the same one as an arduino uno smd version I have. I just copied parts over and seems to work fine after I remembered to set the correct fuses. The model # on them are CSTNE16M0V530000R0

I'm actually finding the voltage to be very clean with what I have. Altho I think I still might have an issue somewhere on the actual board, I don't think my smd reflow went all that well. This schematic mirrors the components used on my breadboard using two voltage buck converters to take a ~14v input and regulate to 12v and 5v.

Are you driving a solenoid with a pair of MMBT3904s?  Those a very low current devices...


I'm driving a single solenoid with a single MMBT3904, On my breadboard I am using 2n3904, and the solenoids only draw about 100mAh, they're very small. However, and I don't think this is an issue with the actual Transistor as I just soldered the 2n3904 in place of the SMD component and it was still having the same issue, but it keeps resetting. I don't know if this is an issue coming out of the micro-controller, but it might be. I'll post a video on what's happening soon.

I would have brought TX, RX, GND  and RESET out to a separate header and added the pull-up and the diode you find on UNO reset... that way you could program it via a serial bootloader (and make it pretend to be an UNO)

I didn't want to run a bootloader on it, and the idea is to program the chip directly by the ISCP and leave it be. Never to be touched again.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 12, 2020, 10:19:42 pm
Something is weird with the crystal circuit, pins 7 & 8 shorted and grounded? Don’t know, it may not have shown up in the net as a ground. The 1M resistor is wrong as well, that’s something that appeared on the Mega schematic and has no basis in fact from any Atmel datasheet. Depending upon the crystal, you typically need 15-20 pf loading caps from each crystal pin to ground to get it to resonate.

AVCC should be fed through a 100uh choke and have a 100nf bypass cap on it, especially since you’re suppling from a switch mode regulator. You may find the analog to be very noisy due to the combination of the lack of filtering and the presence of supply noise. Board layout/grounding will be a factor as well.

I'm using a 16mhz Ceramic Resonator. I'm actually using the same one as an arduino uno smd version I have. I just copied parts over and seems to work fine after I remembered to set the correct fuses. The model # on them are CSTNE16M0V530000R0

I'm actually finding the voltage to be very clean with what I have. Altho I think I still might have an issue somewhere on the actual board, I don't think my smd reflow went all that well. This schematic mirrors the components used on my breadboard using two voltage buck converters to take a ~14v input and regulate to 12v and 5v.

Are you driving a solenoid with a pair of MMBT3904s?  Those a very low current devices...


I'm driving a single solenoid with a single MMBT3904, On my breadboard I am using 2n3904, and the solenoids only draw about 100mAh, they're very small. However, and I don't think this is an issue with the actual Transistor as I just soldered the 2n3904 in place of the SMD component and it was still having the same issue, but it keeps resetting. I don't know if this is an issue coming out of the micro-controller, but it might be. I'll post a video on what's happening soon.



I take that back, kinda, looks like my issue was in fact ripple or noise coming out of my 5v regulator U4, it was being smoothed out after L2 using the 220uF C7 cap, but the moment a load was placed on the 5v rail it was completely unhappy. As seen here [attach=1]

Placing a 100uF cap directly on the vout before L2. Seems to have rectified the issue.

I should also say that the solenoids only draw 200mAh at 5v, which I realize is the transistors max rated, but they switch back and forth and there seems to be no heat issues. However my 12v regulator and 5v is gets extremely hot over time. The 5v at any one moment should only be drawing say 250mAh, which is half it's rating, but I do beleive the 12v to be drawing near its capacity, would changing it out for a 1A regulator cure it of it's heat issues?

Something is weird with the crystal circuit, pins 7 & 8 shorted and grounded?

Actually I see what you mean, it's actually the outline of the resonator that makes it look like it's being shorted. The only points connected are 1 2 and 3, and the 1M resistor.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: Buriedcode on May 12, 2020, 11:22:36 pm
You mentioned you used buck regulators on your breadboard, but the schematic shows two LDO linear regulators.  Although the schottky diode and inductor are there for a buck, there is no feedback, so.. are these a post reg filter?

If its a linear reg, and you're drawing 250mA on the 5v rail, that LDO will be dissipating  0.25 * (12-5) =  1.75W which is plenty toasty for a TO-220 without a heatsink, and still very warm for a DPAK on a large copper pour.

The 12V reg, if its only getting 14V then that'll be 0.25 * (14-12) = 0.5W.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 13, 2020, 04:03:21 am
You mentioned you used buck regulators on your breadboard, but the schematic shows two LDO linear regulators.  Although the schottky diode and inductor are there for a buck, there is no feedback, so.. are these a post reg filter?

I'm not entirely sure what you mean by post reg filter, I'm new to designing this and really have only been into as a hobby thus far. I saw it somewhere, and I feel like it was in the datasheet of the regulator as a simplified schematic. Other than that, I'm definitely over my head.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: poorchava on May 13, 2020, 05:30:56 am
Those are linear regulators, placing an inductor on the output without any cap will cause the instability you have seen. Also, the diode from GND to VOUT is not necessary. It does nothing. You may place one from output to inout, as some LDOs don't like when VOUT is higher than VIN (which happens when you turn the power off and have significant capacitance on VOUT).

You don't need those inductors at all. You may use one in series with motor bridge VM pin, but that all. For LDOs all you need is a 100n ceramin caps on input and output and some electrolytic cap. 100...220uf like u have I consider ok.

If you want to use BJT for something like that, I'd consider BRTs. They have the input bias resistors integrated within them which is smaller and saves assembly time. On your schematic a with ordinary BJTs resistors from base to emitter are missing. They should be there to ensure the BJT doesn't turn on by itself (especially, that as I understand it drives some electromechanical gizmo). If you need higher current BJT I usually go for BCX56.

Also, the schematic readability could be improved a lot. Can't tell what it does at a first glance.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 14, 2020, 03:36:49 am
ok, so a little bit more detailed information.The power draw on the 5v rail is max 234mAh, with my source voltage set to 13.7 max draw with everything connected is 380mAh. Without any solenoids connected it only draws 45mAh to power the ATMEGA and an led on the 5v rail. My main focus right now is to try to get rid of as much heat as I can, cause this is meant to be a controller you can hold, so it can't be running hot. Which I realize now, I should have gone with a switching regulator. Does anyone have a suggestion as to which to use? Or have experience with one they like. Would the best course of action be to get a single 5v switching regulator? or a regulator that has dual output of 12v and 5v? I'm really quite lost in the vast quantities of options.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: jaycee on May 14, 2020, 03:45:23 am
I'm driving a single solenoid with a single MMBT3904, On my breadboard I am using 2n3904, and the solenoids only draw about 100mAh, they're very small

What happens if they get stalled ? You'll probably find the current goes a lot higher, and your MMBT3904's will evaporate. Look for something in a SOT-89 or SOT-223 package.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: jaycee on May 14, 2020, 03:54:35 am
ok, so a little bit more detailed information.The power draw on the 5v rail is max 234mAh, with my source voltage set to 13.7 max draw with everything connected is 380mAh. Without any solenoids connected it only draws 45mAh to power the ATMEGA and an led on the 5v rail. My main focus right now is to try to get rid of as much heat as I can, cause this is meant to be a controller you can hold, so it can't be running hot. Which I realize now, I should have gone with a switching regulator. Does anyone have a suggestion as to which to use? Or have experience with one they like. Would the best course of action be to get a single 5v switching regulator? or a regulator that has dual output of 12v and 5v? I'm really quite lost in the vast quantities of options.

Does the 12V rail really need regulating if you are using 13.8V input ?
Your 12V regulator is also having to deal with the current drawn by the 5V rail, due to how you have put the two regulators in series. The 5V regulator doesnt need to be LDO as you have quite a head of voltage.

As for what regulator to use, LM2575 - about as simple as you get, available in fixed 5v versions.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: T3sl4co1l on May 14, 2020, 04:36:42 am
Remove the inductors and schottky diodes, those aren't switching regs.  C5 and C7 probably don't need to be so big, but they aren't hurting anything at that size, I don't think.

FYI, current is units of A, charge is units of Ah (ampere-hours).

So, say, batteries are rated in charge, and can deliver any amount of current up to their physical limit, for some time corresponding to that current and charge rating.  A discharge rate of 100mA, for 1 hour, delivers a charge of 100mA * 1h = 100mAh.  Or maybe it's 1A for 6 minutes, or 1mA for 100h, etc.

The pot and resonator symbols aren't very well drawn, but as long as they connect to the correct pins (double check the datasheet and footprint) that doesn't matter in the long run.

MMBT3904 is only rated for 200mA.  100mA loads will work, but it's tight enough that a MMBT4401 or 2N7002 would be better.

Something that's not an issue, but I always find amusing: the MBR1020s are rated five times higher than the transistors.  The flyback current from an inductive load is precisely less than the steady state current at turn-off -- you never need bigger diodes here.  Yet you so often see e.g. 1N4001s employed in this position, for absolutely no reason. :)  A BAS70 would just about do, but I'd traditionally put in a 1N4148W.

Consider running the motor and solenoids from raw VIN, not the reg.  The motor driver has a LOT more capacity than the poor reg does, and tons of voltage range.  You can always PWM to reduce the voltage seen by the solenoids.  And you may already be planning on this (or some other timing application) since PB1/2 are also OC1A/B..?

Alternately, if faster turn-off is desirable, consider a TVS from GND to Q1/2 collector, rated about twice the maximum supply voltage (and obviously Q1/2 need to be rated for even more voltage; not a problem).  (This isn't a good combination with PWM solenoid control: the excess power saved by PWM-ing is burned in the TVS instead.)

Also if those solenoids might change often, frequent rewiring or whatever -- consider using a protected switch like BSP75NTA.  Also includes voltage protection so you may not need a TVS.

Finally, what's U2 for? -- IC1-- wait, why is it IC1 but U everything else?  Ach, anyway-- IC1 has internal current sense and regulation circuitry, and it does this by returning the currents from OUT1/2 through R13.  Just sense the voltage there, like, with a comparator or ADC or whatever you're doing.  (Note that the current will be pulsating, so an ADC reading needs to be averaged over some time frame (milliseconds?) to get a meaningful DC value -- consider an RC filter to save on software complexity.)

Finally, regarding schematic clarity -- SCL/SDA are, I think, the only net name connections, why?  They're no pain to draw in properly.  These should be used judiciously, with an emphasis on clarity -- show the reader where they connect, perhaps organize the signals in a logical order, and reproduce that order elsewhere, or even add notes to which sheets they connect on (but don't let the comments get out of sync with the code\\\\schematic, either!).  Now, the two in this schematic is hardly a burden to figure out, but my first instinct on seeing the elbow wires between U1 and R14/15: "oh, he's just labeled them for future use I guess, they probably don't connect anywh--" and then I saw the labels off U2.  Making a tee shape with a loose wire segment helps suggest connectivity, or preferably using a connector symbol of some sort to call out "hey this is a connection to other stuff".

That, and just generally clean up routes, space wires evenly, avoid unnecessary bends and crossings.  Space components evenly, leave room for labels, don't overlap anything.

Place components in logical order, so that DC currents flow top to bottom, and signals flow left to right.  The power section is good in this respect, but the pots are jarring; they could be made into two-part symbols so the switches can be placed separately.  Alternately, net connectors could be used to call out connectivity to the switch while placing the whole component elsewhere.

Again, not huge priorities on a small schematic like this, but I've seen full stacks of sheets drawn this way, and let me tell you, they aren't any easier to follow than just tracing the bare PCB by eye...  Good habits start early, and all that.


With that out of the way -- higher level concerns might be EMC.  All those switching signals on H1 are a worry.  Keep this cable short.  Preferably, add a ground and use a shielded cable.  The input is fused which is nice, and the regulator is good up to 40V or so.  That covers a lot of ground, but there's always worse, and it might be worth putting a TVS diode in there, from GND to VIN (in parallel with C6).  SMAJ12A being a typical example.  Choose the voltage rating for the nominal maximum input voltage -- for a 12V power supply (SMPS) or battery, 12 or 15V is fine; for a wider range supply (iron-core wall wart) or automotive use, 18 to 24V may be wiser.  If this is automotive, appreciate that the voltage can be quite dirty -- spikes up to 300V (though not with a whole lot of current) are normal and expected.  The nasty one for automotive is load dump; it's rare enough that you might not care, or your device is noncritical enough that it's okay if it blows up anyway.  (And really, the 40V rating goes pretty far even with that; load dump peaks out in the 40-60V range (and lots of amperes available, for relatively long -- 10s or 100s of ms), so even if it happens, you might get away with it already.  Mind, not that the TVS -- if used -- would survive it.  A toasted TVS is a lot less to replace, at least.)

Good luck!

Tim
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: Buriedcode on May 14, 2020, 04:45:38 am
ok, so a little bit more detailed information.The power draw on the 5v rail is max 234mAh, with my source voltage set to 13.7 max draw with everything connected is 380mAh. Without any solenoids connected it only draws 45mAh to power the ATMEGA and an led on the 5v rail. My main focus right now is to try to get rid of as much heat as I can, cause this is meant to be a controller you can hold, so it can't be running hot. Which I realize now, I should have gone with a switching regulator. Does anyone have a suggestion as to which to use? Or have experience with one they like. Would the best course of action be to get a single 5v switching regulator? or a regulator that has dual output of 12v and 5v? I'm really quite lost in the vast quantities of options.

With 45mA load on a 5V reg with 13.7V in.. you can calculate the dissipation. 

I'm unsure if you know the formulas, my previous post assumed you did:  P(in Watts) = I(in Amps) * V (in Volts).   the voltage drop across the regulator (V) is Vin - Vout = 13.7 - 5 = 8.7V.  Current flowing through the reg is 45mA, or 0.045A.  P= IV = 0.045*8.7 = 0.3915W.  Or 0.4W, 400mW.  That will be enough to heat up a DPAK (which is what I think the regulators you have) quite a bit, if they don't have lots of copper around them (preferably on both sides, stitched with vias).

Using a 12V regulator for a motor probably isn't necessary, especially if you're powering this with 13.8V anyway.  But, what is the motor?  Part no. or current/voltage rating would be helpful.

I think we should see the board - that way we know what parts were used, or at least see the packages, because voltage regulators come in many many packages.  For the most part the MCU part looks fine, the solenoid driver transistors, should probably be larger (both physically, and in terms of ratings), and your power supply needs redoing - at the very least, if they are indeed linear regulators (not switchers) them remove the inductors and bridge them with wire for testing.

Edit: just saw teslacoil's reply, which says waay more than I have.  There's a lot of good info there, that might seem a bit much, or intimidating, but take it one paragraph at a time.   I stand by my request for a photo of the board!
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: poorchava on May 14, 2020, 08:38:08 am
I don't recommend the LM2575. Yes, they are jellybean and are made by countless Chinese companies. I would recommend something more modern. The likes of TI, Diodes, Microchip, ST, NXP, ONsemi each offer loads of integrated synchronous switch mode regulators. Most of them require only input and output caps, feedback resistors (or not if u use a fixed version) an inductor and sometimes a bootstrap capacitor.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: jaycee on May 14, 2020, 10:57:30 pm
I don't recommend the LM2575. Yes, they are jellybean and are made by countless Chinese companies. I would recommend something more modern. The likes of TI, Diodes, Microchip, ST, NXP, ONsemi each offer loads of integrated synchronous switch mode regulators. Most of them require only input and output caps, feedback resistors (or not if u use a fixed version) an inductor and sometimes a bootstrap capacitor.

Thats pretty much all the LM2575 requires. Whats the problem with using them ?
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 15, 2020, 09:24:21 pm
ok, so a little bit more detailed information.The power draw on the 5v rail is max 234mAh, with my source voltage set to 13.7 max draw with everything connected is 380mAh. Without any solenoids connected it only draws 45mAh to power the ATMEGA and an led on the 5v rail. My main focus right now is to try to get rid of as much heat as I can, cause this is meant to be a controller you can hold, so it can't be running hot. Which I realize now, I should have gone with a switching regulator. Does anyone have a suggestion as to which to use? Or have experience with one they like. Would the best course of action be to get a single 5v switching regulator? or a regulator that has dual output of 12v and 5v? I'm really quite lost in the vast quantities of options.

Does the 12V rail really need regulating if you are using 13.8V input ?
Your 12V regulator is also having to deal with the current drawn by the 5V rail, due to how you have put the two regulators in series. The 5V regulator doesnt need to be LDO as you have quite a head of voltage.

As for what regulator to use, LM2575 - about as simple as you get, available in fixed 5v versions.

Yes, for the application that I'm using it for it does, I require the motor to be at a constant and controllable speed. This would be for something that can be used in the car and in the home, so especially in the car when the voltage can varry I want my 12v rail to be constant. Which is why I added a motor controller, so that the only way the motor speed changes is if a pot was turned to change it.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: Buriedcode on May 15, 2020, 10:47:23 pm
Yes, for the application that I'm using it for it does, I require the motor to be at a constant and controllable speed. This would be for something that can be used in the car and in the home, so especially in the car when the voltage can varry I want my 12v rail to be constant. Which is why I added a motor controller, so that the only way the motor speed changes is if a pot was turned to change it.

Generally, for fixed, repeatable, speed, some sort of feedback is used with a control loop which greatly increases complexity in terms of software..  Relying on power voltage, is perhaps one way, but a car's battery can drop below 12V, and go significantly higher than it (its a bit of a nightmare).  An LDO is all well and good, but it will still require some headroom - as well as a possible input diode because a car's power supply will happily destroy an LDO without adequate protection. What is the current this motor needs?  The motor driver you have is rated for 3A (3.5A max) so we can assume it is much lower than that. 

That's good, because there are 3A and 5A LDO's, but if you're drawing say 2.5A from the motor regularly, and your LDO - assuming your input voltage is high enough - drops 1V that still 2.5W of heat that has to go somewhere.  A switched mode supply, can solve multiple issues (power input voltage variation, using buck/boost, sufficient output current, more efficient etc..) but adds more complexity.  It can't hurt to try one of the cheapo "simple switchers" and test if it can keep the motors speed fixed with varying input voltage, but beware the advertised current rating on prebuilt modules, often they are just lies.

As you've found the sheer vast number of switching controllers/devices is daunting, even when you narrow it down by package, type (buck, boost, buck/boost) and current rating.  It can also be quite critical in terms of layout.  But there are ones that only require an inductor and IO caps that shouldn't be difficult to add to your PCB.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: wraper on May 15, 2020, 11:09:43 pm
LDO circuit is totally wrong. Instead of connecting a capacitor directly to the output as shown in the datasheet, for some reason there are inductors in series. This circuit likely will be unstable and may oscillate. D1 and D2 have little use, especially connected before those stupid inductors. If you want protection, place TVS diodes onto power rails. Also I don't think that dumping voltage spikes through D4 and D5 into unprotected 5V rail is such a great idea. 680nF/10k values for C8/R8 snubber make no sense.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: bson on May 17, 2020, 07:56:52 pm
What happens if they get stalled ? You'll probably find the current goes a lot higher, and your MMBT3904's will evaporate. Look for something in a SOT-89 or SOT-223 package.
My experience breadboarding with TO-92's is they don't even evaporate.  They get slightly warm, then turn into diodes without smoke or other warnings...
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 26, 2020, 04:53:36 pm
Ok right now I'm trying to solve my power supply, looking at trying to use LM2675M-12/NOPB for my 12v rail and LM2675MX-5.0/NOPB for my 5v rail. Right now I've wired up a quick circuit using the 12v switching regulator to see how it works and on load it drops to 6v, input voltage is @15.7v. It's wired up like it is in the attached schematic. Photo TEK0000.jpg is the output without a load with Ch2 being before the inductor/capacitor and ch1 being after the inductor/capacitor. TEK0002.jpg is with a load supplied. What am I missing here?

It should be noted, I've tried tying ON/OFF to ground, with a voltage divider to supply 3v, and tying it to vcc, all of which made no difference.

Also to answer someone that asked earlier, its a small 12v motor that draws 200mA at full load. I think this is it. https://www.jameco.com/z/FK-180SH-18130-R-Nichibo-Taiwan-12V-Volt-DC-Motor-11806-RPM_2258523.html (https://www.jameco.com/z/FK-180SH-18130-R-Nichibo-Taiwan-12V-Volt-DC-Motor-11806-RPM_2258523.html) but actual measurements show only 200mA at 12v
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: Buriedcode on May 26, 2020, 06:10:39 pm
Ok right now I'm trying to solve my power supply, looking at trying to use LM2675M-12/NOPB for my 12v rail and LM2675MX-5.0/NOPB for my 5v rail. Right now I've wired up a quick circuit using the 12v switching regulator to see how it works and on load it drops to 6v, input voltage is @15.7v. It's wired up like it is in the attached schematic. Photo TEK0000.jpg is the output without a load with Ch2 being before the inductor/capacitor and ch1 being after the inductor/capacitor. TEK0002.jpg is with a load supplied. What am I missing here?

It should be noted, I've tried tying ON/OFF to ground, with a voltage divider to supply 3v, and tying it to vcc, all of which made no difference.

Also to answer someone that asked earlier, its a small 12v motor that draws 200mA at full load. I think this is it. https://www.jameco.com/z/FK-180SH-18130-R-Nichibo-Taiwan-12V-Volt-DC-Motor-11806-RPM_2258523.html (https://www.jameco.com/z/FK-180SH-18130-R-Nichibo-Taiwan-12V-Volt-DC-Motor-11806-RPM_2258523.html) but actual measurements show only 200mA at 12v

Its been a while since you first posted, but I think we need to take a step back, or I've missed something.   You originally posted a schematic that included linear regulators, but with components connected to them designed for a switching (buck) regulator.  You then said you made a PCB from this schematic, but we still haven't seen this PCB - design files or photos.

We/I can't tell if your schematic is incorrect, whether you used linear regulators and didn't include the inductor/diode, or whether you used a switching regulator, and kept these components.  This could be cleared up with the part numbers you populated on the PCB, or a photo of the PCB itself. Preferably both.   

Now you've prototyped a switching/buck regulator (LM2675M-12/NOPB) and it isn't functioning as it is meant to.  There can be many reasons for this: inductor value/Isat/DCR, prototype method, wrong connections, diode selection, input/output capacitance etc..  The bottom waveform shows its switching, so it's at least getting power and "doing something" but the low output could be many things.

So even though you have included switching waveforms, it's pretty hard to know why it isn't working as intended without the following:

- A schematic of your prototype/test board.  Not a schematic you found on the web, the actual schematic of what you've done. Preferably with...
- The parts used.  The LM2675M has few external components, but the inductor's inductance, its Isat, and DCr are important parameters.  As well as the diode used, and the capacitance of the IO caps.
- How you prototyped it.  A solderless breadboard is handy, but pretty unreliable for switchers, soldered prototype board is better, but if you have long wires between parts it can cause all manner of issues in a switching regulator.  Dead-bug can work rather well, but is pretty messy.
- A photo might be able to show all of the above.  That is a photo of both your original board and the  LM2675M test board/setup

I realize this sounds like I'm being pedantic, but often with posts about trying to debug things, more information is better.  With sparse info, like a couple of waveforms and "its output is too low", we have to make a LOT of assumptions, any of which could be completely wrong, and can end up turning the thread into a mess of random suggestions that could keep you busy for days.  This isn't a criticism of your post, rather a way to move forward, and to prevent you getting 50 different suggestions.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 26, 2020, 09:22:40 pm
Ok right now I'm trying to solve my power supply, looking at trying to use LM2675M-12/NOPB for my 12v rail and LM2675MX-5.0/NOPB for my 5v rail. Right now I've wired up a quick circuit using the 12v switching regulator to see how it works and on load it drops to 6v, input voltage is @15.7v. It's wired up like it is in the attached schematic. Photo TEK0000.jpg is the output without a load with Ch2 being before the inductor/capacitor and ch1 being after the inductor/capacitor. TEK0002.jpg is with a load supplied. What am I missing here?

It should be noted, I've tried tying ON/OFF to ground, with a voltage divider to supply 3v, and tying it to vcc, all of which made no difference.

Also to answer someone that asked earlier, its a small 12v motor that draws 200mA at full load. I think this is it. https://www.jameco.com/z/FK-180SH-18130-R-Nichibo-Taiwan-12V-Volt-DC-Motor-11806-RPM_2258523.html (https://www.jameco.com/z/FK-180SH-18130-R-Nichibo-Taiwan-12V-Volt-DC-Motor-11806-RPM_2258523.html) but actual measurements show only 200mA at 12v

Its been a while since you first posted, but I think we need to take a step back, or I've missed something.   You originally posted a schematic that included linear regulators, but with components connected to them designed for a switching (buck) regulator.  You then said you made a PCB from this schematic, but we still haven't seen this PCB - design files or photos.

We/I can't tell if your schematic is incorrect, whether you used linear regulators and didn't include the inductor/diode, or whether you used a switching regulator, and kept these components.  This could be cleared up with the part numbers you populated on the PCB, or a photo of the PCB itself. Preferably both.   

Now you've prototyped a switching/buck regulator (LM2675M-12/NOPB) and it isn't functioning as it is meant to.  There can be many reasons for this: inductor value/Isat/DCR, prototype method, wrong connections, diode selection, input/output capacitance etc..  The bottom waveform shows its switching, so it's at least getting power and "doing something" but the low output could be many things.

So even though you have included switching waveforms, it's pretty hard to know why it isn't working as intended without the following:

- A schematic of your prototype/test board.  Not a schematic you found on the web, the actual schematic of what you've done. Preferably with...
- The parts used.  The LM2675M has few external components, but the inductor's inductance, its Isat, and DCr are important parameters.  As well as the diode used, and the capacitance of the IO caps.
- How you prototyped it.  A solderless breadboard is handy, but pretty unreliable for switchers, soldered prototype board is better, but if you have long wires between parts it can cause all manner of issues in a switching regulator.  Dead-bug can work rather well, but is pretty messy.
- A photo might be able to show all of the above.  That is a photo of both your original board and the  LM2675M test board/setup

I realize this sounds like I'm being pedantic, but often with posts about trying to debug things, more information is better.  With sparse info, like a couple of waveforms and "its output is too low", we have to make a LOT of assumptions, any of which could be completely wrong, and can end up turning the thread into a mess of random suggestions that could keep you busy for days.  This isn't a criticism of your post, rather a way to move forward, and to prevent you getting 50 different suggestions.

I did actually end up finding the problem, it was a dumb mistake on my part, I was using a diode that wasn't rated high enough so it kept breaking down the voltage as it drew more power than the diode could handle. After replacing it for better suited ones the power regulation was stable and correct.

Laugh at me if you will, but this is how I prototyped the switching regulator hah, had to work with what I had cause I don't have any bare copper boards around.
[attach=1]

Also I'm a little shy in sharing, as it is my first board I feel a little intimidated in having others critique my work.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: Buriedcode on May 26, 2020, 10:45:21 pm
I did actually end up finding the problem, it was a dumb mistake on my part, I was using a diode that wasn't rated high enough so it kept breaking down the voltage as it drew more power than the diode could handle. After replacing it for better suited ones the power regulation was stable and correct.


So, was that for the LM2675M test circuit, or your original design?  Glad its working correctly, I would still like to know the part numbers used.

Laugh at me if you will, but this is how I prototyped the switching regulator hah, had to work with what I had cause I don't have any bare copper boards around.

I don't think anyone here is going to laugh.  I have seen beautifully neat circuits that didn't work at all because they were very poorly designed, and "dead bug" rats nest complete mess of prototypes that worked flawlessly.  I've prototyped SOIC devices using stripboard (vero board with copper strips) and it worked well for rough 'n' ready testing.  Also your connection looks like it has good thick connections so nothing wrong with it. 

But I am still curious about the parts used.  There are many inductors about, ranging from ratings from mA to tens of Amps, form nano henrys right up to 500mH, something I used to regularly see in the beginners forum is people using small axial "filter" inductors for power switchers - ones that look like resistors.  This is why I asked for a photo of the whole test set up, the components, and/or the part numbers used.


Also I'm a little shy in sharing, as it is my first board I feel a little intimidated in having others critique my work.

So was I, and I have posted things that were criticized.  But rarely were those criticisms unhelpful.  Some may be quite rude with how they point out flaws but are still technically correct (engineers get straight to the point generally). But don't worry, if we can see the circuit, and the parts used, others can see what you've done, if you've done anything "incorrectly", and how to proceed to meet your design goals.  If anyone posts something that doesn't provide useful information - ignore them.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 27, 2020, 04:47:06 pm
I did actually end up finding the problem, it was a dumb mistake on my part, I was using a diode that wasn't rated high enough so it kept breaking down the voltage as it drew more power than the diode could handle. After replacing it for better suited ones the power regulation was stable and correct.


So, was that for the LM2675M test circuit, or your original design?  Glad its working correctly, I would still like to know the part numbers used.

Yes, that was for the LM2675M-12/NOPB, I'm also using a LM2675MX-5/NOPB for 5v.

But I am still curious about the parts used.  There are many inductors about, ranging from ratings from mA to tens of Amps, form nano henrys right up to 500mH, something I used to regularly see in the beginners forum is people using small axial "filter" inductors for power switchers - ones that look like resistors.  This is why I asked for a photo of the whole test set up, the components, and/or the part numbers used.


Atm my final parts haven't been chosen, I'm looking at a 68uH inductors to go onto the 12v and 5v rails, I'm mostly following TI's power supply designer WEBENCH atm, it suggests 68uF Electrolytic on the output but is that really enough? I've already got 220uF that I was going to reuse. Also What's the best way to figure out filtering? As I'm noticing my 12v rail is being effected by the 5v switching. That also may be because I'm not using the correct inductors atm.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: Buriedcode on May 27, 2020, 08:57:03 pm
Again it is hard to say what is going on with a schematic of your entire power supply, and the part numbers of all the parts (I meant the inductor, the diode and the caps, although the caps just need a capacitance and voltage rating).  TI's webench is very handy, but layout and part selection can still make or break a circuit.   So, a photo of the board, and a schematic of what you've got - not what you intend to have.

As for filtering, I would first get the switching power supply working, so it can provide adequate current and regulation for your given input voltage range.  Then you can play about with the output cap value, or possibly add a post regulator LC filter if needed.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on May 29, 2020, 04:21:23 pm
Again it is hard to say what is going on with a schematic of your entire power supply, and the part numbers of all the parts (I meant the inductor, the diode and the caps, although the caps just need a capacitance and voltage rating).  TI's webench is very handy, but layout and part selection can still make or break a circuit.   So, a photo of the board, and a schematic of what you've got - not what you intend to have.

As for filtering, I would first get the switching power supply working, so it can provide adequate current and regulation for your given input voltage range.  Then you can play about with the output cap value, or possibly add a post regulator LC filter if needed.

I hadn't shared a photo of the board yet cause I was in the mists of redoing it. However here it is.

[attach=1]
[attach=2]

Also for the Schematic, it is the same as a couple posts back, however for Q1 and Q2 They've been replaced with a MMBT4401, however now I think I'm second guessing it.

[attach=3]
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: NivagSwerdna on June 07, 2020, 10:17:43 am
Within the power supply sections it might be worth using copper fill regions for the high current paths.  You can normally do this by overlaying the region on top of the routed tracks.  For example on the botton right hand side a filled region to pin 8 and the C and L would be easy.  You might find this affects your rotation too... e.g. maybe pin 8 is too far away in its current orientation.
I don't use those parts.... but be careful with L and C selection.... if necessary just follow the datasheet.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: sokoloff on June 07, 2020, 11:24:19 am
But I am still curious about the parts used.  There are many inductors about, ranging from ratings from mA to tens of Amps, form nano henrys right up to 500mH, something I used to regularly see in the beginners forum is people using small axial "filter" inductors for power switchers - ones that look like resistors.  This is why I asked for a photo of the whole test set up, the components, and/or the part numbers used.
Atm my final parts haven't been chosen, I'm looking at a 68uH inductors to go onto the 12v and 5v rails, I'm mostly following TI's power supply designer WEBENCH atm, it suggests 68uF Electrolytic on the output but is that really enough? I've already got 220uF that I was going to reuse. Also What's the best way to figure out filtering? As I'm noticing my 12v rail is being effected by the 5v switching. That also may be because I'm not using the correct inductors atm.
No one’s worried about the level of polish or the final parts selection.
You’ve got a lot of people willing to help you get to the second revision of your board.
You made a first version and assembled it. Share photos of that with pride and you’ll get much better level of help from people who can look at what’s actually going on rather than make guesses semi-blindly.

Pics, please. It’ll make things go so much more smoothly and efficiently for those trying to help and for you to get better advice for your second board spin.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: NivagSwerdna on June 07, 2020, 02:05:34 pm
No one’s worried about the level of polish or the final parts selection.
Hm... reusing a 220uF electrolytic that was lying around might not work.... depends on ESR.... check the specs.  In my experience TI Webbench doesn't always get it right... or that's my theory anyway. (i.e. better to have a bit more headroom L wise)
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: SirAlucard on June 07, 2020, 04:23:02 pm
No one’s worried about the level of polish or the final parts selection.
Hm... reusing a 220uF electrolytic that was lying around might not work.... depends on ESR.... check the specs.  In my experience TI Webbench doesn't always get it right... or that's my theory anyway. (i.e. better to have a bit more headroom L wise)

It wasn't a 220 that was laying around, it was the 220 that was purchased for the v1 of the board, that's what I meant by reusing it.
Title: Re: My Very first fully custom PCB looking for Schematic Input and maybe any errors.
Post by: n1ist on June 10, 2020, 10:13:07 pm
Switchers are very sensitive to layout, especially if you want to avoid EMI issues.  If you look at the data sheet, they have a suggested layout.  Note the high-current paths are short and done with pours.