Skip to main content
5 votes
Accepted

A4988 and capacitors

There are two purposes of such capacitor: first it supply power for short peaks in demand, so effectively enabling the 12V power source supply much more current for short time, than it can support ...
gilhad's user avatar
  • 1,420
5 votes

Where am I going wrong in modifying Timer0 and the ISR interrupts in this example?

Don't do serial prints inside an ISR. Ever. They require interrupts to work, and inside the ISR interrupts are off. For a while the attempts to print will fill up a buffer which is emptied by another ...
Nick Gammon's user avatar
  • 38.4k
4 votes
Accepted

Can I prevent the Stepper library from holding the motor?

use disable output class in accelstepper library. http://www.airspayce.com/mikem/arduino/AccelStepper/
Mehis Laane's user avatar
4 votes
Accepted

How can I use stepper for specific degree?

stepper.step(num)is used to rotate your motor 'num'-step. i.e. num=25, then calling stepper.step will cause your motor do 25-step. STEPS is number of steps per revolution for your motor. It will be ...
duck's user avatar
  • 1,258
4 votes

HCSR04 Sensor without delay

Have you searched for other libraries or example code for this particular sensor? I found this NewPing library that claims to have been developed to fix poor performance of such modules due to poor ...
jose can u c's user avatar
  • 6,974
4 votes

Maximum Delay time

Note: there's an existing question here this should be closed as a duplicate of, but that is proving hard to find. So until someone does find it... The arduino delay() function creates a blocking ...
Chris Stratton's user avatar
4 votes
Accepted

How can I know if I can stack some shield on another shield?

First you have to compare the pinouts of the two shields. If the shields use completely different pins then yes, you can use them together. However if they share pins then you need to look in more ...
Majenko's user avatar
  • 105k
4 votes
Accepted

How to calculate step delay?

Convert the RPM of the motor to RPS. Take reciprocal to get seconds per revolution. Divide it by 360 to get seconds per degree. Multiply by 1.8 to get seconds per step.
Mitu Raj's user avatar
  • 424
4 votes
Accepted

How to randomize the delay in Arduino Stepper code?

In setup(), add randomSeed(analogRead(0)); This reads the value of an analog input pin, which if not connected, will float to relatively random values between 0 and 1023. This "seeds" the random ...
jose can u c's user avatar
  • 6,974
4 votes
Accepted

Stepper Motor is not working with A4988 board

You have to connect the sleep and reset pin together. I assume that you took this schema on how to mechatronics. In his video you see that the sleep and reset pins are connected. I don't know why but ...
user's user avatar
  • 56
3 votes
Accepted

DVD drive stepper motors with polulu a4988 on Arduino

According to Pololu's website, the VMOT pin needs at least 8V to function. Try a 12V switching (important!) wall wart supply that can supply at least 1A instead of your USB supply. Avoid supplies that ...
3871968's user avatar
  • 308
3 votes

Ensuring specific frequency at specific time?

As mentioned in comments and other answers, using timer 1 for hardware-timed bit toggling is likely to produce better results than code using delays based on calls like delayMicroseconds(), primarily ...
James Waldby - jwpat7's user avatar
3 votes

Ensuring specific frequency at specific time?

Generating a linear frequency ramp with accurate timings is not an easy task. I am providing here only a partial answer, where I first go through the math of the problem, then give some ideas for the ...
Edgar Bonet's user avatar
  • 43.3k
3 votes

Steppermotor+Arduino Mega+ Adafruit

I'd look for a proper stepper driver, e.g. something based on A4988 or similar. I wasted a fair amount of time on the Adafruit motor-shield 2.3 until I finally abandoned it after failing to achieve ...
marangisto's user avatar
3 votes
Accepted

Arduino uno + cnc shield v3 + Stepper Motor Driver A4988 + AccelStepper?

Manually set the ENABLE pins as OUTPUTs, i.e. add in the setup() function: pinMode(MOTOR_A_ENABLE_PIN, OUTPUT); pinMode(MOTOR_B_ENABLE_PIN, OUTPUT);
Esteban Garcia-Gurtubay's user avatar
3 votes

