Ethernet Controlled ROVER

by manu2022 in Circuits > Raspberry Pi

2647 Views, 33 Favorites, 0 Comments

Ethernet Controlled ROVER

Portada.JPG
IMG_2500.JPG
IMG_2491.JPG
IMG_2508.JPG

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!

Let's See the Materials

P8100144.JPG
P8100145.JPG
P8100152.JPG
batery.jpg
serveimage.jpeg

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

Setup the Raspberry Pi

rpi.png

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/

Make the ROVER Chasis and Cam Turret

IMG_20170825_203551.jpg
IMG_2472.JPG
IMG_2473.JPG
IMG_2468.JPG
IMG_20170826_190057.jpg

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.

Schematic

Esquema.PNG
IMG_2495.JPG

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.

Soldering Motors and Wires

P8250154.JPG
IMG_20170825_201310.jpg
IMG_2474.JPG
IMG_20170825_203323.jpg
P8250157.JPG

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.

Setup the Arduino Code

Captura.png
Captura de pantalla de 2017-08-11 01-09-22.png

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

SSH to Raspberry to Control Rover

Captura de pantalla de 2017-08-11 01-26-34.png
Captura de pantalla de 2017-08-26 01-33-31.png
Captura de pantalla de 2017-08-26 01-31-58.png

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"

MJPG Streamer

serveimage.png
IMG_2503.JPG

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)

Some Python Scripts for the Rpi

python.png
IMG_20170826_190057.jpg

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)

Fix Components to the Board

IMG_2509.JPG
IMG_2505.JPG
IMG_2486.JPG
IMG_2475.JPG

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.

Use It!

IMG_2510.JPG
IMG_2502.JPG
IMG_2501.JPG
IMG_2496.JPG
IMG_2498.JPG

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!