Converter:
( DROK 12V to 5V 3A 15W Waterproof Micro Buck Volt Converter DC-DC Car Auto Vehicle Power Supply Module Step-down Voltage Transformer Volt Regulator Inverter Board with Waterproof Aluminum Case)
LED:
( LED UV LED Light Strip USB Operated 2M/6.6ft 5V 5050 SMD 120LEDs 395nm-405nm Blacklight for Fluorescent, 3D Print Curing)
I have this setup for a wash station I'm working on for 3D prints. The goal is to use 3 buttons, two for lowering and raising the arm, and one for starting a cycle. There is a switch that turns on a 405nm UV led, which additionally gets detected by the Arduino for other purposes. I also have a 12v dc computer fan hooked up with a 4pin PWM output hooked up to the Arduino which I forgot to add to the diagram. To deal with the different voltages I use a 12v to 5v 3A converter to power the mega, stepper motor, and LED.
My problem: The motor started vibrating. I've had a few failures as I am new to Arduino and made some mistakes, so hopefully, I didn't burn the motor out. I am running the motor with 5v instead of 3.3v but since this is a low power application I have no need for the stepper to hold, so the code accounts for no buttons being pressed to disable the stepper motor. When I was using the Arduino UNO for testing the motor and code worked flawlessly. Now when using a mega the motor vibrates. Is this an issue due to low current, how can I fix this? The L298N Driver is brand new as well. The wiring looks correct to me if it isn't please correct me.
I have tested the example codes on the motor and it seems it still has the same problem. I also triple-checked wires. I know there are plenty of posts out there with the same problem but i couldn't find any solutions that worked.
Any advice on making this circuit better please offer your constructive criticism!
The L298 driver is inappropriate for a modern bipolar stepper. L298 is an ancient and inefficient DC motor drive and even worse stepper driver. That driver will drop 2V to over 4V so your motor, powered with 5V, will only see, at best 3V. A DRV8825 stepper driver with a 12V (minimum) power supply would be much much better.
I'm surprised it even vibrated. The toy picture, Fritzing, a coloured bird nest, shows no power supplies what so ever.
Way too often insufficient powering is the reason for failure. Discussing any code or functioning without schematics is too often a waist of time.
While the L298N can act as a stepper driver, it's pretty bad for it. Also, where is it being powered from? Why have you used a Fritzing for such a complex circuit? Draw a schematic or something, these Fritzing diagrams only make sense for basic circuits, which this is not.
The power is fed through the adapter at the bottom with 12v. I guess you could say the colourful aspect leaned me towards it. It’s just the way i see things, it helps me understand to see the colours rather than following a schematic. Im failure new to all this so im open to suggestions
The motor’s rated voltage is 3.3V so would that .3 drop significantly effect the motor to not turn? It seems the problem most people are pointing out is the drivers itself. I’ll look into the drivers people have mentioned and try updating it
Not really. The motor is designed for a coil current of 1.5A and is designed to be driven by a current driver such as the DRV8825 already proposed. These drivers control the current through the coils. The voltage at the stepper has no meaning in this case. The operating voltage should be as high as possible, taking into account the components used.
Yes, if you connect everything correctly - and don't start with a too high steprate from standstill.
The L298 is definitely not a suitable driver for your stepper.
That snippet does not tell us the step rate (speed) that you are trying to achieve.
Your snippet does not tell us what library, if any, that you are using.
As usual, the snippets of code leave out important information. That is why we request that you post the whole program. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.