Introduction: RC CONTROLLER WITH CAMERA

FOR ORIGINAL DESCRIPTION, CLICK HERE

NEWER VERSION IS RELEASED V3

Version 2 is online. Click here to go to V2.

About this project?

  • Direction control via Android
  • Video streaming from RC-Car to mobile phone simultaneously
  • Follow Me (Very Soon)

Materials

  • Arduino Nano * Raspberry Pi
  • Raspberry Pi Camera Module
  • L298N Motor Drive * DC MOTOR X 2
  • 12V Lipo Battery * Car Frame (Body)

Step 1: Arduino

NEWER VERSION IS RELEASED V3

PURPOSE AND TASKS:

  • Arduino was used for motor control.
  • Arduino and Raspberry Pi were connected by serial communication.
  • Before PWM signal interval which will be sent from Android phone to Arduino don't transfer, this signal was calculated. (Because of the next updates and easily interfere to PWM variable by users.)
  • The Raspberry Pi provides the Wi-Fi communication with Arduino and the user (Android phone).
  • In the following section, we show the circuit schematic for Raspberry Pi, Raspberry Pi Camera, Arduino, L298N Motor Driver, motors and batteries.

SETTING UP ARDUINO AND PIN CONNECTION SCHEMATIC

  • Data which come to Arduino is sent as a PWM interval that go to the motors directly. There are two values `+ (forward)` or `- (backward)` for decide direction with PWM value.
  • Above-mentioned situations is considered by us, there can be made various modifications.
  • PWM interval is between` 0-255.`
  • RIGHT AND LEFT motor PWMs' and servo motor angle is taken as a String(e.g. `200:200!888`) from phone. This String value is splitted with `:` and `!` characters and created the array that has 3 elements.
  • The value after the `!` character is the servo motor's angle value which connected with camera. Servo motor is not used in this project.

Motor Moving, PWM data and situations of the car
Example:
0:0 //stop
200:200 // move forward. (2 motors work with 200pwm)
200:-200 //move backward. (2 motors work with 200pwm)
200:-200 // left motor turns 200 pwm to forward, right motor turns 200 pwm to backward (The car turns its around from left to right.)
200:-200 // left motor turns 200 pwm to backward, right motor turns 200 pwm to forward (The car turns its around from right to left.)
200:100 // The car moves as turning to the right.

https://github.com/zafersn/WiFi-RC-Controller-With-Camera/blob/master/images/wificontrol.png

  • Connections among Arduino, Raspberry pi,Raspberry pi camera module, L298N motor driver, Motors and Power Supply are set up as above picture.
  • After connected Arduino pins and Raspberry pi as above picture, we can load our codes to Arduino. That do by this sequence:
  • Detail information about Arduino codes is placed in that codes.
  • Download `androidToRaspberry.ino` file and open this file with double click.
  • For uploading that project file to Arduino, first you must select the Arduino model from `Tools => Board` menu.

https://github.com/zafersn/WiFi-RC-Controller-With-Camera/blob/master/images/ra1.png

  • Again from `Tools` menu, you must show which port plugged to Arduino board. `Tools => port`
  • After realize all steps, now you can upload the codes to Arduino board. You can complete the uploading process by pressing `Upload` button from left-up corner of the program.

https://github.com/zafersn/WiFi-RC-Controller-With-Camera/blob/master/images/ra2.png

Step 2: RASPBERRY PI:

NEWER VERSION IS RELEASED V3

PURPOSE AND MISSIONS:

  • Taking video stream with Raspberry Pi camera module and trasfer that stream to phone via Raspberry pi.
  • Connection between Arduino and Android phone.

RASPBERRY PI SETUP:

We need some additional packages for can work our application. These are;

GSTREAMER1.0 :
After connect with SSH, we must type that in order:

I. Write `sudo nano /etc/apt/sources.list` and press Enter. From coming screen;

https://github.com/zafersn/WiFi-RC-Controller-With...

II. Write `deb http://vontaene.de/raspbian-updates/ . main` command and exit the page with CTRL + O ==> Y

https://github.com/zafersn/WiFi-RC-Controller-With...

III. Write `sudo apt-get update` and get latest updates.

https://github.com/zafersn/WiFi-RC-Controller-With...

Then by turns, apply that steps:

IV. `sudo apt-get dist-upgrade`

V. `sudo reboot`

VI. `sudo apt-get install gstreamer-1.0`

https://github.com/zafersn/WiFi-RC-Controller-With...

VII.`sudo apt-get install gstreamer1.0-tools`

And after this steps, we installed gstreamer package.

SETUP MAIN FILE:

Now we install the main file of the application;

  • We are downloading our GitHub file in Raspberry pi terminal screen. git clone https://github.com/zafersn/Wi-Fi-Gstreamer-Server.git
  • Also with `ls` command with control that file. The file which we downloaded is shown as a `Wi-Fi-Gstreamer-Server` name.
  • Write `cd Wi-Fi-Gstreamer-Server` and enter in the file. You can see with `ls` command a `robotcontrolV1.pyc` named python application.
  • We need to move this file with `sudo cp robotcontrolV1.pyc /home/pi` command to our `/home/pi` directory. If you can't do this, application is not working correctly.
  • https://github.com/zafersn/WiFi-RC-Controller-With...

  • In case of skip that steps successfully, we give our first start on the Raspberry Pi manually. Because, this is useful for us to see working this application.

  • Execute the application manually: execute the program with `sudo python robotcontrolV1.pyc` command in main terminal. If you are setting up until this step successfully, you must see `Client Baglantisi Bekleniyor...` print.
  • Last, you try to conncect from Android phone to Raspberry Pi via our application.
  • If we are execute our Python code (`robotcontrolV1.pyc`) in Raspberry Pi manually, our phone's IP and port informations will appear in the screen when we connect from Android.

FOR ORIGINAL DESCRIPTION, CLICK HERE

Step 3: ANDROID

NEWER VERSION IS RELEASED V3

PURPOSE AND MISSIONS:

  • Maintaining control of RC-Car that made from Android and Raspberry Pi.
  • Simple and pure design for user.
  • Taking video stream via Raspberry Pi and show this to user.

INSTALL ANDROID APPLICATION:

  • Installing of the application is very simple. Only after enter the ANDROID GOOGLE PLAY market, you can type in searching box com.stackcuriosity.tooght or application name RC CONTROLLER WITH CAMERA for directly access to application.
  • https://play.google.com/store/apps/details?id=com....

USING THE APPLICATION AND HINTS
Raspberry Pi Connection Informations

APPLICATION DETAILS

1. EXPLAINING OF THE VISUAL DESIGN AND PROGRAMMING LOGIC

Our application rely on 3 basis. These are;


I. Provide direction control of the car.

II. Transfer live video streaming from car to user.

III. Follow Me (Vey Soon). (Following the car its owner.)
To that 3 basis;

  • Main details using direction control of the car was told in `Arduino` section. If we explain to the Android side, there will be available `Seek bar (Velocity setting)` and `Arrow keys`.
  • ![Screen Shot](images/device-2016-06-30-195734 english information.png)
  • Seek bar(Velocity setting) is created from 15 slice and velocity coefficient is 17. So any move of the Seek bar, there will be changing 17 and its multiples. For instance, If Seek bar in fifth order, produced pwm = 5*17 = 85. * Arrow keys provide seperating directions of data which take from Seek bar(Velocity setting). For moving direction of the car, `+` or `-` sign come to head of the PWM value.

For example:

200:200 // move forward. (2 motors work with 200pwm)

200:-200 //move backward. (2 motors work with 200pwm)

200:-200 // left motor turns 200 pwm to forward, right motor turns 200 pwm to backward (The car turns its around from left to right.)

200:-200 // left motor turns 200 pwm to backward, right motor turns 200 pwm to forward (The car turns its around from right to left.)

200:100 // The car moves as turning to the right.

2.SENSITIVITY IN TURNING LEFT AND RIGHT

ICON OF OUR APPLICATION:

https://github.com/zafersn/WiFi-RC-Controller-With-Camera/tree/master/images/raspi_car.png


English translator: Mustafa YEMURAL
Thanks Mr. YEMURAL


FOR ORIGINAL DESCRIPTION, CLICK HERE

Step 4: TEST VİDEO

NEWER VERSION IS RELEASED V3

Comments

author
ARAVINDH SMART (author)2016-08-23

androidToRaspberry.ino file

author
ggündüz (author)2016-10-04

güzel proje :)

author
Zafer M.Ş (author)ggündüz2016-10-06

teşekkür ederim güzel kardeşim.

author
ARAVINDH SMART (author)2016-08-23

androidToRaspberry.into send me my email: maravindh915@gmail.com

author
Mgirisankar (author)2016-07-26

Could you provide arduino code in english

author
Zafer M.Ş (author)Mgirisankar2016-07-30

Hi Mgirisankar. I have added the English description for the Arduino code.

Thanks.

author
DIY Hacks and How Tos (author)2016-07-16

Cool way to make a remote controlled camera

author

thanks my friend.I'm trying to trace the owner of the vehicle.I'll add very soon


author
gollumses (author)Zafer M.Ş2016-07-24

Thanks for posting this. Are you the builder, or is this someone else's project?

author
Mgirisankar (author)2016-07-20

Great work. I am trying to make 4*4 crawler and I need to use servos for steering . Using the servo is not possible in L298N controller. Which controller should I use for controlling 2 dc motor and a servo. Does the code should be changed.

author
kanana (author)Mgirisankar2016-07-21

Have you tried L293d controller? I think it can controll a servo and 2 dc motor.

author
Mgirisankar (author)kanana2016-07-22

Thank you .I am considering L293d for my project

author
DylanD581 (author)2016-07-17

This is a great way to make a wirelessly controlled robot.

author
Malik Al-Sharif (author)2016-07-17

Good job, But if there 360 degree cam is beter

author

Thanks Malik.Great idea

About This Instructable

4,589views

153favorites

License:

Bio: https://tr.linkedin.com/in/zafersn93
More by Zafer M.Ş:RC CONTROLLER WITH CAMERA VERSION 3 (Pi_CAR V3)RC CONTROLLER WITH CAMERA V2  (Pi_CAR V2)RC CONTROLLER WITH CAMERA
Add instructable to: