You need to use EasyEDA editor to create some projects before publishing
NodeMCU 4ch relay Advice
1082 23
jasemilly 4 years ago
Hi I have designed a 4ch relay for myself, and was hoping someone could give it a check, I have tried to figure this out as I go and is the most electronics design I have ever done. I would like to create a 4ch relay controlled by a NodeMCU on one PCB.  The relays will operate garden LED lights It will have 2 manual switches and respond to HTTP Post To keep things tidy I gathers all the neutrals together and one Live input that is on the COM for the relay. Just feeling a little unsure before I move on to the next step. [my project](https://easyeda.com/editor#id=31e23b2043944c43a92dcb4a56a37fbf|16e05485f4ea4dfba76c96a0a25a5f2c) Thanks for advice. Jasonmilly
Comments
andyfierman 4 years ago
**Your project has mains voltages on it and therefore carries lethal voltages.** You have given no indication of your local mains voltage. Whatever it is you **must** read this: [https://www.frontdoor.biz/HowToPCB/HowToPCB-extra/CreepageandClearance.pdf](https://www.frontdoor.biz/HowToPCB/HowToPCB-extra/CreepageandClearance.pdf) before proceeding any further.
Reply
andyfierman 4 years ago
You must also check your PCB trace widths vs. current in them. For information about PCB trace widths vs. copper thickness, current and temperature rise, there are a number of online calculators available, based on the graphs that @cjohnson kindly uploaded in his reply to this post: [https://easyeda.com/forum/topic/PCB-high-current-thermal-design-562f7a69a7ad41a38b18ea150d6703ed](https://easyeda.com/forum/topic/PCB-high-current-thermal-design-562f7a69a7ad41a38b18ea150d6703ed). For example: [https://www.7pcb.com/trace-width-calculator.php](https://www.7pcb.com/trace-width-calculator.php) [https://www.4pcb.com/trace-width-calculator.html](https://www.4pcb.com/trace-width-calculator.html) [https://www.desmith.net/NMdS/Electronics/TraceWidth.html](https://www.desmith.net/NMdS/Electronics/TraceWidth.html) [https://www.smps.us/pcb-calculator.html](https://www.smps.us/pcb-calculator.html)
Reply
andyfierman 4 years ago
You have no decoupling capacitors especially around the 7805 regulator. Please read the datasheet for this device: [https://www.ti.com/lit/ds/symlink/lm340.pdf?ts=1604208113818&ref_url=https%3A%2F%2Fwww.google.com%2F](https://www.ti.com/lit/ds/symlink/lm340.pdf?ts=1604208113818&ref_url=https%253A%252F%252Fwww.google.com%252F) and study: [https://easyeda.com/forum/topic/UPDATED-Power-supply-decoupling-and-why-it-matters-30a39d0a77f34d5d8dc77e37c035b3d3](https://easyeda.com/forum/topic/UPDATED-Power-supply-decoupling-and-why-it-matters-30a39d0a77f34d5d8dc77e37c035b3d3)
Reply
andyfierman 4 years ago
Apart from the necessary creepage and clearance distancing required for the mains voltages, your component placement is unnecessarily widely spaced. Particularly since you have a 2.4GHz WiFi module on the board this is a bad plan as it increases the chances of interference messing up the operation of your board. Please see this post: [https://easyeda.com/forum/topic/transmitter-e57e2dbbaa28498e9054648abeacbacd](https://easyeda.com/forum/topic/transmitter-e57e2dbbaa28498e9054648abeacbacd)
Reply
andyfierman 4 years ago
1\. The idea of using the LEDs in series with the bases of the 2N2222 transistors is OK but the way you have done it\, the transistors are not properly turned off\. Add a 10k resistor in parallel with each (LED + 1k series resistor) pair so that when the NodeMCU output pulls low, it pulls the transistor base to ground through the 10k. 2\. Ground all the ground pins of the NodeMCU module\.
Reply
mrtom528 4 years ago
There are just too many errors to list to be honest. In addition to andyfiermans observations, several tracks in the PCB just don't connect to anything, they are close but don't actually physically connect to the components, the transistors are a good example... ![Track_Connect_01.png](//image.easyeda.com/pullimage/WLMHDeCA4ZnGoIFb7ESwGY9FUy9ISpirlaeZjLi9.png) The dead giveaway is that the NET names don't match\, no match\, no connection\. Q1\_1 \-\-\> Q1\_1 \-\-\> Q1\_2? The power from the regulator looks like it is intended for the -5V of the relays? That's if they were connected. Just hover over the power track near your flyback diodes to see what else is highlighted...both sides of those diodes? I don't want to sound too down on this but it really does need some attention. Regards.
Reply
andyfierman 4 years ago
Use the Design Manager to check your work: ![image.png](//image.easyeda.com/pullimage/27quTjrx3qFyCsCKYtLlB6hAAxidmcyCgMB1Qm9u.png) I think you need to stop what you are doing and carefully read: [https://easyeda\.com/andyfierman/Welcome\_to\_EasyEDA\-31e1288f882e49e582699b8eb7fe9b1f](https://easyeda.com/andyfierman/Welcome_to_EasyEDA-31e1288f882e49e582699b8eb7fe9b1f) and all the documents that it links to.
Reply
jasemilly 4 years ago
thank you both for taking the time to look help, I suspected I had things wrong but no idea in what why, I will take the time to study the links thanks
Reply
mrtom528 4 years ago
No worries. Don't get too despondent, you're off to a good start, it just needs a good going over.....ya know? Follow the links given, adjust your schematic, (this is the most important part, without it your PCB is dead in the water), and you'll find the PCB layout much easier to work with. Regards.
Reply
Markus_ee 4 years ago
Hi jasemilly! Here are a few projects of mine that are meant for high voltage electronics: [https://easyeda\.com/markus\_jidoka/400v\_geiger\_tube\_psu\_v1\-0](https://easyeda.com/markus_jidoka/400v_geiger_tube_psu_v1-0) [https://easyeda.com/markus_jidoka/muon-detector](https://easyeda.com/markus_jidoka/muon-detector) [https://easyeda.com/markus_jidoka/garage](https://easyeda.com/markus_jidoka/garage) Take a carefull example from these projects and observe how the mains voltage or high voltage DC is routed and isolated in relations from the rest of of the low voltage areas of the PCB. Plus, do read the links that Andy has posted here. Never play with mains voltage without knowing the basics of how to wire and design mains circuits safely so that it does not kill you or burn your house down. One example of isolation distance mistakes are marked with orange: ![live.jpg](//image.easyeda.com/pullimage/rNiCc0bozoeV9yAvfrtZ3IpbrlMfE5sKLfmwDR9v.jpeg) Regards, Markus Virtanen HW / Electronics Designer
Reply
Markus_ee 4 years ago
Hello! I forgot, never use 2.54mm terminal blocks when wiring mains voltages. You need to use 5.08mm terminal blocks instead. -Markus
Reply
jasemilly 4 years ago
@markus_jidoka Thank you for you suggestions,  working through everyone's comments at the moment
Reply
jasemilly 4 years ago
I have tided up my schematic added decoupling around the 7805 regulator I am trying to change a single terminal header from 2.54mm to 5.08mm but I cant see it to select.  This is for the Live 240 input. once I am happy with the schematic, I will look further at track width and component placement to reduce the RF interference, trying to break it down into indvidual steps.  Thanks everyone again. [https://easyeda\.com/editor\#id=\|31e23b2043944c43a92dcb4a56a37fbf\|16e05485f4ea4dfba76c96a0a25a5f2c](https://easyeda.com/editor#id=|31e23b2043944c43a92dcb4a56a37fbf|16e05485f4ea4dfba76c96a0a25a5f2c) ![image.png](//image.easyeda.com/pullimage/eFHgsA1ay1Iyo787ZUWMZnKBhbeWc1oR2jxGFPlK.png)
Reply
andyfierman 4 years ago
@jasemilly, ![image.png](//image.easyeda.com/pullimage/S8qtZXoBiK1utLV8GTVX2JuTxynRbgVQSDlfH0ur.png)
Reply
jasemilly 4 years ago
@andyfierman does a single pin version exist, these are 2/3 pin connectors? thanks
Reply
andyfierman 4 years ago
@jasemilly, Think that one through... How can you have a single pin connector with a 5mm pin spacing? :)
Reply
Markus_ee 4 years ago
Hi jasemilly! I suggest visiting this page from LCSC: [https://lcsc.com/products/Screw-terminal_11140.html](https://lcsc.com/products/Screw-terminal_11140.html) There are alot of connectors with 5.08mm spacing. Having a single pin connector is not really practical. However, there is one on that page: [https://lcsc\.com/product\-detail/Pluggable\-System\-Terminal\-Block\_METZ\-CONNECT\-GmbH\-360273\_C123245\.html](https://lcsc.com/product-detail/Pluggable-System-Terminal-Block_METZ-CONNECT-GmbH-360273_C123245.html) Unfortunately, this is not insulated, just bare metal. So, if we are referring to the input of the live and neutral connectors then I suggest to combine them. This means that you need 5-pin screw terminal. Or even 6-pin screw terminal for more safety. 4 pins neutral, 1 pin not connected and the last remaining pin is live. [https://lcsc\.com/product\-detail/Pluggable\-System\-Terminal\-Block\_Dinkle\-EK508V\-06P\_C182809\.html](https://lcsc.com/product-detail/Pluggable-System-Terminal-Block_Dinkle-EK508V-06P_C182809.html) Hopefully this helps your project going forwards :-)
Reply
jasemilly 4 years ago
@markus_jidoka thanks for the suggestion I like the 6 pin idea!!
Reply
jasemilly 4 years ago
@andyfierman I have followed suggestions and have improved things. > 1\. The idea of using the LEDs in series with the bases of the 2N2222 transistors is OK but the way you have done it\, the transistors are not properly turned off\. > Add a 10k resistor in parallel with each (LED + 1k series resistor) pair so that when the NodeMCU output pulls low, it pulls the transistor base to ground through the 10k. On relay D6 the one at the bottom of the schematic I have implemented what I think you mean, is this correct.  I will alter the other relays to follow. [project](https://easyeda.com/editor#id=|31e23b2043944c43a92dcb4a56a37fbf|f3bf5723da7343a79897576897559681)<br> <br> You also have mention RF interference I have altered layout and moved the nodemcu so the antenna is over edge of the board.  I also intend to solder headers onto the PCB the Nodemcu will be slotted into.  I am thinking this will help with the reduction of RF?  Thanks for all help
Reply
Markus_ee 4 years ago
Hi jasemilly! There are still alot of design mistakes: 1) You can't put DC ground anywhere near the relay common pin (0VDC - 230VAC) ![image.png](//image.easyeda.com/pullimage/iA45Iutt4GEFydEBU7u9ge2lxiQlwp8PXDTeFUmA.png) 2) Q1 has trace going into pin1, that is too close to pin2. This same pattern repeats itself in all transistors ![image.png](//image.easyeda.com/pullimage/k6GnOKpfGDc2S9NZf32ufstA0JGxtcqgeN1hBjGh.png) 3) C2, whats up with that? <br> k ![image.png](//image.easyeda.com/pullimage/YLV9IasJbsGwpJjzsGii9s4YVnIueY3xGfHOENZ4.png) 4) P2 -> R2 ![image.png](//image.easyeda.com/pullimage/0nBNIgrzJ2rOulYkX3aaPRXRR7vh1zHRoLvYZhFx.png) 5) D5 dataline is too close to the pins ![image.png](//image.easyeda.com/pullimage/yfo9vvLjZB7nMN6ImqH4azCaP1aeUtXTWkvdMVmS.png) Well, these are at least what i can find quickly, alot to fix.... -Markus
Reply
Markus_ee 4 years ago
Hi! my mistake, is was P2 - R6 in section 4 ![image.png](//image.easyeda.com/pullimage/aNfCfTnhFkrEihZDP92QZvJG3ysyA3nX2HnIYzxY.png) -Markus
Reply
jasemilly 3 years ago
Things coming on slowly, I have created I have tried to create another nodemcu without the screw holes as Intend to have headers for the pins.  how do I swop it over with the nodemcu from the schematic? I have tried a few times and I loose the track lines & connections. If I import changes everything reverts back to the schematic and I rebuild the tracks and the copper pour?? Thanks for all feedback and a happy new year. [https://easyeda\.com/editor\#id=\|31e23b2043944c43a92dcb4a56a37fbf\|f3bf5723da7343a79897576897559681](https://easyeda.com/editor#id=|31e23b2043944c43a92dcb4a56a37fbf|f3bf5723da7343a79897576897559681)
Reply
andyfierman 3 years ago
Don't try to make changes to footprints or connectivity directly in the PCB Editor: [https://easyeda\.com/forum/topic/The\_best\_way\_to\_design\_a\_PCB\_in\_EasyEDA\-ThR3pwqIC](https://easyeda.com/forum/topic/The_best_way_to_design_a_PCB_in_EasyEDA-ThR3pwqIC)<br> <br> Change the Footprint assigned to the symbol for U1 (the nodemcu) **in the schematic** from: ESP12E_DEVKIT-V1 to: ESP12E_DEVKIT-V1 NO HOLES using the Footprint Manager. Then do **Update PCB...** BTW, you must edit the prefix for to be **U?** and not just **?**.
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,建议访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice