EAGLE lay out checking

Wawa: An Arduino pin can directly drive the opto LED of an SSR. No need to use a transistor. Don't use a resistor in series with the opto LED if the SSR already has one (most do).

You mention "Boiler". When I read that, I think of a 10-20Amp load. The relays you are planning to use can only switch 1-2Amp.

My supplier stocks the FSS1-102Z 5volt. Many cheap G3MB-202P 5volt on ebay. Seems the same footprint as on your layout. Leo..

We used normal relay for prototype and arduino could not activate the relay probably maximum output current of digital output was not enough for our relay. But i checked the datasheet of G3MB-202P DC5 activating current is 11.36 mA and digital output current of arduino is up to 40mA. So you are right i dont need to use transistor. But i dont think i am using resistor series with the opto LED. There is one there for transistor sorry if i misunderstand. For boiler i dont know the exact current which is going through from that link but there is always a thermostat connection in boilers to open/close boiler from thermostat. I also checked the circuits of other thermostats and they are using even smaller relays. I think it is working with a small current.

You are connecting the TX pin of the ATmega (5V) directly to the ESP (3.3V). Use a level shifter, or you'll fry something.

And 1-2A seems really low for a boiler, that's only 240-480W, or half of that if you're living in the US.

Why was the "3.3V/16MHz out of spec" struck out? It is clearly out of spec per the speed chart of the datasheet.
Approx 3.78V is needed to be fully in spec at 16 MHz.

CrossRoads: Why was the "3.3V/16MHz out of spec" struck out? It is clearly out of spec per the speed chart of the datasheet. Approx 3.78V is needed to be fully in spec at 16 MHz.

Because he's running it at 5V, the 3.3V regulator is for the ESP only.

PieterP: You are connecting the TX pin of the ATmega (5V) directly to the ESP (3.3V). Use a level shifter, or you'll fry something.

And 1-2A seems really low for a boiler, that's only 240-480W, or half of that if you're living in the US.

Actually there is no 5v trace which is connecting to the ESP. There are 6 connections for esp8266 one ground 2 digital pin and 2 3.3v supply and last one is transistor circuit to reset esp and it also allows to pass 3.3v to esp.

caneradiyaman6: Actually there is no 5v trace which is connecting to the ESP. There are 6 connections for esp8266 one ground 2 digital pin and 2 3.3v supply and last one is transistor circuit to reset esp and it also allows to pass 3.3v to esp.

Both your schematic and your board file show that the RX pin of the ESP is connected directly to pin D9 of the ATmega, which runs at 5V.

Also many people suggest that you use a resistor (3K3 - 10K) between CH_PD and Vcc. (Of the ESP).

Is there any particular reason why you are using a PNP transistor for the reset pin? A NPN would seem more logical, since you have to constantly keep the PNP open (i.e. have current flowing from emitter to base) to prevent the ESP from resetting. An NPN in this situation only has to be opened while resetting. On top of that, PNP transistors are a bit more expensive, something to keep in mind if you were to sell this board commercially (in large quantities).

PieterP: Both your schematic and your board file show that the RX pin of the ESP is connected directly to pin D9 of the ATmega, which runs at 5V.

Also many people suggest that you use a resistor (3K3 - 10K) between CH_PD and Vcc. (Of the ESP).

Is there any particular reason why you are using a PNP transistor for the reset pin? A NPN would seem more logical, since you have to constantly keep the PNP open (i.e. have current flowing from emitter to base) to prevent the ESP from resetting. An NPN in this situation only has to be opened while resetting. On top of that, PNP transistors are a bit more expensive, something to keep in mind if you were to sell this board commercially (in large quantities).

--Yes you are right :/ What do you suggest to solve this problem? How can i create digital 3.3v outputs from digital arduino pins ? using regulator is a solution for this ? I mean if i use two more regulator it will cost a lot i think there must be a easier way ? --Also for PNP transistor ESP resets itself when there is ground coonection on reset pin of ESP8266. So transistor will stay closed for normal time and it will be open to reset it for a short time. If i am not wrong PNP looks more logical to me and again it would be wrong please tell me if it is :D --i will add a resistor there thank you! --and last question "The difference is that the nano is a 5V board, so it runs straight off of the 5V provided by the USB connection. If you want to use the onboard 5V voltage regulator (via the Vin pin) you need at least 7V as well. This board seems to run @3.3V, so you'll need a LDO (Low DropOut) voltage regulator like the 1117 3.3v to go from 5V to 3.3V."

I couldnt understand the difference between arduino nano and my board because i used exactly same layout and schematic for nano. I also run my board with 5v usb connection there should not be any difference. please tell me if i am wrong.

caneradiyaman6:
–Yes you are right :confused: What do you suggest to solve this problem? How can i create digital 3.3v outputs from digital arduino pins ? using regulator is a solution for this ? I mean if i use two more regulator it will cost a lot i think there must be a easier way ?

A voltage regulator on a data line? Bad idea. Just use a voltage divider (20K / 10K, or 18K / 10K if you want E12 values).

caneradiyaman6:
–Also for PNP transistor ESP resets itself when there is ground coonection on reset pin of ESP8266. So transistor will stay closed for normal time and it will be open to reset it for a short time. If i am not wrong PNP looks more logical to me and again it would be wrong please tell me if it is :smiley:

I think that’s wrong: a PNP transistor conducts when its base is at a lower potential than the emitter.
This means that it is closed when there’s 5v on its base and 3.3v on the emitter. (Logical 1 on base). When it’s closed, the reset pin will be at ground potential, so the ESP will reset. In this state, virtually no current is flowing through the transistor.

