0
\$\begingroup\$

I am trying to build a small circuit using an ESP8288-12E, 4 5V relays and a 74HC595 shift register as the main components. To power the whole circuit I am using a Hi Link HLK 5M05 5V/5W switch power supply module.

Here is how I planned the whole circuit:

enter image description here

If it is difficult to see in this image then I can provide PDF as well.

I took this AMS1117-3.3 to get 3.3V from my 5V power supply. Instead of 3.3C, I am getting 4.2V on my PCB. I am not sure why this is happening.

I am attaching my EasyEDA file for the PCB design also.

enter image description here

One more issue I am facing is that when i take my multi-meter probes near to the circuit the relays are triggering automatically. I didn't connect the ESP8266-12E on the PCB yet, as I am not getting proper voltage on ESP8266-12E VCC pin.

Any suggestions, why this issue might be happening? Any suggestions will be helpful!

If someone wants to have an EasyEDA access I can provide for this project so can visualize the same issue more easily.

https://oshwlab.com/nehul.splendit/shift-resistor-sn74hc595-with-4-channel-relay

Here is the link of the same project.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Is it a two layer PCB with no ground plane? \$\endgroup\$
    – Andy aka
    Dec 25, 2020 at 10:00
  • 1
    \$\begingroup\$ That's an incredibly poor layout. For all we know that regulator is oscillating. \$\endgroup\$ Dec 25, 2020 at 10:12
  • 2
    \$\begingroup\$ Layout isn't just bad, mains voltage insulation distances are violated so this could be deadly, or fry the PC serial port used to program the ESP... \$\endgroup\$
    – bobflux
    Dec 25, 2020 at 10:41
  • 2
    \$\begingroup\$ @user3201500 Oscillation means it's unstable, you'd need a oscilloscope to verify that. One datasheet talks about having a 22μF solid tantalum on the output for stability reasons, indicating it probably needs some ESR in the output capacitors. As for layout, use a ground plane and don't use thin traces to squiggle your power traces all over the board, try using a polygon or star layout for the positive power rails. \$\endgroup\$ Dec 25, 2020 at 10:43
  • 1
    \$\begingroup\$ Good grief! Please stop what you are doing and move everything mains related off your board. You will end up killing yourself or others if you keep doing this. \$\endgroup\$
    – winny
    Dec 25, 2020 at 15:00

2 Answers 2

3
\$\begingroup\$

If there is no load at all on the 3V3 regulator, it has no minimum required load so it won't output 3V3.

When there is no ESP connected, there is nothing connected on HC595 input pins, so they are floating. The input impedance is so high that taking multimeter probes nearby will cause the HC595 to see activity on input pins and it will randomly load in a data pattern to drive the relays to they will chatter on and off.

Also do note that inputs of HC595 fed with 5V is not compatible with 3.3V outputs of ESP. Either change the HC type to something else that can work with 3.3V input voltages, or change the supply of HC595 to 3V3.

Edit: Oh dear I just realized the supply that converts mains voltage to 5V is not external but onboard. The PCB layout is not safe for mains voltage at all. Not the mains input to supply, and not the relay contact wiring either. Please don't connect this to mains as it is unsafe.

\$\endgroup\$
3
  • \$\begingroup\$ your reply is really helpful for me. I got the point that my PCB layout is not safe from so many people feedback on this. I will design a new layout. Please can you provide any suggestions to make the better layout? Because if i will design this, i will keep things in mind before putting any efforts for the same. \$\endgroup\$ Dec 25, 2020 at 11:37
  • \$\begingroup\$ I don't know the exact PCB design rules for mains routing as I don't daily work on that area, and the rules may also vary according to your local legislation. I simply looked at your schematics design and know the answers to your questions you asked even without looking at the PCB level implementation, so that warning was simply an extra comment. \$\endgroup\$
    – Justme
    Dec 25, 2020 at 12:00
  • \$\begingroup\$ still your answers helped me to make things a lot much better. I understood a lot of concepts by just placing my layout here. People are giving so many feedback to make it really reliable. \$\endgroup\$ Dec 25, 2020 at 12:03
4
\$\begingroup\$

Throw away that pcb before it kills you and burns down your house - I’m not joking. As others have observed, the clearance between tracks carrying mains voltages and low voltage tracks is nowhere near safe. Have your mains wiring down one end of the pcb well away from the low voltage circuit. What current do you expect to switch with the relays? What voltage? I’d also suggest you use different relays like the omron G2R series - these are easier the design the pcb for and to ensure adequate clearance. The relays you’ve used require slots in the pcb and more care in the design. Do not use copper pours in the mains region! Consider using a tpic6b595 instead of transistors and a 74hc595. The esp12 module needs to be placed carefully - read the datasheet guidelines. Throw away your current pcb before it becomes the first and last one you design.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you for your suggestions. It really helped me to understand my mistakes. I will design a new layout for the same to keep the mains power and low power components separate. Also i got the idea that i need to put the Ground Plane in here to reduce the interference. \$\endgroup\$ Dec 25, 2020 at 11:31
  • \$\begingroup\$ I didn't understand what is the problem with "copper pours"? As i am etching the PCB by myself so instead via i am using this as a via. to join two layers together. \$\endgroup\$ Dec 25, 2020 at 11:33
  • \$\begingroup\$ Why attempt a 2 layer board if you etch it yourself? Just design a single layer board with wire jumpers. Knowing that you have a home etched board with such a poor layout scares me even more. Death is tapping you on the shoulder. \$\endgroup\$
    – Kartman
    Dec 25, 2020 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.