Author Topic: First PCB - ESP-01 AIO Programmer  (Read 9545 times)

0 Members and 1 Guest are viewing this topic.

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
First PCB - ESP-01 AIO Programmer
« on: December 14, 2017, 12:45:51 pm »
Hey guys!

I posted in the beginner forum, but I figured this would be a better spot for actual questions regarding my first ever PCB design and layout. I built an ESP-01 Programmer, based on a CH340G chip. I was thinking of using another chip, like a CP2101 for its profile, but I think the CH340G has more widely available drivers, and at least in my case, Windows 10 auto detects it and auto installs the drivers. Its also easier to hand solder I suspect.

Anyway, I just couldn't find what I wanted in an ESP programmer. They all either lacked the features I wanted, and I figured if I wanted them, everyone else must as well. I wanted a way to plug in the ESP-01, program, reset, and then test, without removing the cord, module, fabra cobbling, or anything else for that matter. Here is the result! Being my first circuit, is there anything I missed, or anything I could do better? I tried to keep the number of VIA's to a minimum of only 2, but took an hour of making layout adjustments, which I am not sure really matters as an assembler, but may for the fabricator.

The actual questions I have are;
1. Can I use any 12Mhz passive crystal?
2. Are my values and connections correct?
3. Will it work?! This being my first go around, I assume I missed something, or got a value wrong, or any number of other screw ups.

Let me know what you think!

« Last Edit: December 14, 2017, 12:48:06 pm by siconic »
 

Offline sanwal209

  • Regular Contributor
  • *
  • Posts: 114
Re: First PCB - ESP-01 AIO Programmer
« Reply #1 on: December 14, 2017, 04:02:46 pm »
Hi,

I just checked Datasheet, Everything seems to be connected in right place. What i dont like is placement of components on PCB. Place Cystal as close as possible to IC. Try to match the length of D+ and D- traces. Apart from that everything seems fine. Try Searching on google differential pair.
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #2 on: December 14, 2017, 04:14:00 pm »
Place Cystal as close as possible to IC. Try to match the length of D+ and D- traces. Apart from that everything seems fine. Try Searching on google differential pair.

Thanks for the feedback! I am shocked it looked as good as it did, given this was my first shot, so I will make those changes in Rev. 3! I have 3 version of this board on the way for testing. The fact that it very well may work, makes this all the more exciting.

Does the amount of VIA's matter in my design? If not, then I am more willing to move components.

Also, is there an advantage to having a ground plane? I was trying to fit one in, but I couldn't figure out how to get Eagle to do it, despite the 3 tutorials I watched, I just could not get one.
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #3 on: December 14, 2017, 05:32:19 pm »
I've been playing with the CH340 and have yet to get it work. Or, I should say, can't get the crystal to work. Unfortunately, there isn't a huge amount of info on this chip out there. The translated datasheet is pretty minimal.

I would definitely move the resistors and put the crystal next to the chip.
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #4 on: December 14, 2017, 06:34:47 pm »
Rotate the crystal 90 degrees so you can place it closer to the 2 pins it connects to. The example schematic in the CH340G datasheet shows 22pF load capacitors like you have so when you choose a crystal make sure you find one that has that, or close to it, load capacitance specified, something like the ECS-120-20-5PX-TR

What layout program are you using, if it's something I have installed on one of my machines I can show you what I think would yield a better layout.
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #5 on: December 14, 2017, 08:06:00 pm »
What layout program are you using, if it's something I have installed on one of my machines I can show you what I think would yield a better layout.

I am using Eagle. PM me and I will send it to you.
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #6 on: December 14, 2017, 08:16:22 pm »
Actually, here is version 3. I think it is a bit better. Doesnt look as "neat" but the crystal and caps are closer to the IC, and D1 and D2 are almost the same length.
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: First PCB - ESP-01 AIO Programmer
« Reply #7 on: December 15, 2017, 12:54:46 am »
Some hints for building a produceable, trouble free board:

Avoid running signals between the pads of SMD passive components (and USB connectors). Spend some effort to minimize running traces between the pads of SOIC chips and headers.

Never run signals under a crystal.

Center traces that run between device pads.

Maximize spacing between traces, pads, and components wherever you can.

Use the "loosest" trace width and spacing you can.  Just because the board house can do 6/6 mil doesn't mean that you should use it.

If you can, don't use SMD passives smaller than 0805.

If you are going to hand-assemble the board, it helps to have the components oriented in the same direction.

After doing a layout, let it rest for a couple of days.  Then go back an re-examine it.  You'd be surprised at the issues and improvements that you missed.

 
The following users thanked this post: cdev

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #8 on: December 15, 2017, 01:21:09 am »
I sent you a PM but you can also refer to the NodeMCU layout which uses the CH340G chip. They're using a 4-pin crystal but note the general placement and routing.

