1
\$\begingroup\$

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

\$\endgroup\$
  • 2
    \$\begingroup\$ You don't have any flywheel diode for those solenoids. \$\endgroup\$ – Long Pham Jun 17 '18 at 8:06
2
\$\begingroup\$
  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

\$\endgroup\$
  • \$\begingroup\$ Thank you for Your answer! It turns out, it had to do with this (from datasheet): "MATTERS NEEDING ATTENTION On every boot/reset/wakeup, GPIO15 MUST keep LOW, GPIO2 MUST keep HIGH. GPIO0 HIGH ->RUN MODE, LOW -> FLASH MODE" I swapped pins around and it started working. I added the diodes and base resistors as well. Thanks! \$\endgroup\$ – Janis Berzins Jun 29 '18 at 13:47
  • \$\begingroup\$ This should be the first line e in the answer. You can add another answer or you can allow me to copy it into my answer.. For the next reader \$\endgroup\$ – Umar Jun 29 '18 at 15:00
1
\$\begingroup\$

It turns out, it had to do with this (from datasheet): "MATTERS NEEDING ATTENTION: On every boot/reset/wakeup, GPIO15 MUST keep LOW, GPIO2 MUST keep HIGH. GPIO0 HIGH ->RUN MODE, LOW -> FLASH MODE"

I swapped pins around and it started working. Thanks!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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