Review of a beginner's schematic + PCB layout (eagle, bluetooth LE, fan) - Page 1
Forum section: electronics / beginners

author: fgrandel
author_rank: Contributor
timestamp: June 22, 2017, 11:19:12 pm
content: Hi!I just did my first ever schematic + PCB layout in eagle. Could anyone with more experience do a quick review so that I can avoid the worst errors before I send it out to the fab?The purpose of this circuit is to drive a 230V AC 10W fan via Bluetooth LE from an Android App. The complete system consists of two parts: a sensor board and a the fan controller. This is the schematic/layout of the fan controller part only. I got the whole system running as a breadboard prototype and I looked it through with my Analog Discovery 2 as far as I could.What I tried to do:* Keep the whole high voltage part (230V) well apart from the low-voltage part, hopefully respecting the necessary isolation distances.* I tried to protect the high-voltage part with a fuse and varistors to the incoming lines.* The whole thing will be packaged in an IP65+ box from which only the power cord and the fan cable will protrude.* I'm using a ready-made ac/dc converter module to avoid the worst errors there.* I'm using an opto-coupled photomos ssr (random turn-on, zero cross turn-off - panasonic aqh) to switch the inductive load (fan).* BLE connectivity is through Red Bear Lab's BLE Nano. They don't really have a datasheet but it's actually just a wrapper around Nordic's nRF51822 (M0 cortex).* The fab basically allows features down to 125um and drills down to 0.2mm diameterI'm going to assemble the board myself. Smaller parts will be re-flowed with a hot air gun. I trained this a little with ready-made adapter boards over the last days. Works ok.Looking forward to your comments!Florian

author: Rerouter
author_rank: Super Contributor
timestamp: June 23, 2017, 09:06:13 am
content: You left out the PCB layout and schematic??Also please upload them as either PDF or Images, not everyone will have eagle.

author: fgrandel
author_rank: Contributor
timestamp: June 23, 2017, 01:25:46 pm
content: Hi! Thanks for your feedback.Find the Board and Schematics enclosed as PDF.Those who look for the EAGLE files, please look inside the ZIP in my original post.Hope someone finds the time to help, will be very much appreciated.

author: fgrandel
author_rank: Contributor
timestamp: June 24, 2017, 06:04:08 am
content: This is part 2 of the project - the sensor board. Any hint how to improve the design is highly appreciated!

author: Rerouter
author_rank: Super Contributor
timestamp: June 24, 2017, 12:04:28 pm
content: Part 1, Add a pull down resistor on the your mosfet switches. in the order of 10K, if your micro is held in reset, it will switch its pins to inputs with a 100K pullup, which will easily turn on your mosfet.Put another 10u cap right next to D1, your not switching much, but i don't know how responsive your power supply is,And reverse 3.3V and ground on your 4 pin connector between boards, you want the ground to soak up any noise on your I2C bus, I hope your not running it much more than 1m, if you are, you will likely have to go slower than the normal 100Khz.I would add local weak pullups on the I2C bus, so that if you have a cable come loose, it doesn't start processing noise.Other than that, your clearances look respectable.Part 2 looks reasonable, I havent checked what your charge rate is, but if its lithium, keep it under 0.3C for long lifeFor both, i would write your pin functions on the silkscreen on both boards, when something goes wrong a year down the line you will thank yourself if you dont have to go searching for your source files.Kinda a bigger concern, it appears you have 2 power supplies linked directly, with no diode or similar, one called 1.8V on the sensor module, and one called 3.3V on another, this smells like a combination for magic smoke to me?If you are planning to run both of of 1 supply or the other, use diodes or a power source switch IC,Though i genuinely have to question why with a mains based power supply you would need battery fallover?

author: fgrandel
author_rank: Contributor
timestamp: June 25, 2017, 12:20:29 pm
content: Wow, thanks a lot for your review! I'm going through your comments now and will respond to them when done.