@texaspyro makes some good points but even with my bad eyes I don't find it difficult to place 0603 parts. Of course if you have the room larger is always easier to place and as a side benefit ceramic caps have better characteristics (in general) in larger packages.
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #9 on: December 15, 2017, 03:30:57 pm »
OK, this is a quick stab at your design, It's not 100% complete but pretty close. Here's some notes:

  • Add a bulk capacitor (maybe 100uF) on the output of the 3.3V regulator, I left some room for a 0805 or 1206
  • I added a ground plane on the bottom. This is significantly better than trying to run traces through the board and works well, especially when using through hole parts.
  • I haven't added it yet but I would take away some of the ground plane on the bottom and make a copper pour for 3.3V so it can be fed to where it's needed.
  • You can probably add a copper pour on the top for 3.3V and GND
  • I use Altium so it was quicker for me to import your Eagle file and work in Altium. There's not many connections so I think you could easily just duplicate my work if you like it.
  • When laying out the design start with the most important things.
  •     Place your bypass caps close to the parts and leave room for vias to connect to GND
  •     Plan out you import traces. For your board it's the D+/D- and Tx/Rx
  •     Move components to make traces as best as possible.
  •     Signals that are only used as triggers (like reset) don't be afraid to add vias so route them last

Let me know if you have questions.
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: First PCB - ESP-01 AIO Programmer
« Reply #10 on: December 15, 2017, 04:20:33 pm »
OK, this is a quick stab at your design, It's not 100% complete but pretty close. Here's some notes:

There a couple of minor tweaks to improve the layout.

The blue trace on R2 should be on the red layer... removes a feedthrough.

Run that "REBOOT" trace down below the tact switches and back up to the IO0 signal.  Then the blue trace can be kept on the red layer.

Move those traces that run between the pads of the CH340.  Move left one to the left and down below the CH340 and back up.   The right right one can them be done directly on the red layer.
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #11 on: December 15, 2017, 04:53:23 pm »
@texaspyro saw some things that I didn't see at first which goes to prove that with designs it is ALWAYS better to walk away and then go back to look at it with a fresh set of eyes. This is even more important to do when you are arranging components. It's much easier to move unrouted parts than to have to go back and rip up traces and reroute.

Another tip is to work on your part placement is groups. Look at the schematic and grab all the components for part of the circuit (like the regulator and the caps). Place those outside your board, arranging the components so you'll get a nice layout. Do that for each section and then use those as building blocks to arrange them on the PCB.

 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: First PCB - ESP-01 AIO Programmer
« Reply #12 on: December 15, 2017, 05:14:10 pm »
Looking more gooder...

Move that trace that runs between the pads of the CH340 to the left of the chip and then down (does need space for two traces to the left of the CH340).   That leaves a clear path for routing the 3.3V to the CH340 that isn't blocked by the "flash" trace.  Route the 3.3V up on red to the right of the crystal.  Getting it to the top end of the board would be easiest on the blue side, but with a little work can be done on red (particularly if you can move those parts on the top of the board to the left.
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #13 on: December 15, 2017, 05:15:13 pm »
I think this is going in the right direction. I would still add the copper pours on the top for ground and 3.3V and add more vias between top and bottom. D+/D- isn't great but it will work without any issues even though the controlled impedance will be off.
« Last Edit: December 15, 2017, 05:20:12 pm by GeorgeIoak »
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #14 on: December 15, 2017, 06:39:40 pm »
Wow! Thanks guys. I see you can go through MANY different iterations, and all could function, and I assume, some better than others.

I do like your layouts better than mine, they are a bit neater. I was using the cheater method, so now I see that is not always best.

Now comes a million questions!

The bulk capacitor suggestion, do you think 100uf is really necessary?
How should I actually size a cap requirement in the future?
If I add a bulk capacitor, could I eliminate C5, and put the bulk cap in its place?

I understand the use of a capacitor, but there are SOOOOOO many options. Electrolytic, ceramic, film, etc. I would ASSUME that I could just make the value of C5 bigger, but I just want to check.
Is there a specific material that may be better, or is it based on size requirements?
Also does polarized vs unpolarized matter, or is that just a function of the cap, more than a design?

Thanks a million! this has been super fun and informative!
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #15 on: December 15, 2017, 06:59:19 pm »
The bulk capacitor is there to handle the power if a surge in current happens (like when the ESP activates WiFi). There are only vary rare cases when adding one (or 2) is a bad thing. Yes, there are many choices in capacitors. In most cases a ceramic cap works well. Stay away from Y5V type and only purchase X5R or X7R. Y5V has worse characteristics but the cost savings is not worth using them.

The larger the case size the better (in general) and usually with larger capacitance you pay extra for smaller case sizes. Take your working voltage and double it for the capacitor rating but look at even higher voltage ratings. The cost goes up with higher voltage rating so look at different options and get the higher voltage rating so you can use them on different designs. As an example, if you bought 6.3V rated caps for this project, you probably shouldn't use them on 5V rails so get 16V or 25V and then you'll be covered if you have a 12V project.

Most component datasheets go through design considerations and recommend what should be used.

