Need help with circuit I made

Hello,

After finishing the main idea behind the project I'd like to make, I connect all parts without main body just to test the way stepper motor would act and it all works perfectly without adding the 3D body and soldering it all in between. Once everything is soldered and connected I am getting a problem with stepper motor stopping half way then it should, sometime not even reaching half way when its powered through external power supply (12 V 5 A), but once arduino nano is plugged to USB via PC everything works like a charm, so only problem i am facing is when nano is not connected to USB. I am brining 12V to VIN. Stepper motor runs on 12V and 1.8 A, rest is basically a switch, photoresistor, relay, driver A4988

What could cause that issue?
very thin black wires I used?
I connected something wrong?
5A is not enough to power up this project?

Any help is appriciated thank you !


Can you post a real schematic, please?

Hi,

as drawn on paper?

homunculus1133:
Hi,

as drawn on paper?

Yes, that would be perfect.

Here you go ! hope I connected it all good while I was drawing now

yeah I didn't, Drivers VDD and GND are connect to 5V + common ground

Powering through Vin or the power jack means that the Arduino and all peripherals that are on the 5V rail are powered by the onboard 5V regulator. The on board 5V regulator is not heat sinked so will supply limited current before it overheats and shuts down. The recommend max power dissipation for the regulator is 1 Watt. With 12V into the regulator the max current is about 140 mA (1W / (12V - 5V)). The Arduino uses around 50ma of that leaving less than 90mA (max) for everything else. I would use a buck converter to drop the 12V to 5V and connect that to the 5V on the Arduino, bypassing the, weak, 5V regulator.

So you know if the Nano is resetting ( a print in setup())? Is the problem coincident with the relay actuation or any other load on the 5V rail?

If so, try an external regulator.

+1
More than 9volt on V-in of a Nano is asking for trouble.
Powering a relay from the Nano when powered from 12volt is double-trouble.
Leo..

You can try to add one of more diodes between the 12V and Vin. It will

  1. Drop some voltage to decrease load of the LDO.
  2. It may prevent brownouts if a current spike to the motors causes 12V to drop briefly.

Suffice to say the on-board regulator on the Nano (or UNO,Pro Mini, Leonardo etc.) is pretty much useless and you should just forget the "Vin" pin.

You need a proper regulator to supply 5 V for all the parts requiring 5 V - notably the relay module and your stepper driver. Switchmode "buck" regulator modules for 5 V are readily available, relatively cheap and have capacities of at least 2 Amps, generous for your purpose. Get a proper regulator and avoid trouble! :grinning:

The relay seems only to cut power to the stepper driver. Does the chip not have standby or sleep modes?

It would be better to buy a 12V relay to replace the 5V relay. This would not burden the arduino's regulator to drive the coil. Or use a mosfet maybe? With only itself to power, the Arduino should be OK with 12V to its Vin pin.

PaulRB:
Does the chip not have standby or sleep modes?

Yes it does.

And that's a lot better than using a relay to cut power to a stepper driver.
Read the A4988 datasheet, page 10.
Leo..

You can't power up the stepper driver if the Nano is offline because then it has no inputs.
The Nano should only be used for GPIO and must be online BEFORE bringing the driver online and the driver must be online BEFORE APPLYING MOTOR POWER.

Those problems can be solved with a signal transistor and/or pull up resistor.
Leo..

Once I keep all the components on a breadboard and run the stepper without the 3D printed construction which weights approx 0.5 KG, everything in fact works good, even without USB, once I start soldering things and add extra 0.5kg it starts to behave weird, does 0.5kg make stepper draw more current? resulting in less current for the other components? I though 0.5kg would practially mean nothing for such strong stepper, I just dont get the point why does it work on breadboard and not once soldered, does solder reduce efficiency of voltage/current?
I also tried using LM2596 to lower the voltage down to 6V for Vin, turns out once I did that everything started to be so extremely hot that I just had to disconnect it and forget about that approach

The maximum step-rate and maximum step-acceleration-rate depend on the motor, its supply voltage,
the mechanical load. You pretty much have to determine them by experiment as there are so many
variables affecting them, including the degree of mechanical damping in the system.

Stepper motor dynamic torque (when moving) is much less than its holding torque (static rating),
many datasheets for motors include a few graphs of torque v. speed for a range of supply voltages.

If you know how to solder and are using flux there
should be no problem.I have soldered hundreds of circuits and they all worked perfectly.

If it works on plugboard, but not proto board, you made some error. Unfortunately, troubleshooting that kind of problem is extremely hands on. You just have to put on some magnifying glasses and go through the entire construction, verify one connection at a time both visually and with a meter if you can. It's also possible that the connection methods are different between proto and plugboard, so you need to check those too.

aarg:
If it works on plugboard, but not proto board, you made some error. Unfortunately, troubleshooting that kind of problem is extremely hands on. You just have to put on some magnifying glasses and go through the entire construction, verify one connection at a time both visually and with a meter if you can. It's also possible that the connection methods are different between proto and plugboard, so you need to check those too.

I checked that I assume 50 times already, either im constantly making the same mistake or I cant see the reason if things are connect wrong how could it work with USB plugged in to arduino but not without it. Same thing how can it work on plugboard with external supply only but not once assembled/soldered

homunculus1133:
... how could it work with USB plugged in to arduino but not without it.

This is likely a missing ground connection or the USB is supplying a better regulated power. In setup(), blink the led_builtin a few times. If the Arduino is resetting, the LED will blink.

12v ps is shorted to 5v