author: fgrandel
author_rank: Contributor
timestamp: June 25, 2017, 11:26:37 pm
content: Quote from: Rerouter on June 24, 2017, 12:04:28 pmGood point. I added a pull-down to the mosfet switching the fan as it would not be acceptable for it to be switched on erratically.I have a hard time to find space for resistors besides the LED-switching mosfets w/o changing the design too much: From a functional viewpoint it would be ok for those fets to be switched on during reset. Is there any danger of Vgs to exceed it's rating during reset or similar? If not I'll live with the small disadvantage... What do you think?Quote from: Rerouter on June 24, 2017, 12:04:28 pmDone.Quote from: Rerouter on June 24, 2017, 12:04:28 pmI reversed the polarity of GND vs. 3.3V on the I2C connector to reduce noise pick-up as you propose.The I2C connector on board 1 is not meant as interconnect between the two boards but to connect a secondready-made BM280 (temp/humidity) sensor breakoutfor outside temperature/humidity - e.g. to decide how switching the fan will change indoors climate. The cable will be 10cm max. Would that be ok?Board 2 is the corresponding (autonomous) indoor sensor, hence the battery and the lower voltage. Board 1 and board 2 will have no cabling between them. All communication is via Bluetooth LE through a central Android device (an old Nexus 4 with a custom Android OS on it).Clears up the misunderstanding re two separate power supplies as well, I guess...Quote from: Rerouter on June 24, 2017, 12:04:28 pmThe external BM280 board connected via I2C has its own 4.7k pull-ups integrated. So this shouldn't be an issue?Quote from: Rerouter on June 24, 2017, 12:04:28 pmResistors R1 and R2 connected to IC1's SET2 pin should limit loading current to around 0.2C. Additionally IC4 will watch the battery voltage and switch power off at ~3V. The Li-Ion is speced at 2.75V max discharge. Does that sound like a reasonable safety margin?Quote from: Rerouter on June 24, 2017, 12:04:28 pmDone.Quote from: Rerouter on June 24, 2017, 12:04:28 pmSee above - was just a misunderstanding.I also updated the design so that each chip has its own local ground plane with a single connection to the power ground so that local noise is kept local. Probably overkill but helped me to understand how to do something like this in EAGLE. Hope it doesn't hurt either?Thanks again for your review!

author: Rerouter
author_rank: Super Contributor
timestamp: June 26, 2017, 02:44:31 am
content: Looks good, change your plane connections to "Thermal", and the fat traces to your switcher IC, instead use a trace not much wider than the pads for the first 0.1mm, again this is to make it possible to solder easily, the inductor can stay fat, as you can hit that with a soldering iron from the edge, but a qfn package with pins directly to a plane is not easy.I would also reconnect it back up to 1 big plane, your dealing with RF not high power, but weird things occur around stubs.as you have planes on both sides, where a track changes layers, place a ground via, its not needed for slow signals, but its a good practice for any digital signals, e.g. you may be flashing an LED at 2Hz, but the pin is slamming between positive in a few nanoseconds. which does follow path of least impedance, rather than least resistance of slower analog signals.On the switcher, all output voltage traces should come out of the capacitor, not the inductor. it seems small, but it can cause unwanted noise. again, this is a best practices note, not entirely required by your application,And finally, you can shift a few traces slightly to get the plane fill to the majority of the board, the less its broken, the less weirdness your likely to encounter in the future. If there is an island of ground that comes from 1 place, throw a stitching via down.