The 0.1uF caps are there for bypassing, they help eliminate high frequency noise so the function is different than the bulk capacitor we are talking about. As a habit place a 0.1uF cap close to component power pins. There isn't a chip in the world that doesn't like clean power and the cost of those caps are pennies so it's good insurance.

So much can be discussed about caps and different types so just Google and learn but for your design stick with X7R ceramic (as the capacitance gets large you'll have to drop to X5R)
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #16 on: December 15, 2017, 07:29:30 pm »
So, does that capacitor still go to ground and after C5? or is it inline after C5?
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: First PCB - ESP-01 AIO Programmer
« Reply #17 on: December 15, 2017, 07:43:53 pm »
100 uF is probably on the large size.  I'd go with something in the 10-22 uF range.   

Also, remember that the capacitance of ceramic caps can drop considerably as the applied voltage rises.  The effect is more pronounced in smaller form factor caps with a high capacitance per unit of volume.  I've seen 6V 0603 caps "lose" 90% of their effective capacitance when run at 5V.  My standard bypass cap is a 0.47 uF 15V 0805 cap.

When using low-dropout voltage regulators pay close attention to the cap on the regulator output. A lot of LDO regulators can oscillate if you use the wrong value or type of capacitor.  Ceramic SMD caps can have a very low ESR which a lot of regulators don't like.

And finally, when doing a circuit board, learn to despise autorouters!  They invariably produce miserable results.  That said, I've been known to use them and then spend a lot of time cleaning up the results.
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #18 on: December 15, 2017, 08:00:08 pm »
True, 100uF is a little on the high end but I was going for a trade-off for future design requirements and as stated the DC Bias characteristics can easily knock a cap's actual capacitance in 1/2.

SOT-23 isn't the best choice for a linear regulator either, SOT223 gets you more options. Looking at this DigiKey search, https://www.digikey.com/short/qqhrdr, gives some choices but the Diodes Inc, AP2114H-3.3TRG1 is only $0.36 and has 1A capability. Again, not needed here but it would probably work for most of your future projects. The drop out is a little high but no issues when using 5V input. It calls for a 4.7uF on the input and output so you could go with those values or bump it up a little.

Another more popular regulator option is the "1117". Many manufacturers make those in SOT223 or D-PAK. Read through the On Semi datasheet, http://www.onsemi.com/pub/Collateral/NCP1117-D.PDF. It's much better than the AP2114 and it talks about the ESR of the output caps. Notice that it calls out 10Uf on the input/output, with 4.7uF being a minimum.
« Last Edit: December 15, 2017, 08:07:06 pm by GeorgeIoak »
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #19 on: December 15, 2017, 08:01:50 pm »
Yes, the cap goes in parallel to the 0.1uF. You can eliminate the 0.1uF on the input or if you use the regulator I called out change it to a 4.7uF
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #20 on: December 15, 2017, 08:16:21 pm »
I actually put a 1uf cap on the input and output, since the specs for the AP2127N-3.3TRG1 call for a 1uf or greater (without an upper limit). Maybe I will switch that to a 4.7uf, couldn`t hurt.

So the bulk cap goes on the input of the regulator, not the output?

I chose SOT-23, simply for size since AMPS aren't a big deal here. I am pretty sure using a sot-223 would be cheaper even.
« Last Edit: December 15, 2017, 08:20:18 pm by siconic »
 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #21 on: December 16, 2017, 02:12:45 am »
You want to add the additional cap on the output. It's there for when the ESP sucks power. That regualtor is only rated for 300mA and that's on the low side for the ESP. I really would switch to a different regulator and when I checked the regulator you had was not in stock at DigiKey.
 

Offline siconicTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #22 on: December 16, 2017, 02:38:29 am »
You want to add the additional cap on the output. It's there for when the ESP sucks power. That regualtor is only rated for 300mA and that's on the low side for the ESP. I really would switch to a different regulator and when I checked the regulator you had was not in stock at DigiKey.
I have been shopping at Arrow, because they are a little cheaper, and free shipping! But, Digikey is faster, by far.

Sent from my SM-G950U using Tapatalk

 

Offline GeorgeIoak

  • Regular Contributor
  • *
  • Posts: 54
  • Country: us
Re: First PCB - ESP-01 AIO Programmer
« Reply #23 on: December 16, 2017, 01:44:45 pm »
Yeah, Arrow has been pushing hard on the DIY market this market and sometimes has some good deals. I use them and Avnet (and Future) for production orders but you can't beat the inventory at DigiKey and I can use First Class or Priority Mail and 98/100 times I get the package in 2 days. On top of that I can order from them late in the day and still ships same day.
 

Offline texaspyro

  • Super Contributor
  • ***
  • Posts: 1407
Re: First PCB - ESP-01 AIO Programmer
« Reply #24 on: December 16, 2017, 05:25:34 pm »
On top of that I can order from them late in the day and still ships same day.

I once ordered some stuff from Mouser in the morning and it was delivered in the afternoon... but then they are 40 miles from me.  Still, they usually take two days.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf