Back

Comments 31

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car almost 4 years ago

    Connections between NodeMCU and L298N are described in #define rows of the code.
    Or wait for my next project.

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car almost 4 years ago

    #define ENA 14 // Enable/speed motors Right GPIO14(D5)
    #define ENB 12 // Enable/speed motors Left GPIO12(D6)
    #define IN_1 15 // L298N in1 motors Right GPIO15(D8)
    #define IN_2 13 // L298N in2 motors Right GPIO13(D7)
    #define IN_3 2 // L298N in3 motors Left GPIO2(D4)
    #define IN_4 0 // L298N in4 motors Left GPIO0(D3)

    #include <ESP8266WiFi.h>
    #include <WiFiClient.h>
    #include <ESP8266WebServer.h>

    String command; //String to store app command state.
    int speedCar = 800; // 400 - 1023.
    int speed_Coeff = 3;

    const char* ssid = "NodeMCU Car";
    ESP8266WebServer server(80);

    void setup() {

    pinMode(ENA, OUTPUT);
    pinMode(ENB, OUTPUT);

    pinMode(IN_1, OUTPUT);
    pinMode(IN_2, OUTPUT);
    pinMode(IN_3, OUTPUT);
    pinMode(IN_4, OUTPUT);

    Serial.begin(115200);

    // Connecting WiFi

    WiFi.mode(WIFI_AP);
    WiFi.softAP(ssid);

    IPAddress myIP = WiFi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(myIP);

    // Starting WEB-server
    server.on ( "/", HTTP_handleRoot );
    server.onNotFound ( HTTP_handleRoot );
    server.begin();

    }

    void goAhead(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar);
    

    }

    void goBack(){

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
    

    }

    void goRight(){

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar);
    

    }

    void goLeft(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
    

    }

    void goAheadRight(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar/speed_Coeff);
    
      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar);
    

    }

    void goAheadLeft(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar/speed_Coeff);
    

    }

    void goBackRight(){

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar/speed_Coeff);
    
      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
    

    }

    void goBackLeft(){

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar/speed_Coeff);
    

    }

    void stopRobot(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);
    
      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
    

    }

    void loop() {
    server.handleClient();

      command = server.arg("State");
      if (command == "F") goAhead();
      else if (command == "B") goBack();
      else if (command == "L") goLeft();
      else if (command == "R") goRight();
      else if (command == "I") goAheadRight();
      else if (command == "G") goAheadLeft();
      else if (command == "J") goBackRight();
      else if (command == "H") goBackLeft();
      else if (command == "0") speedCar = 400;
      else if (command == "1") speedCar = 470;
      else if (command == "2") speedCar = 540;
      else if (command == "3") speedCar = 610;
      else if (command == "4") speedCar = 680;
      else if (command == "5") speedCar = 750;
      else if (command == "6") speedCar = 820;
      else if (command == "7") speedCar = 890;
      else if (command == "8") speedCar = 960;
      else if (command == "9") speedCar = 1023;
      else if (command == "S") stopRobot();
    

    }

    void HTTP_handleRoot(void) {

    if( server.hasArg("State") ){
    Serial.println(server.arg("State"));
    }
    server.send ( 200, "text/html", "" );
    delay(1);
    }

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car almost 4 years ago

    Hi, thanks. This is the code for almost the same car (my next project), but with one L298N (NodeMCU + L298N)

  • Arduino Mega Chess almost 4 years ago

    This is a great project!

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car almost 4 years ago

    Look for the Code Chapter and click under WiFi_Robot4_arduinoUno.ino (on the left side). There will be WiFi_Robot4_NodeMCU_ESP8266.ino

  • Smartphone Controlled Arduino 4WD Robot Car almost 4 years ago

    Use the Port indicated as COM (TX RX - +)

  • Smartphone Controlled Arduino 4WD Robot Car almost 4 years ago

    It is no difference for the code: do you use sensor shield or not

  • Smartphone Controlled Arduino 4WD Robot Car almost 4 years ago

    You have to disconnect Tx and Rx pins while uploading the code. And connect Tx and Rx after uploading. Maybe that is the reason.

  • Smartphone Controlled Arduino 4WD Robot Car almost 4 years ago

    There are too many reasons for this error. Some of them:
    - bluetooth module is connected to arduino board (Tx, Rx wires)
    - wrong COM port is selected (IDE does not see Arduino board)
    - Arduino drivers are not installed properly´╗┐
    - ...

  • Smartphone Controlled Arduino 4WD Robot Car almost 4 years ago

    Buzzer works simply being connected to GND and +5v.
    I have not a source code of the app. I found it on the Play Market

  • Fidget Spinner RPM Counter about 4 years ago

    no problem!

  • Fidget Spinner RPM Counter about 4 years ago

    Maybe it is necessary to adjust the contrast of LCD (R2 10kOhm on diagram)

  • Fidget Spinner RPM Counter about 4 years ago
  • Fidget Spinner RPM Counter about 4 years ago

    Hi! I have already disassembled this project. Arduino Uno board is used in another one. The wiring diagram is fully consistent with the project.
    P.S. I forgot to draw on the diagram LED and resistor 220 Ohm (LED indication is for convenience)

  • Copy Of Fidget Spinner RPM Counter about 4 years ago

    Well done! Does it work better with two sensors?

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car about 4 years ago

    In Tools menu check:
    - Board: NodeMCU 1.0
    - Upload Speed: 115200

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car about 4 years ago

    Ok!

  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car about 4 years ago
    1. The NodeMCU is 5v tolerant.
    2. ???
  • From BT To WiFi: Creating WiFi Controlled Arduino Robot Car over 4 years ago
  • Fidget Spinner RPM Counter over 4 years ago

    If you mean
    boolean countFlag = LOW;
    I thinked that LOW equals 0 (zero) and false equals 0 (zero) and there is no difference

  • Fidget Spinner RPM Counter over 4 years ago

    Thanks! Can you write your question in English? without Google Translate

  • Fidget Spinner RPM Counter over 4 years ago

    Hola de Ucrania!

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    If I had L293D Motor Driver board, I would have write the code.
    sorry

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    // Testing Scetch:

    #include <AFMotor.h>

    AF_DCMotor motor(2, MOTOR12_64KHZ);
    void setup() {
    Serial.begin(9600);
    Serial.println("Motor test!");
    motor.setSpeed(200);
    }

    void loop() {
    Serial.print("tick");
    motor.run(FORWARD);
    delay(1000);
    Serial.print("tock");
    motor.run(BACKWARD);
    delay(1000);
    Serial.print("tack");
    motor.run(RELEASE);
    delay(1000);
    }

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    Motors are connected to contacts M1, M2, M3 and M4. Then you have to use library <AFMotor.h>.

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    DC motors or servo motors?

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    How many motors are you planning to use?

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    send me a list of components and details you have at the moment and I will try to make a scetch for you

  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago
  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago
    1. Try https://www.instructables.com/
    2. 2 MB 1 - for connecting Motor 2 .+ v - power for motors "+" and "-" 1 MA 2 - for connecting Motor 1
  • Smartphone Controlled Arduino 4WD Robot Car over 4 years ago

    A1, A2 - inputs from microcontroller for motor 1; B1, B2 - inputs from microcontroller for motor 2; ENA - enable motor 1, ENB - enable motor 2. If ENA and ENB +5v - motors full speed, if ENA and ENB +2.5v - motors half speed and so on. If ENA and ENB 0v - motors stop. ENA, ENB - PWM inputs from microcontroller

    For example:
    A1 A2 ENA Function
    High High Low Turn Anti-clockwise (Reverse)
    High Low High Turn clockwise (Forward)
    High High High Stop
    High Low Low Stop
    Low X X Stop

Add projectSign up / Login