Stepper doesnt work and connection help

Hey there,

Is it okay if I keep my batteries connected while uploading the code to Arduino?

I'm trying to use a stepper motor and it doesnt work correctely I asked claude and it said to connect the ULN driver's +ve terminal to the VIN pin or arduino and -ve terminal to GND pin and it said that the battery will work for the driver and the usb will work for the arduino

Here is and ss of the conversation

Which arduino are you using?
Are you using one of these boards?

Please post you code. In the IDE click on Edit then Copy for Forum then come back here and just do a paste.

#include <Arduino.h>
#include <Stepper.h>

#define STEPS_PER_REV 2048
#define STEPS_PER_COMPARTMENT 512

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

void setup() {
  Serial.begin(9600);
  stepper.setSpeed(5);
  Serial.println("Ready...");
}

void loop() {
  Serial.println("Moving...");
  stepper.step(512);
  delay(3000);
  Serial.println("Moving back...");
  stepper.step(-512);
  delay(3000);
}

im using vs code with platform io and yeah thats the board im using btw the servo vibrates does it need more power or somthing?

Hi, @herobrineh2055

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

What is your power supply?

Do you have a DMM? Digital MultiMeter?
Have you identified the two coils of the stepper correctly?

Can you please post a link to specs/data of your stepper?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

PC USB → Arduino Nano
ULN2003 + → VIN
ULN2003 - → GND
Stepper white connector → ULN2003
IN1 → D8
IN2 → D9
IN3 → D10
IN4 → D11
Battery + (red)  → VIN
Battery - (black) → GND
ULN2003 + → VIN
ULN2003 - → GND

The stepper motor is the 28BYJ-48

Power supply is currently 5v but im currently testing 7.4v

Hey thanks for all your attention guys but now the stepper motor works with 7.4v when i connect it with my 18650 li-ion batteries im using my usb and the battery together

Hi,
Where have you got the jumper on the driver PCB?

Can you post some images of your project?
So we can see your component layout.

Tom.... :smiley: :+1: :coffee: :australia:

it works with this setup

Battery ---------- Arudino

+ve --------------> VIN

-ve ---------------> GND

ULN2003 ------------ Arduino Nano

IN1 ----------> D8

IN2 ----------> D9
IN3 ----------> D10
IN4 ----------> D11

Which Arduino are you using?
I'm sure you have it connected wrong.

This explains the correct way to use the driver board

Which Arduino are you using?

Hi, @herobrineh2055

Have a look at this site and try his layout and code.


Tom.... :smiley: :+1: :coffee: :australia:
@jim-p Like minds think alike... :+1:

The saying is "great minds think alike"

Btw thanks but now it works and according to my brain if something works do not put your finger in it :)

"But fools never differ"

What was the solution?
Tom.... :smiley: :+1: :coffee: :australia:
PS. Haven't had a coffee for 6 hours, caffeine low.