r/arduino 8d ago

Why is this happening?

When the motor is connected in the driver the LEDs become dims but when I take it off the LEDs are bright red. I don’t know why? Anybody know?

Edit: Ok so it’s on an Elegoo 5V supply module connected to an Arduino uno. I don’t know how much amps it’s outputting

40 Upvotes

30 comments sorted by

13

u/solitude042 8d ago

What's your power source? If it doesn't have sufficient current capacity, the motors are likely causing the voltage to sag. Especially with motors, don't power them off of the arduino itself - the arduino board really doesn't have enough capacity, and the inductive spikes from the motor coils can fry the arduino board in short order.

2

u/theOGKING1001 8d ago

It’s connected to a 9V 1A wall socket which is connected to a 5V regulator

2

u/RichRichardRichie 8d ago

Does the 5v regulator allow enough current to motor driver?

1

u/theOGKING1001 8d ago

It’s a 5V Elegoo power supply module. I don’t know how many amps it’s outputting

2

u/austin943 7d ago edited 7d ago

If it's this MB102 breadboard power supply, then the maximum current is 700ma, but that assumes ideal conditions. Since you're powering it with a 9V input, the AMS1117-5 regulator in the SO-223 package will be generating more heat than ideal. Without a heat sink on the regulator, the maximum current will be less.

However the ELEGOO starter kits include both the 28BYJ-48 5V stepper motor and that breadboard power supply, and they include a circuit diagram with both (see attached pic). I've gotten that same circuit with the ELEGOO starter kit to work just fine. So I think you're good on the components.

One thing that concerns me is that all 4 LEDs are lit. Are you attempting to step the motor with your sketch when it's connected, and at what rate? Normally only 2 LEDs should lit at a time, if the stepper motor is turned very slowly. At a higher stepping rate, all of the LEDs are flashing very quickly, and hence they can appear to be all lit.

Can you check the inputs to the stepper motor driver board and make sure that only 2 inputs are active high at a time? If you are driving all 4 simultaneously, then all 4 coils of the stepper motor will be energized, and that may cause the voltage regulator current limiter to kick in.

In your sketch, try to step very slowly (like one step per second) and check that only 2 LEDs are lit at one time.

Also check that you are using the 5V output of the power supply, and not the 3.3V output. There are two separate outputs.

1

u/theOGKING1001 7d ago

Ok thank you austing for the help but to be honest I am getting extreamly annoed cause no matter if I connect the pins exactly how you have them on the photo or on any vidoe on YouTube it's not working. The voltage is there so is the current but it's like I'm the only one with this problem

1

u/austin943 7d ago

It may not be the wiring that's the problem, but your sketch. Can you post the sketch?

Try temporarily connecting to ground any three of the wires going into the stepper motor driver board from the Arduino. So instead of 4 wires going from the Arduino to the driver board, there'd be just one wire. The other 3 connections to the driver board are temporarily connected to ground on the breadboard.

Do you now see one of the LEDs lit strongly, and the other three LEDs are off? If not, what do you see?

1

u/theOGKING1001 7d ago

This is the best angle I could take connecting everything

1

u/austin943 7d ago

Please connect the ground of the breadboard power supply to the ground of the Arduino board. Don't connect the 5V together though, just the ground signal.

1

u/theOGKING1001 7d ago

While yes one is stronger than the rest but now they are blinking going on and off

1

u/austin943 7d ago

Are you saying with 3 of the 4 motor driver pins tied to ground, all 4 of the LEDs are blinking?

1

u/theOGKING1001 7d ago

Yes. They all blink on at the same time and off at the same time. One of the LEDs is brighter than the others though

→ More replies (0)

1

u/lasskinn 6d ago

You can just use a simple multimeter to check this driver whats going on with it and if the voltages sagging and the pairs on the motor.

That being said this should be a pretty simple thing as long as its connected right. If the leds aren't flashing when moving the stepper the codes not right(regardless of if the motor is connected).

This isn't a smart stepper driver, basically its just 4 on off switches

1

u/theOGKING1001 6d ago

All I did is copy her code and connections from this YouTube video I found https://youtu.be/N2rmLqeR1Lw?si=bcwM4Y6tSxbXIB_E

1

u/AdministrativePie865 8d ago

Less than 1.7A for sure

2

u/FlowingLiquidity 8d ago

What is your power source?

1

u/theOGKING1001 8d ago

It’s a 5V power supply

3

u/CharlesForbin 8d ago

5V power supply

How many amps? That's the critical detail for a stepper.

2

u/Sleurhutje 8d ago

What kind of driver? Probably an open collector type.

2

u/adderalpowered 8d ago

We need to see a lot more of the wiring. But I agree this definitely looks like not enough current.

2

u/scalyblue 8d ago

Verify that the load isn't pulling down more current than your power solution is able to provide, especially an inductive load like a motor.

1

u/YUMOBUILDS 8d ago

hey . add more pic or video and mention the board type, try to keep all that wiring in one frame, then we might be able to find out. and there is short between 2 pins whats that for? might be for the voltage. what you just said , its sounds like the current it's dropping a lot, remove that pin and give it try to see any different or no.

1

u/Chaes1 8d ago

I got yesterday the same problem. My problem was the step sequence

int steps[4][4] = { {1,0,0,0}, {0,1,0,0}, {0,0,1,0}, {0,0,0,1} };

This was my resolution

Edit: chatGPT didnt helped me with this problem Cause i made wrong steps but the programm will say its right

1

u/EdfromMaine 7d ago

You possibly have a combination of two problems. First, your power supply is on the borderline low side. It is probably sufficient to power the stepper when the stepper is driven correctly, but not enough to energize all the coils at once. The LEDs are a giveaway for the second problem. They should NOT all be on at once, and it means that the motor is being driven incorrectly.

I suggest that you try using the official Arduino Stepper library. Since the board has 4 control leads, you will use the bipolar configuration. Make sure that you have assigned the right functions to the right pins. I also suggest that you run the motor slowly, so that you can see if the LEDs are lighting up individually.

Using the library is the sanity check. If you are certain that you have wired everything correctly and are using the official library and it still doesn't work, the possibility is that the driver board (or motor) is defective or the power supply can't supply sufficient current.

Once you have confirmed that everything works, then try to write your own code.

Personally, I'm lazy. If there's a good library out there, I'm gonna use it. Never reinvent the wheel unless you need to. If it is an exercise in self-education, that's another story...

1

u/Chief_Keefer_420 6d ago

In the most simplest terms is because you’re adding load, and your voltage is dropping you might need to add a capacitor somewhere in your chain

1

u/Rayzwave 5d ago

Please show us your code that you have uploaded to your Arduino.

1

u/jasonwinfieldnz 1d ago

I have had this before, not wanting to send you down a garden path but it worked after I swapped the driver. Maybe just pulling it in and out might work.