Can you explain this?

Hey there guys,
I have a problem that I cannot figure out.
I have one stepper motor driven by uln2003 driver and one 1 channel relay.
I am using 5V 1A phone charger for each my NANO, stepper and relay.
I will be adding more modules to my project but this already is becoming not practical.
For 5 modules 5 chargers, aint happening.
So I decided that I will use 1 charger for the NANO and one for the other modules.
Currently when i connect the red and black wires of the charger as in the picture, a problem arises.
As I read so far, in the parallel circuit every module should get 5V, while the amps will be the sum of all required. As long as I do not use more amps than the charger can provide, everything should be ok.

Problem:
this way the IN pin on the relay is receiving a small amount of current, but not enough to close its circuit.
The green led that lights up when I give a signal to close the circuit is glowing (a lot less but it is) nonstop.
Does that mean that there is a leak or what.
When the nano is on delay, the led is not glowing at all (as it should be, unless i give a signal to close the circuit).
This "leak" does not exist when I am powering the relay and the stepper with separate chargers.

Another thing that I cannot explain, when using separate chargers, the stepper is consuming:
idle : 350mA
moving : 300mA

but when I am using it as in the picture (1 charger for both relay and stepper)
idle : 300mA
moving : 250mA

why do does numbers change?

1 amp is probably marginal for the motor. if you are measuring the current with a multimeter it will be averaging it. You really need an oscilloscope to see what is happening.

Try temporarily substituting the 1 amp charger with a pack of 3 new AA alkaline cells. The voltage will be a bit lower but there will be 5 or 6 amps available for short term surges.

Another thing, breadboard connections are not really designed for motor currents - the breadboard might be introducing a lot of voltage loss.

...R

I tried with 2.1 A charger, it got worse, now the "leak" was enough to close the circuit by itself, so that I could not open and close it via the Nano.
I also tried wiring them directly, without the breadboard, everything was the same.
The problem occurs only when I am using 1 charger for the modules (parallel) apart from the nano.
Do you think there could be an actual leakage?

edit: I tried with another charger and not with 3 AA batteries. The problem is that it looks like not underpowering a module, but a leak. Judging by the fact that the led is bright on 20mA, and it is glowing barely, there should be going below 20mA through there non stop.

It is a common practice with stepper motors to leave one phase energized, at least partially, while the motor is stopped. This acts as an electromagnetic brake and keeps the shaft from spinning freely. So even though your motor is stopped and not moving, it is still getting power.

It is a common practice with stepper motors to leave one phase energized, at least partially, while the motor is stopped.

Really ? I thought a permanent magnet did this.

Allan

Before you get totally lost in the weeds of this problem, you need to tell us the brand(s) and model(s) of the two phone chargers you have tried using.

If the devices are no-name, no part number, no agency approval (UL, VDE, etc) devices, that's your problem. If they are genuine Apple or Samsung chargers, my next question will be the same as above about the USB cable that's plugged into supply.

There is a lot of really cheap crap out in the marketplace for the devices being discussing here. Some of the chargers can be downright dangerous, to the point of being lethal. Any cheap knockoff of the Apple 1 amp one inch cube supply will not supply 1 amp on its best day. Trying to pull more current out of those devices than they can supply will result in some very strange and unpredictable behavior, similar if not identical to your very own observations.

Care to check what you've got there pulled into the 120V outlet?

So the diagram is the total if your project?
No other wires, modules etc...
If that's the case, there may be a DC shorting link on one of the modules, or if there are other devices, you may have a current path back through some i/o or incorrectly connected switch etc.

Hi,
Welcome to the forum.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Please NOT a diagram like you have presented.
Use a pen and paper and post a picture of your circuit, please label your terminals and include your power supplies.

Also a picture of your project will help us see your component layout.

Have you got gnds of the Arduino and the power supplies connected together?

Thanks.. Tom.. :slight_smile:

avr_fred:
If the devices are no-name, no part number, no agency approval (UL, VDE, etc) devices, that's your problem. If they are genuine Apple or Samsung chargers, my next question will be the same as above about the USB cable that's plugged into supply.

I had one USB charger that, whenever I plugged my phone into it my touch screen would go apeshit. Touch detection become completely random. While trying to close my gmail app, I managed to send a gibberish email to one of my coworkers. It took me a few days to notice the connection between that behavior and that charger.

Garbage power can cause very real and very strange problems for electronics.

*** CODE ***
#include <Stepper.h>

#define STEPS_PER_MOTOR_REVOLUTION 32
#define STEPS_PER_OUTPUT_REVOLUTION 2048

#define RELAY 2

Stepper stepper(STEPS_PER_MOTOR_REVOLUTION, 8, 10, 9, 11);

void setup()
{
Serial.begin(9600);
pinMode(RELAY, OUTPUT);
digitalWrite(RELAY, HIGH); // open the NO - COM circuit
stepper.setSpeed(400);
}

void loop()
{
delay(2000);
stepper.step(1290);
delay(1000);
digitalWrite(RELAY, LOW); // close the NO - COM circuit
delay(5000);
digitalWrite(RELAY, HIGH); // open the NO - COM circuit
delay(100);
}


TomGeorge:
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Have you got gnds of the Arduino and the power supplies connected together?

I took some pictures, hope that would be enough I am not sure if I would be able to draw it correctly.
About tehe Arduino gnds, no I haven't touched them

avr_fred:
Before you get totally lost in the weeds of this problem, you need to tell us the brand(s) and model(s) of the two phone chargers you have tried using.

The HTC one came with my phone. The other one "Energizer", I am not sure about it and by the way, in my country we use 220v.

lastchancename:
... there may be a DC shorting link on one of the modules ...

Give a look to the pictures, this is happening without even connecting a 220v device to the relay.

DrWizard:
It is a common practice with stepper motors to leave one phase energized, at least partially, while the motor is stopped. This acts as an electromagnetic brake and keeps the shaft from spinning freely. So even though your motor is stopped and not moving, it is still getting power.

Yes, I think the library does that, because 2 of the leds are lid when the motor is not moving. If the stepper is creating a electromagnetic field, can that be interfering in some way.
Judging by the code, when the motor is not moving, D2 is receiving HIGH current, which means that the relay's led should not be lid at all. I am starting to think that when the stepper moves, the nano gives a signal to the other pins, which it is not supposed to do.

And sorry for uploading the pictures as downloadable files, I am not sure how to embed them.

Last photo

Hi,

About tehe Arduino gnds, no I haven't touched them

Please connect all the gnds together, the stepper and relay and NANO gnds TOGETHER.

That way ALL of your signals will have the SAME gnd reference.

Tom... :slight_smile:

I took some pictures, hope that would be enough I am not sure if I would be able to draw it correctly.

Unfortunately, your drawing (up top), bears no resemblance to the photos.
There are about 10 wires missing.
They're all important.

Take a deep breath, and in clear black ink on paper, or using Visio etc, sketch out how the modules and pin names connect together. (No need to use a tool like Eagle yet)