Having some trouble incrementing counters

Make CTR static or place it in the global scope. As it stands you set it to 0 every time you go through loop. The line: int ctr = 0; literally means "Create a new variable on the stack called 'ctr' ...
Majenko's user avatar
  • 105k
3 votes

How to pull a pin low?

Connect it to an IO port and set it to OUTPUT and LOW. That's what it means to "pull low". It helps if you understand how an IO port works. This may help you.
Majenko's user avatar
  • 105k
3 votes
Accepted

Run two stepper at same time

When using a normal stepper driver, you say the driver to do one step, by sending him one pulse. The length of these pulses does not have a meaning. they are constructed, so that the driver can sense ...
chrisl's user avatar
  • 16.3k
3 votes

Stepper Motor won't reverse/turn CCW

I had this issue myself, when I tried to use these stepper motors (which are to be honest really crappy ones, but very cheap). Vibrating mostly means, that the phases of the motor are not activated in ...
chrisl's user avatar
  • 16.3k
3 votes
Accepted

Why is my CNC shield smoking? Is it safe to keep on for long periods of time?

Those NEMAs are big ones - i suspect too big for the little A4988 chips - which can only provide 2A when actively cooled and generally only for short periods. I wouldn't try to push more than 1.7ish ...
Ozoid's user avatar
  • 101
3 votes
Accepted

2 stepper drivers speed control

Changing the duty cycle does not change the frequency of the PWM signal. The tb6000 needs a pulse to trigger a step of the motor. If the frequency does not change the pulses per second do not change ...
Peter Paul Kiefer's user avatar
3 votes
Accepted

AMIS30543 | Data-Sheet understanding Status register

Most of the data is duplicated between the registers. Both registers contain MSP[6:2]. If MSP contains 111001001 the registers (ignoring the MSB "PAR" bit) would look like: SR3: 1110010 SR4: ...
Majenko's user avatar
  • 105k
3 votes

How to control speed of 28BYJ-48 stepper motor without using library?

A stepper motor always needs a driver. As the ULN2003 (or similar) driver is normally shipped together with the 28byj-48 motor, I will assume, that you have this driver. The ULN2003 has 6 pins: Vcc ...
chrisl's user avatar
  • 16.3k
3 votes
Accepted

How do I find the whole number (n) that when multiplied by (m) will be closest to (x)?

First, I'll show you the "manual" way. You can divide the resulting steps by the number they should be divisible by, round to the next integer, and multiply that again by the number. I'll ...
the busybee's user avatar
  • 2,088
2 votes

80 Apple Homebuttons and a steppermotor

If you follow JayEye's approach (ie, use five MCP23017 units to connect 80 switches, and five more to connect 80 LEDs) the wiring and the software should be fairly simple. But dealing with all the ...
James Waldby - jwpat7's user avatar
2 votes

How to rewrite code in millis?

Since microcontrollers typically only have one "core" or "thread" they can only do "one thing at a time". A microcontroller will step through your code and do everything in order (if you don't call ...
aaa's user avatar
  • 2,695
2 votes

How to rewrite code in millis?

You could try something along these lines, I haven't put all of the code in, but just how this could be done for the sweep timer using millis(). unsigned long sweepTime; unsigned long animationTime; ...
Holmez's user avatar
  • 228
2 votes

How to rewrite code in millis?

The basic pattern goes like this: when you start the timer, you essentially store the current millisecond. After this, in your loop code, among other things you should check if the time has passed by ...
foivaras's user avatar
  • 337
2 votes

How to run stepper motor at its maximum speed

As this link states: Stepper motors are normally used for positioning, and are not known for their speed. However, the link is to an on line stepping motor speed calculator. As for the size of ...
st2000's user avatar
  • 7,340
2 votes
Accepted

Make a stepper motor move

You must set EN BEFORE you set DIR. The datasheet says EN must be high for at least 5 microseconds before you set DIR. You should probably just set EN high when your program starts, then not fool ...
JRE's user avatar
  • 352

Only top scored, non community-wiki answers of a minimum length are eligible