Ethernet Controlled ROVER

2,308

33

19

Introduction: Ethernet Controlled ROVER

This is Ethernet Controlled ROVER that you can watch the images by streamingin your pc. I made this proyect for fun and as cheap as possible. I've learned very much with this proyect so I'm so happy with that.

If you liked please vote me for the first time author contest, thank you!

Step 1: Let's See the Materials

For this rover we will need:

Screw drivers

Pliers

Hot Glue

Soldering Iron and acc.

Wires for soldering https://es.aliexpress.com/item/Free-shipping-5M-10...

Drill

Step 2: Setup the Raspberry Pi

First you will have to install Raspbian into the SD card. You can follow this tutorial if you dont't know how. Python is already installed in that distro, so you won't have to worry about it.

https://www.raspberrypi.org/documentation/installation/installing-images/

Step 3: Make the ROVER Chasis and Cam Turret

My chasis and turret is made of wood because I don't have any 3D printer and I wanted to make this proyect as cheap as posible. First we will draw the shape of the body, as long as you want, I did more big than needed to possibly add future expansion and develope it more.

After you draw the base to include motors, turret, Rpi, etc... make sure to mark the holes that you will drill for fix all the components to the base.

After that let's desing the turret to hold the camera. I did a 2 axis turret but if you want to simplify it you can just do it of one axis. I glued the servo's "arms" to the wood in wich I drilled a hole to attach it to the servo.

Then you fix the servo to the board on the position you want. I did without glue because the future modifications I'lll realise.

Step 4: Schematic

It's importand to solder properly all the components because when you put it all on the base it will move so maybe connections can get broken. In the step down regulador I use a USB that is regulated at 5V an includes a voltimeter. I use that because is much easiest and you don't need to calibrate it.

Yoy can use any transistor that you want because is very low current, just two leds. I would have put a white led stripe so It would have lighted more, but I just have two white leds so...

The real photo is just to make you see how messy it can get.

Step 5: Soldering Motors and Wires

We need to solder our motors, I soldered them in pairs(one pair for each side). Also we will solder the wires of the battery and conecctions for each component. Also you can so most of them by a breadboard.

Drill a hole in the wood board to pass the wires to the motor driver.

Try to put the same colour on the motor's polarity because their are connected reversed in the motor driver. If the code doesn't work fine just change the configuration of the wires.

Step 6: Setup the Arduino Code

Before put the components to the chasis I configued them to work properly to see if the wiring is okay, the directions are okay, the turret works properly, etc...

In this step you can load the code in the arduino and you won't have to do any more with this.

My controlls are:

f->foward

s->back

d->turn right

a->turn left

q->stop

o->lights on

u->lights off

i & k ->Y axis of webcam

j & l ->X axis of webcam

Step 7: SSH to Raspberry to Control Rover

With SSH enabled we will be able to configure our raspberry from another PC. If it isn't enabled you use the raspberry in the monitor and write in the terminal "sudo raspi-config"

Step 8: MJPG Streamer

We will use this program to stream the video from the webcam connected to the Raspberry. You can install this on raspberry

$ ls -l /dev/video*

If any webcam is detected, it's not connected or compatible

$ sudo apt-get install libjpeg8-dev
$ sudo apt-get install imagemagick $ sudo apt-get install subversion

Now we creater a folder

$ mkdir mjpg
$ cd mjpg
$ svn co  https://svn.code.sf.net/p/mjpg-streamer/code/mjpg... mjpg-streamer

$ cd mjpg-streamer
$make

And after this it should be installed, you write on the navigator "Raspberry'sIP:8080"(not literally)

Step 9: Some Python Scripts for the Rpi

On the mjpg-streamer folder you write

nano control.py

It will open a text editor, then you paste this into that file. Yoy maybe need to change the address of your arduino.

import tty
import sys import termios import serial import os arduino = serial.Serial('/dev/ttyUSB0' , 9600) #maybe the addres of your arduino can be ACM0 orig_settings = termios.tcgetattr(sys.stdin) tty.setraw(sys.stdin) x = 0 while x != chr(27): # ESC x=sys.stdin.read(1)[0] arduino.write(x) termios.tcsetattr(sys.stdin, termios.TCSADRAIN, orig_settings)

Step 10: Fix Components to the Board

Fix the arduino, motor driver, Rpi, servos, motors... Then do all the connections, try with the arduino if motor drivers and the directions of motors and servos are okay. Put the wheels on the motors. After this connect the raspberry with the camera on the turret.

Step 11: Use It!

From a pc make the ssh connection. Go to the folder mjpg-streamer. In other terminal do the same.

In one terminal write

control.py

In the otherone

./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -y" -o "./output_http.so -w ./www"

Then open your favorite navigator and put the raspbery's IP followed by :8080

And just have fun!

First Time Author Contest

Participated in the
First Time Author Contest

Be the First to Share

    Recommendations

    • Make It Bridge

      Make It Bridge
    • Big and Small Contest

      Big and Small Contest
    • For the Home Contest

      For the Home Contest

    19 Comments

    0
    dimonbikon
    dimonbikon

    8 months ago

    This Problem Now i have ((((\

    Help me plz !

    Screen Shot 2022-08-02 at 1.56.59 PM.png
    0
    dimonbikon
    dimonbikon

    8 months ago

    Hello
    I do it But now have this problem

    Traceback (most recent call last):
    File "/home/pi/bot/control.py", line 15, in <module>
    arduino.write(x)
    File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 598, in write
    d = to_bytes(data)
    File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 65, in to_bytes
    raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
    TypeError: unicode strings are not supported, please encode to bytes: 'w'

    0
    AjinkyarajA
    AjinkyarajA

    4 years ago

    I am interested in making this project .I have some questions regarding this project and i want to know which resistor have you used? I am also interested in adding steering mechanism to this project so can you help me with that ? and also can i use arduino uno in place of arduino nano?

    0
    AjinkyarajA
    AjinkyarajA

    Reply 4 years ago

    and how did you connect two servos into one?? can you show me like a pin diagram for that??

    0
    NightWingGucci
    NightWingGucci

    5 years ago

    so u control using the key board and see through the webcam on the montar

    0
    dimonbikon
    dimonbikon

    5 years ago

    Does not work ! write to me on the post please bikovskiy@yandex.ru

    0
    dimonbikon
    dimonbikon

    5 years ago

    Good

    If you do not find me on Skype, give your login, I'll add you.

    Thank you so much.

    0
    dimonbikon
    dimonbikon

    5 years ago

    but if I use for video motion

    then how to set up only a part with drivers?

    how to set up a python?

    On the mjpg-streamer folder you write

    nano control.py

    if I use for video motion i dont have mjpg-streamer folder

    What to do with this step?

    Thank you.

    0
    manu2022
    manu2022

    Reply 5 years ago

    You have to open a new terminal on the master PC and execute that file. Tell me how are you planning to control your rover. What OS are you using on master PC?

    0
    dimonbikon
    dimonbikon

    Reply 5 years ago

    In general, I'm interested in the machine control part

    How to make control via python with keyboard buttons

    Move forward back to the left in the right and turn on the light to turn it off.

    And I'll make a video with motion

    0
    manu2022
    manu2022

    Reply 5 years ago

    The python script takes all characters introduced by keoboard and send it to the arduino board by serial comunication.

    0
    dimonbikon
    dimonbikon

    5 years ago

    I can execute the command

    sudo svn co https: //svn.code.sf.net/p/mjpg-streamer/code/mjpg ... mjpg-streamer

    but after execution nothing happens and no directory or file is created

    0
    manu2022
    manu2022

    Reply 5 years ago

    Are you doing that as sudo? It should work, but I did that long time ago so I dont remember very well. If you still having problems I'll try to find out how to help you!

    0
    dimonbikon
    dimonbikon

    5 years ago

    Hello

    It's very good project

    Tell me how to do it so that you can connect not only from the local network?

    Thank you!

    0
    manu2022
    manu2022

    Reply 5 years ago

    Well, you will have to use a service like NO-IP or make the raspberry a real server with a public IP, I think the last thing can be made using apache but i am not sure.

    0
    dimonbikon
    dimonbikon

    5 years ago

    Can you help?

    How to make it possible to connect and control not only from the local network with minimal loss of speed?

    0
    DIY Hacks and How Tos

    Awesome DIY remote controlled car. I need to make one of these for my son.

    0
    manu2022
    manu2022

    Reply 5 years ago

    Cool I hope that it likes to your child. If you have any doubt just ask me!