If the base is at 0v (logical 0), current will flow from the emitter, that is at a higher potential (3.3v) to the base, causing the transistor to conduct. When the transistor conducts, the reset pin is at 3.3V, meaning that the ESP will not reset.
However, current is flowing through the transistor, through the resistor at the collector, and through the ATmega’s I/O pin.

If you use an NPN transistor, the ESP will also reset on a logical 1, and run normally on logical 0, but the difference is that no current flows in normal operation, only while resetting.

It’s not that important in this case, but I just didn’t expect a PNP here, an NPN seems much more logical.
[/quote]

caneradiyaman6:
–and last question
“The difference is that the nano is a 5V board, so it runs straight off of the 5V provided by the USB connection. If you want to use the onboard 5V voltage regulator (via the Vin pin) you need at least 7V as well.
This board seems to run @3.3V, so you’ll need a LDO (Low DropOut) voltage regulator like the 1117 3.3v to go from 5V to 3.3V.”

I couldnt understand the difference between arduino nano and my board because i used exactly same layout and schematic for nano. I also run my board with 5v usb connection there should not be any difference. please tell me if i am wrong.

The difference is that the Nano has an extra 5V voltage regulator for input voltages that are higher than 5V.

This voltage regulator has a voltage drop of ~2V, so the minimum voltage input is 7V (5+2).
It doesn’t matter in your design, since you’re always using USB power, so there’s no need for a 5V voltage regulator.

Thank you for your voltage divider suggestion i will use it also i will change pnp to npn transistor which looks more logical. It is also cheaper.

PieterP: The difference is that the Nano has an extra 5V voltage regulator for input voltages that are higher than 5V.

This voltage regulator has a voltage drop of ~2V, so the minimum voltage input is 7V (5+2). It doesn't matter in your design, since you're always using USB power, so there's no need for a 5V voltage regulator.

As i know also nano is using just USB power ? How can i supply it with min 7V there is just a USB port on it.

Just take a look at the original schematic on the product page. It has a UA7805 in the bottom left corner.

Oh i was thinking about what the heck is this VIN. Now i figured out thank you. Okay i will not use that regulator i dont need it. But is output of every usb 5V ? Because i measured one before and i got 5.3V from it. Is this why i am using MBR0520LT1 ?

USB and voltage regulators are usually within 5% (4.75volt - 5.25volt). Perfectly ok for digital circuits. 4 to 5.5volt would still be ok. Unless you measure voltages with the A/D, but then you should use the internal 1.1volt bandgap Aref anyway. Leo..

Now the only thing in my mind is avoiding from EMI in my circuit. I know the place of my decoupling capacitors are far from their pins. I will move them closer and they will be in the same side of board with their components and i will not use any via near to them because my both planes are ground plane. So is that sufficient to avoid from EMI ? we are using these capacitors just after the regulators, just after the power port(after usb port for me) and just before power pins of components right ? In my circuit there are two capacitors before 5v input pin of atmega. Do i also need to add these decoupling capacitors before input voltage pins of ESP8266 and 433Mhz RF module ? Esp8266 is supplied from 3.3v voltage regulator and i already used decoupling capacitors for regulator. Do i need to put them just before Esp input voltage pin like atmega ? Same question for 433mhz rf module it is supplied with 5 volt and rf power of it is 20.5 dBm. This EMI questions were about PCB design. However in this board esp8266 and 433mhz rf module are in the same board. Is there any tips for preventing EMI may cause from this radiation effect ? For example should i move them different corners of pcb ?

The design guidelines for the LM3940 are in the datasheet:

10.1 Layout Guidelines For best overall performance, place all the circuit components on the same side of the circuit board and as near as practical to the respective LDO pin connections. Place ground return connections to the input and output capacitor, and to the LDO ground pin as close to each other as possible, connected by a wide, component-side, copper surface. The use of vias and long traces to create LDO circuit connections is strongly discouraged and negatively affects system performance. This grounding and layout scheme minimizes inductive parasitic, and thereby reduces load-current transients, minimizes noise, and increases circuit stability. A ground reference plane is also recommended and is either embedded in the PCB itself or located on the bottom side of the PCB opposite the components. This reference plane serves to assure accuracy of the output voltage, shield noise, and behaves similar to a thermal plane to spread heat from the LDO device. In most applications, this ground plane is necessary to meet thermal requirements.

C5 is way too far from U4, and you're using 2 vias between them, which is not recommended. The purpose of C5 is to stabilize the output of U4, and to improve the load-transient response. Read more here. The PCB traces between the microcontrollers and the voltage regulator have some parasitic inductance, and so do all capacitors (especially large ones). As you may or may not know, an inductor resists sudden changes in current. This means that if the microcontroller suddenly draws more current (because of rapid switching inside, on its I/O, RF transmission ... ) the voltage will drop. To overcome this, a small capacitor with a low ESL (Equivalent Series Inductance) and a low ESR (Equivalent Series Resistance) to quickly supply the necessary current. If this capacitor is too far from the microcontroller, the parasitic inductance of the PCB traces (or wires) will render the capacitor completely useless. Edit: I was only talking about the station, check for these things in the receiver as well.

Take a look at this video if you want to know more.

So in conclusion, move C5 closer to U4 and add a small bypass capacitor as close as possible to the ESP, and maybe add one to the FTDI chip as well (If it's too far from C3). I can't seem to find C3 in the .brd file, but make sure that it is as close to the ATmega and the FTDI chip as possible.

Also, are you aware of the fact that the Vcc pin of your DS18B20 is connected to ground?

To prevent EMI, use a snubber snubber circuit with your relay (if it's not built-in already), and locate it as far as possible from the other electronics.

As a side note, make sure you have thick traces from the relay to the connector, and enough clearance from other traces and the ground plane. Overheating or sparking traces are really dangerous. I hope you're adding in a fuse as well?