Sticks, Threads and WIFI - RC Car

by Killmyfeel in Circuits > Remote Control

274 Views, 4 Favorites, 0 Comments

Sticks, Threads and WIFI - RC Car

😲 From STICKS and THREADS! Amazing DIY RC CAR 😊 Part 1 - CHASSIS
😎 STICKS, THREADS and WIFI! Amazing DIY RC CAR 🔥Part 2 - Electronics and test drive

During these New Year's holidays, I decided to please myself and my sons with a new toy - a radio-controlled car made from simple bamboo sticks.

It will be a car with an NodeMCU and Wi-Fi controlled.

Supplies

Детали.png

Rear Chassis

16.png
1.png
2.png
3.png
4.png
5.png
6.png
8.png
9.png
10.png
11.png
12.png
14.png
15.png
17.png
18.png

Just look at the images :)

Car Body

2.5.png
2.1.png
2.2.png
2.3.png
2.4.png
2.6.png
2.7.png

Just look at the images :)

Electronic Circuit

3.1.jpg

Just look at the image :)

Rear Drive

4.5.png
4.1.png
4.2.png
4.3.png
4.4.png
4.6.png
4.7.png

Just look at the images :)

Coding

5.1.png
5.2.png

I used the RemoteXY service to generate code for Arduino. Settings in the photo.

The code here:

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library 


// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include <ESP8266WiFi.h>


#include <RemoteXY.h>


// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID "rc"
#define REMOTEXY_WIFI_PASSWORD "rc123456"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 26 bytes
  { 255,2,0,0,0,19,0,16,24,0,4,176,25,28,79,9,2,26,4,48,
  1,0,7,63,2,26 };
  
// this structure defines all the variables and events of your control interface 
struct {


    // input variables
  int8_t slider_1; // =-100..100 slider position turn 
  int8_t slider_2; // =-100..100 slider position go


    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 


} RemoteXY;
#pragma pack(pop)


/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////
#include <Servo.h>
Servo myservo; 


int motorrear = D2;
int motorback = D4;


void setup() 
{
  RemoteXY_Init ();
  
  myservo.attach(16);
  RemoteXY.slider_1 = 0;
  RemoteXY.slider_2 = 0;


  pinMode(motorrear, OUTPUT);
  pinMode(motorback, OUTPUT);
  // TODO you setup code
  
}


void loop() 

  RemoteXY_Handler ();
  
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay() 
  int ms = RemoteXY.slider_1*8+1500;
  myservo.writeMicroseconds(ms);


  int y = RemoteXY.slider_2;
  if (y>100) y=100;
  if (y<-100) y=-100;
  if (y>0) {
    analogWrite(motorrear, y*10);
    digitalWrite(motorback, LOW);   
  }
  else if (y<0) {
    digitalWrite(motorrear, LOW);
    analogWrite(motorback, (-y)*10);
  }
  else {
    digitalWrite(motorrear, LOW);
    digitalWrite(motorback, LOW);
  }


}

Result and Test

6.9.JPG
6.1.png
6.2.png
6.3.png
6.4.png
6.5.jpg
6.6.jpg
6.7.jpg
6.8.jpg

This is all! Thank you for your attention.

Watch the video, everything is clear and simple :)