author: fgrandel
author_rank: Contributor
timestamp: June 26, 2017, 07:57:06 am
content: Great support. I'm learning. Nice. :-)Quote from: Rerouter on June 26, 2017, 02:44:31 amTried to follow your advice and compromise between not breaking up high-current traces/planes too much while improving solderability. The larger components on the switch node which I'll solder with the solder iron still have full pads underneath to minimize parasitic inductance. The QFN (which is going to be soldered with the hot air gun) should now be connected with small traces only. Makes sense?Quote from: Rerouter on June 26, 2017, 02:44:31 amDone.Quote from: Rerouter on June 26, 2017, 02:44:31 amI tried to follow this advice but I think I didn't fully understand it and so I'm not sure whether I did it right. I understand that digital signals have lots of high frequency content. Do you mean that this could cause unwanted capacitive coupling to neighboring signals? if so - how do nearby ground vias help? Maybe you could explain this a little? That would be interesting.Quote from: Rerouter on June 26, 2017, 02:44:31 amTried to improve on that point (see screenshot). Did I get it right?Quote from: Rerouter on June 26, 2017, 02:44:31 amDone.More questions:* I had a hard time to route the FB node of the buck converter. I now have it on the bottom layer otherwise I would have made a loop around the inductor which doesn't sound like a great idea. Is that ok?* I added a circuit to the Sensor board to let my uC sample battery voltage. I am dividing the battery voltage down to the max input level of the uC's ADC pins. According to the spec, the ADC inputs require low input impedance (a few kR only). Having that divider on all the time would unnecessarily waste battery power, so I added an nmos/pmos pair to only enable it while measuring (which will be once or twice a day). Attached the updated schematic. Do you have a better idea?(The RF module I'm using exposes those extra ADC/measurement enable pins via solder pads only - hence the extra 2P-connector.)

author: Rerouter
author_rank: Super Contributor
timestamp: June 26, 2017, 11:18:28 am
content: Quote from: fgrandel on June 26, 2017, 07:57:06 amI may not have explained the reasoning behind this as well as i should have. its more about reducing inductance, higher edge rates follow the path of least impedance, rather than the normal path of least resistance for DC signals, and what happens for the signals your hopping under, now admittedly for this level of project i'm pulling out a 5kg sledge when a 100g tuning hammer is all thats needed,As shown in the below picture, higher speed signals have a return or ground path that tries to follow the signal traces as closely as possible, ideally you want to provide it this path, however with 2 layer boards your garenteed to hop another layer and break this path, meaning the ground current needs to shoot off and try and snake back to the signal, if instead where you hopped traces you can provide a way for these traces ground currents to flow, it keeps things clean and quiet,For the lower trace on the ground plane the return current will flow directly next to the trace you hopped down to that layer, so it is happy, but the one you hopped under on the top is now broken. to fix this, place a way for the ground current to hop on the top side close to the break.Ideally you avoid breaks under signals if you can, but the real world rarely presents you such things, as an example i have attached an image based on your board, so the traces only hop under there own pins and the top side ground plane, meaning it has a very good return path.QuoteYes, now all current from that rail comes out of the capacitor, this means any high frequency noise gets shunted through the capacitor to ground. however you will want a via directly next to the ground pad of that capacitor (keeping return path small)QuoteYes having the feedback pin run as you have shown is fine as it has a ground trace on its opposite side, and its a low impedance trace (its source is a voltage rail capacitor) meaning its hard for it to pick up noise. if your cautious, you can shift it slightly down so it keeps a little more distance from the switching net.For the battery monitoring, add a small capacitor about 3x the sampling capacitance of your ADC (generally 10nF), just to help smooth out your readings as a battery wont change voltage very quickly.It should work fine.

author: fgrandel
author_rank: Contributor
timestamp: June 26, 2017, 09:31:01 pm
content: Quote from: Rerouter on June 26, 2017, 11:18:28 amNo problem. I still like the explanation as it helps me to gain understanding and learn a technique. This whole project is only about learning. ;-)Quote from: Rerouter on June 26, 2017, 11:18:28 amVery nice explanation - easy to understand now. :-) So the vias I placed were useless as there was no plane on top. I tried to fix this where I could (just as an exercise...) Nice solution you found for IC3 btw. Thanks for taking the time to even draw that for me. The signals I couldn't fix 100% are PWR_EN and FB. But even those were improved, I hope.Quote from: Rerouter on June 26, 2017, 11:18:28 amDone.Quote from: Rerouter on June 26, 2017, 11:18:28 amI tried to improve that as well...Quote from: Rerouter on June 26, 2017, 11:18:28 amAdded space for a Cap. I'll later try out some values in real life to see what works best. The pmos/nmos combination is ok like it is? I saw some undershoot on the high-side MOSFET when switching to high impedance in the simulation due to parasitic inductance. Hope this won't get serious enough to cause trouble in the real thing (e.g. due to the airwires needed for connection)?Wow - overall I think the whole design improved a lot due to your feedback. Thank you so much. :-)

author: Rerouter
author_rank: Super Contributor
timestamp: June 28, 2017, 08:00:48 am
content: add back in some of the circuit parasitics, and those spikes will not be visible, sprinkle a few PF to ground and between pads, some resistances and inductances in the leads, etc, your switching a very small current, which should mean the inductive spike should be very tiny.Simulation can give odd results if you dont understand its limitations, e.g. if you have ever simulated with an ideal op amp, your going to suffer pain when you try with a real one.

author: fgrandel
author_rank: Contributor
timestamp: June 28, 2017, 09:51:39 am
content: Got it. :-D Thanks a lot for your great support. Sending the whole thing to production now. Will let you know what comes out when I assemble the two boards.