Hey guys I almost finished my project and I designed it now on a PCB to save all the wires. I am still an amateur though and would be happy just to ask you if everything is right or you think I should change / improve something. The first picture is the sketch I drew, the second one I got from the software I used. It is way less prettier than what I planned to give you but that's the only thing I can get, I hope you can understand from that.
On the PCB picture - two lines that cross each other are connected only if they have a turkiz spot on them.
Do you guys think that's ok and I can send it to fabrication ?
Is it ok if the capacitor connected only to one side of the GND of the DFPlayer (which has two GND connections) ? should I connect the other GND also to the capacitor ? to a different capacitor ? I would've just check that through experiments but this evil DFPlayer just doesn't play normally when it's being powered through a MOSFET through cables
All of the buttons and leds on the right side will be connected separately on a different PCB and will be grounded through the "Top GND" connection on the right side. I power the Potentiometer from the Arduino's Tx pin in order to save battery life when the Arduino is asleep. The Diode between pin 11 and the Rx pin of the DFPlayer is there in order to prevent phantom powering
Can you describe what this design is intended to do? List all its features. What PCB software are you using and why do you only have a black/white board print out? Any PCB software should allow you to have top and bottom layers, and silk screen layers at different colors for easy understanding.
Ok I am such a fool, I missed the "full color" button. I have no idea how I thought you would understand something from that. Sorry for that.
So the function should be the following - it should basically play an audio file from the DFPlayer which can read and play MP3 files. I high switch it through a MOSFET and a BJP (pin 8) to save power consumption. Pins 2-4 are buttons to control it (one to wake the arduino up, one to play a file and one to stop and continue) . Pins 5-7 are connected to a RGB led to give back feedback. All of the buttons and the led will be mounted on a different PCB, here are just the connections. Pin 9 is connected to the busy pin of the DFPlayer to get some information. Pins 10-11 are the Tx & Rx pins. I connected the Rx of the DFPlayer and the Tx pin of the Arduino through a diode to prevent phantom powering (it reduces the current consumption by 3mA). Pin 12 changes the directory from which the DFPlayer plays the file. A0 is connected to a Potentiometer to control the volume and A1 to the battery to read the voltage.
I connected a capacitor between the + and GND of the player after recommendation here and because it doesn't work well at all without it. Did I connect it right though ? Is it ok if the second GND of the player goes straight to GND without passing through a capacitor also ?
Paul__B Thank you, I am going to read about it now
The arduino side of schematics has a TX but it's connected to a potentiometer. Not sure what that means.
All your traces are thin, maybe a default 0.01" or less. For power wires you should use as thick as you can route. Add ground planes too.
Can I suggest you make your tracks 4 or 5 times wider where possible, you have lots of room and this will make sure you have good conduction.
Your ground tracks should especially be a wide as possible.
Are you going to make the PCB yourself or get it made elsewhere like PCBWAY or JLCPCB?
I don't see a power LED, which would be advise able to indicate that power is applied.
My philosophy about PCB design is this.
You have purchased a blank PCB, loaded with copper.
You are paying someone to remove that copper, which you purchased.
They are not giving you a discount for the copper they reclaim.
You have plenty of room so keep YOUR copper and use it to help provide strong solder points and good current carrying capacity.
But unless they have a a clear purpose, can just be a nuisance on many modules.
I'm not so sure. Why do you want to know that power is applied? In the final design, would it not be obvious that the device is operating?
Not if the Op has the sound module switched off.
If the Op uses one of the three LEDs as an indicator then okay.
Another idea would be to briefly periodically flash the controller on board LED.
Thanbk you guys so much I am going to widen the routes and add ground fills now
SteveMann Do you mean the bottom right corner ? if yeah, that's the DFPlayer which can read and play MP3 files. This is also the main purpose of it the board, to play different audio files when the user presses on different buttons (which will be mounted on a different PCB. The PCBs are connected through the connections on the top right side and the GND connection on the bottom left ("Top GND")
The software I am using to design it is EasyEDA which belongs, I think, to JLCPCB
larryd The leds (and the buttons) will be mounted on a different PCB (it's going to be placed on a different location, around 70mm vertical distance) so the mounting holes and the resistors will be places there.
About the power led, the PCB is going to be inside a box which I 3D print so it will not be seen. On my design the Arduino and DFPlayer are active only when the DFPlayer plays, so basically I know it works because it plays.
I am using the MOSFET IRF9530
I plan to use 4 rechargeable AA Ni-MH batteries (1.2V each)
A1 is connected to Vcc to read the voltage so I can make a red light when the batteries need to be charged
From Tx of the arduino I power the Potentiometer (basically I use it as pin number 1). When I connect the Potentiometer straight to Vcc is drains 0.5mA and I want to save it.
I know it's a bad answer but the only reason the FTDI pads on the PCB is because that's the footprint I found a while ago. I just sticked with it since then and didn't think much about that. I don't remember how hard I searched a version without it. Thank you for bringing that back to my mind, I will search a version without it today.
liuzengqiang see my answer to larryd
TomGeorge I am going to make it though JLCPCB. Thank you, I will widen the tracks. About the power led see my answer to larryd
If i can give you some suggestions ... your mosfet is NOT a logic-level model, with less than 10V of VGS it does not work correctly (remains in linear zone) ... for power the system with only 4.8V (and probably using less of them in the system) you need to use a mosfet that is not only logic-level type, but also with the lowest VGSth possible ... also, with the lowest RdsON possible, for minimize voltage drop on the mosfet (that anyway depend from the current that circulate in your mosfet) ...
Probably an NDP6020P, or another similar model, will work much better for your type of application, this one can work also with 3 or less volt on gate (some other models will work also with less than 2V, but are much more high cost and mainly N-Channel, unfortunately there is less choice for P-channel ones)
Also, a little better disposition of components and the use of SMD ones will improve your PCB (small and better arranged) ... what is that round space in the middle ? ... placeholder for speaker magnet ?
Also, leds MUST have resistors in series (referring to schematic diagram), NEVER connect leds directly on logic pins ... electrolytic capacitor, better use 2 or 3 of them in different places instead a single big one, and always place a 100n in parallel to any electrolitic for better filtering (big electrolytics does not filter too well high-frequency disturbs) ... buttons, always place a 100n capacitor from pin to GND (and a pullup resistor if you do not activate internal ones) for debounce them ...
No ground pins for the LEDs or the buttons (probably easiest to give them their own GND pin - so you can make a single connector for three LEDs and the GND that goes with it; same for the buttons).
I don't see the use of a wake up button; the other buttons can double as wake up. What does the Arduino have to do after pressing the wake up button, other than waking up?
There's a diode in the Rx - presumably to allow the DF player to be powered down with the Arduino asleep. I don't see a pull-down resistor on the DF Player side to allow for low level signal on the Rx line.
A power LED on this board should not be necessary considering the Pro Mini has one already - which you probably want to remove when running on battery power anyway.
I don't see the use of that NPN transistor. The Arduino can drive the MOSFET gate directly.
Why is there a pot on the Arduino's Tx pin?
electrolytic capacitor, better use 2 or 3 of them in different places instead a single big one, and always place a 100n in parallel to any electrolitic for better filtering (big electrolytics does not filter too well high-frequency disturbs) ... buttons, always place a 100n capacitor from pin to GND (and a pullup resistor if you do not activate internal ones) for debounce them ...
Generally that's absolutely the case, but in the OPs case the electrolytic cap is specifically to support the DF Player (it doesn't make sense to have multiples - it's also a small board), and the ceramic bypass caps are present on the DF Player and Arduino boards already so no need to add more on the PCB.
That cap at 4,700 µF is pretty much oversized, 470µF should be more than enough for this purpose.
Thank you guys so much for your answers, I really learn from them. I added my modified PCB (I still didn't read the post you send about the measurement of Vcc, larryd, I am gonna do it now). The width of the tracks is now 1mm (isn't it's too much ?) and the clearance of the ground fill is 0.7mm. I also removed the FTDI holes.
Etemenanki I had a lot of problems while making my experiments on the bread board, maybe it's because of the MOSFET ? but I thought it's a logic one. The data sheet says that the threshold voltage is between 2V-4V but maybe I don't read it correctly. How can one learn from the datasheet that Vg needs to be around 10V for the MOSFET to be saturated ? sorry but I just can't figure that out.
Thank you for the recommendations, my neighborhood's store sells it and I just ordered it.
I think my components have to be mounted through holes because I am just learning how to solder and I will definitely not manage to solder them myself. I think that JLCPCB offers that service but I never looked at that, I will check that out.
Ohh about the leds in the schematic I am soo sorry, I just saw that, I forgot to add the resistors. I have 3 resistors of 200 Ohm in series with them. Sorry.
About the capacitors, I think that wvmarle is right here, the capacitor is there only to support the DFPlayer. If you still think it's bad I will consider that option though.
larryd Thank you. I will add the mounting holes at the end, I am going to think about how I mount it on the case after I finish the design of the PCB (because the design of the case kind of depends on the PCB).
I know that a power led is very comfortable but I don't need it for this board. When the Arduino is active the DFPlayer plays and the user knows it's active. When it doesn't play it sleeps. Power led is superfluous here
wvmarle The leds and buttons will be mounted on a different PCB, that's why I just have the holes here on the right side. Both PCBs will be connected via wires when I mount them.
About the wake up button, I had a problem when I tried to mix it with a different button. I tried it after a while again and had that same problem. Unfortunately I really don't remember what happend but I'll experiment with it again in the following days. For your question, after it wakes up it controls the DFPlayer - changing the volume through a Potentiometer and stopping (and continuing) the file through the third button.
about the BJP, I tried to remove it and it didn't work well but maybe it's just because the MOSFET doesn't fit for that. Same story with the huge capacitor. I will try that again soon with the new MOSFET I ordered.
About the diode, exactly. But I'm afraid I don't understand your suggestion. Are you saying I should add a pull down resistor between on the Rx pin of the DFPlayer ? wouldn't it ruin the signals the arduino sends ?
... The data sheet says that the threshold voltage is between 2V-4V ...
Datasheets are usually written from peoples that think that only electronic engineers will read them (and sometimes also electronic engineers have troubles "decrypting" some of them) ... almost never well written
But yes, threshold voltage is indicated as 2-4V, but this is the point where it "just start" to conduct ... mosfet are, said in simple way, sort of voltage-controlled variable resistors ... where they "start" to work, their resistance is still high ... you need to use it as a switch, in the full conduction zone where RdsON is the lowest possible, but not all the time this is mentioned clearly ... 10V is simply the value for the most part of the non-logic-level mosfet have full-on state ...
See a datasheet, if the RdsON is indicated only for VGS=10V, then is decisely NOT a logic-level one, regardless from VGSth indication ... if is indicated also at least for VGS = 4.5V, that usually means that is a logic-level and can work good with 5V circuits ... if (like the datasheet of the NDP6020P as example) is indicated also for lower VGS, this means that can work also for 3.3V or lower logics ...
Another thing to check is VGSS, the "maximum" voltage that you can apply to gate referred to source ... in that mosfet is 8V "absolute maximum", that means that is always better to never give it more than 6V (can also resist to 8, but a little bit over and POOF, mosfet kaputt) ... so if the gate is drived from 5V logics is all ok, otherwise need to protect the gate with a 6V zener from Gate to Source ...