DC supply issues in a NODE MCU ESP8266

I have been working on a NodeMCU project. The objective of the project is to turn a DC motor clockwise and anticlockwise from Alexa commands. The coding and connection part is done as shown in the image above. I have achieved the expected result. But there is one issue in supply distribution.

When I give command to Alexa to rotate clockwise then,
The signal goes from D1 in NodeMCU to Relay1 will be activated and the motor rotates clockwise. (since the motor connected to Relays as shown in the pic).

When I give command to Alexa to rotate anti-clockwise then,
The signal goes from D2 in NodeMCU to Relay2will be activated and the motor rotates anti-clockwise.

This is the working principle and this process is working fine.

Issue:

The problem is
I am giving 9v supply. It will be regulated to 5v and that will goes to Node MCU and Relay module. Motor consumes direct 9v.

When the motor is rotating, the complete supply is going towards motor itself. There is no supply going to NodeMCU.

In short, the NodeMCU is turning OFF when the motor is running.

I am a newbie to electronics. Please show some light and help me in fixing this

How much current does the motor draw? How much current can the 9V supply deliver?

Which relay module are you using? I wonder if the NodeMcu can handle 5V on its output pins, it's a 3.3V device.

The '9V supply' wouldn't happen to be a smoke alarm battery (PP3 in the UK) would it? They are good for powering smoke alarms and not much else, certainly no use for a motor, not even a tiny little one.

1 Like

3v DC motor draws 300mah power.
9v source provides 1A current.
I am using 2 channel 5v relay module.
Generic 5V 10A 2 Channel Relay Module Shield for Arduino ARM PIC AVR DSP Electronic : Amazon.in: Industrial & Scientific

You are right!. The operational voltage in NodeMCU is 3.3V but we can supply 4 to 12 volts in VIN pin.

Here I do not have any issue with NodeMCU and Relay module. My only problem is, the supply is not going to NodeMCU when the motor is ON.

I think you mean 300mA, 300mAh would the the capacity of a battery.

Do you know what the stall current of the motor is? When a motor starts up it draws a lot more current than when it's running, easily 10 times as much, so in your case possibly 3A, which is more than you supply can cope with, so might explain the lack of power to the NodeMCU.

Alternatively you have a wiring error, it would help if you post some clear photos of what you have made.

Thanks for the Explanation!

I have no Idea about the max current consumption of my 3v motor.

This Image may be helpful!

The image does not help at all.

Without seeing your actual project I have no more suggestions to make. Maybe someone else has ideas I've not thought of.

Thanks!
OK, nothing obvious to me. I still think you need to consider the stall current of the motor.

Does the project work OK if you disconnect the motor so the relays still operate but don't power the motor?

Yes. The project is perfectly working when I disconnect the motor. Relays are operating, Node MCU is ON.

Then my best guess, unless someone comes up with something better / different, is still the stall current.

What happens if you connect the motor after the relay has operated?

Do you have any capacitors bigger than 220μF, like maybe 10 times bigger? If so try putting 1 or even several of them across the 9V supply.

Really I think you need a power supply capable of more than 1A.

When I give my first command to Alexa, the signal from NodeMCU is reaching relay module and motor is rotating fine. Here when the motor is rotating, the supply is not reaching the NODEmcu. So I am not able to give my seconds command because the NodeMCU is off.

Thanks a lot for your suggestions :slight_smile:

I will follow your tips. Thank you.

That's not entirely clear to me. Wht voltage do you measure on the input of the 7805 when the motor is off, and what voltage on that point if the motor runs? And the same for the output of the 7805?

It doesn't have to. It is connected to a relay module which has LEDs in series with the 5 V, so cannot pull the inputs higher than 3 V.

Other odd things:

  • We have been shown the relay module and the motor, but not the secret "9V source" which is supposed to supply 1 Amp. :face_with_raised_eyebrow:
  • What do you suppose the stall current of a motor rated at "3-6V" is when powered at 9 V? :roll_eyes:

The motor is variously described as 3-6V 12V and 10 Watts.
If its being fed 9V from the supply I have no doubt that when it starts the supply voltage will drop, probably enough to reset the NODE,
Has the OP measured the supply voltage to the NODE? If it drops to zero when the motor is running there is a mistake in the construction as compared with the schematic; the dropout voltage on the 7805 is only around 2V.
I'd suggest for testing running the NODE from USB then the OP could do some diagnostics.

Yes.The issue is at the motor only.. It is consuming full power which making the Node MCU off. Can I place any big capacitor before NodeMCU? so that it can store the energy and it releases when the motor is running?

Please post the measurements that you based this on and details of the power supply.

The ad is for two motors, so I'm thinking the 12V spec is for both motors in series.

Must be, those TT motors respond to 3-7.4V without issue, but they are spec'd for 3-6V. Didn't Abraham Lincoln tell us to never trust what we read on the internet?