I am working on designing a pcb that will mount a esp8826 chip (wemos d1 mini) at this point. It will also have a relay which will be activated by the wemos/esp chip and control 120VAC lights. I am trying to make the pcb as concise as possible, but allowing enough room to provide traces on the pcb that are capable of handling the 10-15 amps the relays are rated for. I am planning to use a songle type relay. I want to be able to provide power to the wemos from the incoming 120VAC.
Relay will be similar to these:
Because I am designing the pcb, I thought I could possibly include the components necessary to transform the power from 120VAC the 3.3VDC necessary to run the wemos board. However, I have had a hard time finding the small transformers necessary to do this that can be bought in small quantities for a reasonable price in the US. So, at this point I have settled on a power supply board that I will mount to my PCB through its four connections. Here is a link:
I have also gone back and forth about using the wemos d1 mini and mounting it on my pcb or getting the actual esp8266 chip and whatever else I need for it. I don't need all of the functionality of the wemos mini, and it takes up a lot of space, but I don't know what components would be needed in addition to the esp8826 chip to make it work. So again, I have settled on using the wemos mini board and mounting it to my board.
Next is the relay. I would like to use a stand alone relay, but I am not sure the best way. I know that the wemos i/o pins do not supply the amperage to toggle the relays alone and need some additional components. Some relay boards come with optocouplers and/or transistors to aid the i/o pin in activating the relay. However, this would be another large component that I don't necessarily need on the pcb if I knew the best way to handle it on my own.
Soooo, I guess my question is which of these issues (using already made breakout boards on my pcb) would be easiest to avoid by creating my own circuitry on my pcb to eliminate the use of the breakout boards? I need for any components used to be easily obtainable for a relatively low price in low quantities.
Also, what else am I missing. A couple of things I know I need: A diode across the coil of the relay if I don't use a relay board, the optocoupler/transistor or both for the signal from the wemos to the relay. A pullup/down resistor for my i/o pin. What else?
Here is a very basic version of the wiring diagram I am planning to use. I know I have to add in some features.
That is interesting. That would help give me more room on my pcb. However, when I google it I get different dimensions. Maybe I am not looking at the correct board.
I saw those, and have thought about it, but I need main 120VAC voltage to come in to my pcb as well as be delivered to/from the relay. Do those have an optocoupler/transistor that goes between the i/o pin of the wemos board to the coil of the relay?
If I used it I would need to jumper from the main voltage on my pcb to the main voltage screw terminal on this pcb which is a possibility, but I want it to be done as good as possible.
wow. ok, yes that would be better, but I don't have a way to solder that on my board I don't think. I only have a cheap soldering iron. I assume that would be soldered some other way?
Yes, I left that off, but I definitely will add that in. When I get closer with my pcb design, I will give a better diagram so that y'all can correct my thinking and help me with the placement of such components.
There are minimum component separations required to isolate line voltages from logic. Some cards have actual cutouts in the PCB for better isolation. Designing a compliant PCB is not a job for a newb. BUY a UL APPROVED relay card and use that.
Also, derate your relay to 75% of nominal. You can't use a 10A relay for a 10A load -- no headroom.
PCB says you want to make LOTS of these. After building 6 or so, you need to get the UL paperwork started if you have line voltages in your device. But if the highest voltage is 24v or less, and galvanically isolated, your device is "intrinsically safe". So using a UL power supply (wall wart) WITHOUT line voltages in your box is much safer, and easier to get approvals, than with.
Also, EVERY component in your design needs UL approval for both voltage AND flammability if you're going to sell them, ESP. if line voltages are present.
There is a TON of legal liability if a directly connected to line device fails, buying an already approved item mitigates that risk.
So much more is needed. We had one customer that had a device that went into a regular metal electrical box and was wired as part of a remote light control system. The UL testing lab REQUIRED a production run of 400 devices with all the circuit boards to have serial numbers.
The lab then told the customer the serial numbers of devices they wanted to test. I think they picked 3 or 4 numbers.
So, be prepared!
Better think again if you intend to use the relays you linked to for 10 to 15A.
The 10A may well be written on the relay casing but a $2.00 unit from China will never handle those kinds of loads.
To add, they are likely not rated for mains isolation (and your pcb very likely not also) and I doubt you'll find any spec sheet let alone one that will contradict.
Statistics... they have a program that they input max error, confidence, etc. and the program has to seed against nnn population. Then random units are identified by the software for testing.
Thanks. That makes sense. I only knew the customer canceled the project after placing at least one device to the crowdfinders! People in the know said the problem was all graphic interface design was done by an engineer, not a graphics designer!
Very good info. I am not looking to sell them. I mean if they worked well, and it was a possibility I wouldn’t turn it down, but that’s not my goal as of now. I’m only wanting to use these for personal use plus friends and family. I know nothing about getting it ul approved/certified, but it is interesting to learn about.
Almost all threads I read or have been a part of give warnings of components not being as good as their rating. I understand and agree with that, but what are you supposed to go by if not it’s rating? If it is ul certified, isn’t it ul certified? Honestly, 90 percent of electronics I see come from china. While they get a bad reputation, the good stuff is most likely coming from there too. What are you supposed to believe?
I know I’ll catch flack regardless of how I go about it which is why I encourage the criticism. I think it helps in one way or another. Using multiple ul certified components to make up what I am looking for will more than likely be the easiest route and maybe even the safest. I’m not sure it is the best, but it may be the best I can do for now.
I am more or less looking to build a prototype and will more than likely modify it several times. I am doing it as much for the learning experience as much as anything else. I know I will continue to get the warnings I’m going to blow something up and hopefully that won’t be the case. If you think it is, hang around and correct me before I do something stupid. I don’t mind providing any info and I’m definitely not shy about displaying my stupidity.
A couple of questions:
Does a device (like I’m trying to create) that is being used on a line that is being covered by a 15-20 amp breaker need to have all of its components, traces, wires, etc. have a minimum rating of 15-20 amps? Or, would the fuse/fuses on the device itself be sufficient to protect it…. According to electrical standards.?
Do the relay shields for the wemos d1 minis have an optocoupler and or transistor between the I/o pin and the relay?
What is acceptable width for traces that carry current up to 10 amps?
Fuse your device for what it is expected to carry +20%. Everything should be designed for 2x nominal current for safety.
It's called DERATING. If you run at 99% of spec all the time, the first little glitch will kill your system. You derate to 75% to give you margin in the design. If you need to control 15A, use a 20A relay and #14 wire.
Even if just making a few for friends, you don't want to burn THEIR houses down either. Safe design has margin everywhere. Figure the best, worst and typical cases and make sure it will work if all the tolerances stack up either way.