Questions tagged [motor]
Use this tag for questions about connecting, controlling, and safely operating motors using an Arduino board.
677
questions
0
votes
0
answers
14
views
Can't get timer 2 to work on PD3
Whenever I try to run the PWM code on PD6 or PD5 with timer 0, they work properly. But when I switch to PD3, which works with timer 2, it doesn't work. PD3 is the pin I have to use as I have an LCD ...
0
votes
1
answer
16
views
L298n driver with Arduino with 2 motors won't work
I connected the 12v power supply with 9v battery. The problem is that when i run 1 motor at time from any side (out 1, 2 out 3, 4) it works perfectly, but when I try to run both of them, only one will ...
1
vote
0
answers
43
views
How do I control a BLDC with greater precision using bluetooth?
I am building a quadcopter drone and I have 4 BLDC motors that I can control using an HM10 Bluetooth module and the "Dabble" application.
My problem is that when I use a virtual joystick in ...
-1
votes
1
answer
63
views
Arduino not reacting sometimes when reading serial commands
When I am sending hex numbers via computer to the arduino leonardo, it sometimes won't react, but the serial monitor says that it was sent. My code;
void setup()
{
Serial.begin(9600);
pinMode(...
2
votes
1
answer
66
views
I would like to know why my four gear motors are rotating at different speeds when connected to 2 L293D motor drivers, controlled by the arduino
Ignore direction of the motors(for now).
This is my connection diagram. Any and all improvements to this are welcome.
Bottom left motor seems to run at 210-224 rpm
Bottom right motor runs at 160-180 ...
0
votes
1
answer
99
views
Problem with Bing generated code for automated chicken coop door
Glenn from Sweden here. I was wondering if some kind soul could help me out here.
My partner bought a cheap chinese knock-off automatic chicken coop door that operates based on sunlight. Link to the ...
2
votes
2
answers
80
views
Using Internal Timer Interrupt to Read Analog Sensor
I'm having difficultly using an internal timer interrupt with my Arduino Nano to properly capture a specific value from a linear potentiometer and then instantly stopping the actuator.
I basically ...
2
votes
1
answer
51
views
Code not Executing Reliably on Push Button Activation
I have put together the following code to activate a motor using an Arduino Uno via push buttons.
Two push buttons should be pressed simultaneously to activate the motor for a specified number of ...
3
votes
0
answers
51
views
nano 33 BLE problems with reading RC signal
I'm using an Arduino Nano 33 BLE and a L293D motor driver to control a three-wheeled RC robot. The sketch I'm using worked fine with my Uno Rev3, but I've moved to the Nano for size/weight reasons, ...
1
vote
3
answers
104
views
are 4AA batteries (6V) power my arduino
I'm actually new to using arduino , and trying to make a simple car, using two dc motors, a l298n and an arduino, the problem is that a 9v battery doesn't seem enough to just power the l298n and one ...
1
vote
0
answers
108
views
ESP8266 + NodeMCU Motor Shield spinning motor only in one direction
I hooked my ESP8266 Wi-Fi module to an ESP-12E Motor Shield and connected it to an RC car. It works fine when connected to my laptop (Goes forward, backward, left, and right. Though the car doesn't ...
3
votes
2
answers
81
views
Arduino resets or stuck during run, only when DC motors are connected
I'm using an arduino connected to 2 DC motors through L298N. the arduino is powered by a 9V battery, and the L298N is powered by 4 AA batteries. there's also a switch that starts the movement.
I've ...
1
vote
0
answers
31
views
I2C Motor Driver (TB6612FNG) and DC fan error
I running the following code with Seeeduino Cortex M0, DC fan and Grove - I2C Motor Driver (TB6612FNG) but I get error ,any idea why?
Code:
#include "Grove_Motor_Driver_TB6612FNG.h"
#...
1
vote
1
answer
121
views
ARDUINO DC Motor Control over IR Sensor INPUT
I'm working on a school project where I'm building a small convyeor belt using an ARDUINO, DC motor and IR sensor for moving object detection so my color sensor can read color value.
I'm using single ...
1
vote
1
answer
52
views
timing changes once DC motors are connected to power
I'm using an arduino uno with two DC motors. I'm also using the built in LED to tell me when the motors should be on as a debug tool. The code is a simple while loop that turns both the motors and the ...
1
vote
0
answers
23
views
This DC Motor shouldn't have any current while I'm not pressing the button (pin 7 is LOW) but it has. (When I'm pressing the button its as intended)
I can't seem to find the problem, and I believe its not about the code but I will give you the code nevertheless.
const int pinOFswitch = 4;
const int motor_3 = 7;
const int pushbtn = 5;
void ...
1
vote
1
answer
59
views
Need help figuring out how to organise a system to run a stepper motor at low speed without Steps-skipping
TL;DR : How to prevent step-skipping with a NEMA gearbox motor at low speed.
I am in the process of creating a system in which I want an object to turn on a plate and to show a letter depending on the ...
-1
votes
1
answer
29
views
Controll the dc motor that works with 2xAA bateries using 5v
I have a toy that has a dc motor and is runing with 2xAA bateries ( i think it is 3v motor)
So i want to run it with 5v power supply.
First question: Can 5v damage the motor
Second question: i think i ...
0
votes
1
answer
204
views
control 12v motor with NPN transistor via arduino
i want to control this 12v motor via arduino:
Power source is 12v 5A
motor will work 5 seconds in every 5 minutes and will be activated throught arduino mega
i will try to use bd679a darlington ...
0
votes
1
answer
87
views
Single Method for 2 Ultrasonic Sensor is not working as expected
So I have created a method to read and return Ultrasonic Sensor Data. I have 2 Ultrasonic Sensors.
Below is my code.
// Ultrasonic Pins
#define T1 2
&...
1
vote
1
answer
662
views
What is the best (fastest and most robust) way to send messages back and forth between Python on a PC and an Arduino, over serial?
I am trying to communicate between a PC running Python using PySerial and an Arduino. The Arduino itself has a CAN shield, and is responsible for interfacing with a motor. My goal is for the PC to ...
1
vote
1
answer
359
views
Motor with ultrasonic sensor
I am new to programming so bear with me.
I am writing a simple code to control a motor such that the motor will turn at full speed as long as the sensor does not detect an object within 5" of the ...
3
votes
1
answer
349
views
I'm using nRF2401 and in my transmitter and receiver the Rx is not blinking and Tx is blinking; why does Rx not blink?
I did a search on the meaning of RX and TX and it seems TX means sending data and RX means receiving data.
So when my transmitter is turned off, my receiver looks like this and it works with a battery:...
2
votes
1
answer
328
views
What components can be connected to pins 0/1 (RX/TX) without preventing uploading of code?
For a robot project I am using an Arduino Uno, and am running out of pins. The simplest solution would be to use digital pins 0/1. I know this means that I won't be able to use Serial communication (...
1
vote
0
answers
105
views
I’m having trouble getting a motor to run for 10 seconds and then reverse direction every time push button is pushed down
i am brand new to arduino and was looking for a little help. i am looking to activate a motor once the button is pushed for 10 seconds and then have it stop. then the next time the button is pushed, ...
1
vote
0
answers
126
views
Motor rotates well in one direction but runs slower in other with L298N and L293d
I connected 2 motors with an L293Nn driver. When I control it with my joystick, one motor works fine (Out 1 and 2 of driver.) It rotates in one direction and the other very smoothly.
The problem ...
1
vote
1
answer
383
views
Servo keeps resetting position when there is no difference in received value?
So I'm working on a code that basically receives x and y coordinates and stores them in a variable. Whenever a coordinate is received, it goes through a conditional statement to store them in a ...
2
votes
1
answer
97
views
How to combine servo shield with peristaltic pump?
I am creating a project where I need 16+ (possibly up to 20) servos to open/close liquid flow through tubing, which in turn will be controlled by a peristaltic liquid pump (https://www.adafruit.com/...
1
vote
0
answers
33
views
Problem regarding on HC-SR04 sonar with an additional stepper and SG90 servo motor
I'm making a project based on HC-SR04 ultrasonic sensor with a stepper motor and an SG90 servo motor. I have done some conditions for my stepper motor that is given below. Now I want to include my ...
1
vote
1
answer
523
views
DC Motor not running with the L298N (Green) card
I have a DC motor connected to a L298N (Green) controller. The controller is receiving electricity but the motors aren't. This is how we wired everything
Our code:
#include <SoftwareSerial.h>
...
1
vote
0
answers
76
views
PWM and attachInterrupts issues
I'm trying to control the speed of a DC current motor with PWM.
I use an arduino UNO to send PWM signal to a mosfet Velleman vma411 to change the average tension of a my motor which is wired to ...
4
votes
2
answers
758
views
Controlling a 5V fan and ultrasonic fogger with an arduino - do I need an external power supply?
I know the whole controlling a fan with an arduino thing is getting old, but somehow I still don't get it to work. Tried to answer it based on other questions but I am too much of a newbie to ...
1
vote
1
answer
47
views
Selenoid motor not responding to NodeMCU instructions
I just start a project migrating from Arduino Uno to NodeMCU, basically this projects control some selenoid motors triggered by a website instructions. For example: if website returns 2, the motor #2 ...
1
vote
0
answers
104
views
Controlling DC motor with joystick using Arduino
I am working on modifying code to control two DC motors with a joystick using Arduino. The code I have works, but the motor accelerates very rapidly and is difficult to control. I would appreciate any ...
0
votes
3
answers
79
views
Why can't I just plug a stepper or gimbal motor (BLDC) into the ground, 5v, and analog pins of my Arduino?
I plugged a BLDC gimbal motor in to my Arduino today, and it made a very small jitter. I tried to set an analog pin for the signal pin of the motor (motor had three pins, I assumed one was power, one ...
1
vote
2
answers
155
views
stop motor instantaneous with hall sensor problem
I have a problem with stopping motor at same spot when magnet pass.. I tried to add interrupt and to make code as clean as possible but no joy so far. Any suggestions? sw will add later, just ignore..
...
1
vote
0
answers
283
views
Arduino Nano PID Controller with Potentiometer + IBT-2 Motor Control Board
I have a potentiometer connected to an analog pin A1 and would like to implement PID
Control to move a robot arm up and down based on to a given serial command. For this
to work I will need PID out ...
1
vote
1
answer
74
views
can differential drive work together with ultrasonic sensor?
I've written a sketch to drive a differential drive system, specifically - to be able to drive strait. This does work.
So I am trying to add the ability to stop when the path is blocked using US ...
1
vote
2
answers
2k
views
motor driver only works on one side:
I have 3 motor drivers and all 3 other them only seem to only work on one of the 2 sides. I have used a voltmeter to check the voltages across the each of the 2 sections on each motor driver. For all ...
1
vote
0
answers
794
views
Using L298n motor driver without jumper (Voltage Regulator)
When I am using 9V supply with motor driver and Jumper connected so the red LED was blinking but when I did the same using 9V and 15V supply removing the jumper LED didn't blink.
Neither the voltage ...
2
votes
1
answer
483
views
How to control multiple servo motors at the same time with protothreading using an I2C PCA9685 PWM board?
I'm trying to use protothreading to control two (and eventually four) servo motors over I2C using a PCA9685 PWM board.
To start, I am simply trying to sweep the two motors back and fourth at the same ...
1
vote
0
answers
353
views
How to control multiple servo motors simultaneously using protothreading?
So I'm trying to control 4 servo motors simultaneously using the Protothreads library by Ben Artin, but I am starting with 2 just to see if it works.
I have succeeded in getting two LEDs to blink at ...
1
vote
0
answers
98
views
Is there a VESC firmware implementation that runs on Arduino?
I am looking to use an Arduino in a motor control application, and have found that the VESC^ project has done some good work in this. I would like to have some fine-grain control over the motor drive, ...
1
vote
1
answer
109
views
MC33926 Brushed Motor Driver (Shield/Carrier)
How can I use a MC33926 Motor Driver like it is offered for Arduino to drive forwards, backwards with a PWM and a direction control.
The problem is that the MC33926 has Inputs IN1 and IN2 and not PWM ...
0
votes
2
answers
154
views
L298N motor controller board EN pins
For this device are the enable pins meant to be connected to PWM pins?
If so then how am I able to use this device with an arduino uno?
The uno does not have any pwm pins right?
1
vote
1
answer
231
views
How to gradually increase and decrease the speed of a motor using IR remote
I am making an IR controlled helicopter and I have the very basic part of the code done, but I don't know how to make the motor gradually increase speed. I want the motor to gradually increase speed ...
0
votes
1
answer
55
views
Unable to get readings for "Motor with Encoder"
I've posted to the DFRobot forum, who makes the FIT0186 motors, but no one seems to be replying there. So, excuse the copy pasting. It's probably an issue with the motor/encoder, but perhaps it has ...
2
votes
1
answer
142
views
Question regarding using Arduino and MIDI
I'm using an Arduino Leonardo for sending MIDI In and Out messages to Ableton Live.
Components include a Potentiometer, a Capacitive Touch Sensor, and a DC Motor, which I'm powering with a L298N Motor ...
0
votes
2
answers
237
views
Problem with DC motor
I've got a circuit with Arduino UNO Rev3, DC motor, button to switch direction of rotation and potentiometer to regulate revs. The problem is that usually when I increase voltage using potentiometer, ...
2
votes
0
answers
98
views
AccelStepper library - motor ticks when turning
When I'm using the AccelStepper library to control this closed loop stepper motor, the motor ticks when turning, maybe ~5 ticks/sec. Depending on the speed of the motor the ticks become more (at ...