Electronic – arduino – esp8266 doesn’t work when connected to same supply as relays

#nodemcuarduinorelaytransistors

The problem:

Circuit one (with Arduino Nano) did work fine. I used a separate power supply (5V wall wart) for it, because I didn't think that the on board regulator could handle 12V.

Circuit two (with NodeMCU) does not work – either does not turn on, relays are being switched chaotically, does not connect to wifi. When I disconnect the D1-D8 pins from the transistors, it turns on and connects to wifi. I guess, when I will connect the NodeMCU to a separate supply, all will work as expected.

My question is – why can't it be connected to the same +12V? Is there something horribly wrong with the second circuit?

P.S. The project is controlling three AC motors that move metal blinds (security shutters). I made the original circuit a few years ago, now I wanted to add wireless connectivity via blynk. I know that there should be flyback diodes across relay coils, but at the time I didn't know that, and the thing was functioning fine without them. I will probably add them now, however.

Thanks

Circuit 1

Circuit 2

Best Answer

  1. I definitely recommend adding the flyback diodes across the relays
  2. The bigger the difference between the Vin and Vout, higher will be the power dissipation internal to the regulator. This regulator has an internal power dissipation protection circuit, which may be triggering and resting the board. you can monitor the 3.3 V output for that
  3. It will be helpful to add a series resistor for the switches and also a capacitor for the two input pins.
  4. Also a 100k pull down to all the transistor base pins if you have space. This will help not to trigger relays accidentally when MCU is reset due to either an ESD event or a spike on it's one of the pins.
  5. i assume 12 V supply is same as the one used for Arduino nano setup, so not doubting on it's current capability.
  6. Try adding only one relay and monitor the 3.3 V supply pin on an Oscilloscope if possible. If it works, go on adding the load.
  7. Consider adding a few caps at the voltage input pin. It will also help to absorb higher energy coming from make break of relay contacts.

Here is the datasheet of Node MCU ESP 12 Module. http://bienonline.magix.net/public/esp8266-faq/NODEMCU_ESP12.PDF

As per the schematics, a 5 V is expected. the input range is upto 16 V is mentioned in the datasheet. The datasheet of the regulator can be found here.

enter image description here

Related Topic