- I wrote here earlier but now I really don´t know what to do.
First of all, couple words about my project. It should be automatic/robotic bartender, You will choose some drink and it ll prepare it for you.
-
There are 3 stepper motors (Nema 17 17HS4401), one for x axis and other two are connected together for y axis (I will post a link to video)
-
Arduino Uno R3, Motor Shield L293D, 2x DRV8825 motor driver, 8xAA batteries, old PC source 300W, bluetooth HM-10, 12V battery from Accu-Drill
-
So when I started working on this project I used Motor Shield L239D (now I know that it´s just for 600mA and these motors has 1.7A) it worked but microchipsets were little bit overheated.
-
I decided to control my program/motors via bluetooth mobile (digital pin 4TXD and digital pin 5RXD) and mobile app (Serial Bluetooth Terminal 1.12) but two problem appeared:
- Somehow I managed to communicate with PC → Mobile , Mobile → PC but when I wanted to use motor, where u must define AF_Stepper motor1(48, 2); , that second number 2 makes problems.
- It´s pin, on which side u have connected motor (there are just 1 and 2).
- When I compilated code It should write “Ready” on Serial monitor and mobile bluetooth serial monitor but instead just random characters showed up.
- When I use (48, 1); everything is “all right.”
- So where is the problem here ?
- Even if I used (48, 1) and there wasn´t any problem in communication I can´t move with the motor, I used If, Switch, While and nothing works. If I type “1” on Mobile on PC it just show Drink is ready but motor does nothing. I don´t know where I´ve made mistake.
#include <SoftwareSerial.h>
#include <AFMotor.h>
AF_Stepper motor1(48, 1);
#define serialRx 4 //RX PIN NUMBER
#define serialTx 5 //TX PIN NUMBER
SoftwareSerial BTSerial(serialRx,serialTx);
void setup() {
Serial.begin(9600);
Serial.println("Ready");
BTSerial.begin(9600);
BTSerial.println("Ready");
motor1.setSpeed(250);
}
void loop() {
//From Phone to PC (SerialMonitor)
int inChar ;
if (BTSerial.available()) {
inChar = BTSerial.read();
}
switch(inChar){
case '1':
Serial.println("Drink is ready");
motor1.step(300, FORWARD, INTERLEAVE);
motor1.release();
delay(500);
break;
case '2':
Serial.println("Drink isn´t ready");
break;
}
//From PC to Phone
if(Serial.available()) {
BTSerial.write(Serial.read());
}
}
I think I´ve connected my bluetooth module right, i checed it milions times, and module shouldn´t be broken, in that case wouldn´t work at all. Motors are also working I tried run them separately from Bluetooth communication.
After all of this one guy suggested me to buy DRV8825 motor driver, but I have no idea how to connect it with the motor, I saw a lot of tutorials and so on but somehow nothing works, especially I don´t know how to connect A1 A2 B1 B2 with motor so maybe there is problem
Below are all needed link and so on
Sorry for my broken English ._.