Sei sulla pagina 1di 11

instructables

Raspberry Pi Wifi Controlled Video Streaming Robot

by Arduino Tech

Ever thought about building a cool robot with a camera on it ? Well, you came to the right place, I will show you
step by step about how to build this robot.

With this you can go ghost hunting at night by controlling and seeing the video feed on your computer or drive it
outside and just explore while sitting inside, it is very fun to drive.

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 1


Step 1: Materials Required

1. Raspberry Pi 8. 9v Battery or a Battery Pack (If you are using a 9v


battery then I would recommend to connect 2 in
2. USB WiFi Adapter (If you are using raspberry pi 2) parallel)

3. USB Webcam 9. A Switch

4. SD Card with Raspbian installed 10. Breadboard or PCB if you prefer to solder

5. Power Bank 11. M/M and and M/F Jumper wires

6. Robot Chassis with Motors (I used 300 rpm Tools


motors)
1. Soldering Iron
7. L293D IC or L298 Motor Driver
2. Screwdriver

3. Double Sided Tape

3
5 6
2
1
4

1. 9v battery (2 in parallel)
2. Webcam
3. USB wifi adapter
4. Breadboard with L293D
5. Power Bank
6. Raspberry Pi
7. Switch

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 2


Step 2: Assembling the Chassis

Solder wires onto the motors and mount the motors on the chassis. If you don't have a soldering iron then you can
twist the wires and attach them with electrical tape but it is not recommended as it will be quite a weak joint.

Step 3: Preparing the Raspberry Pi

1. Install Raspbian on a SD Card and boot raspberry 7. The other things I did was to change the resolution
pi with a monitor, keyboard, mouse, wifi adapter and to 720p instead of 480p and search for
webcam connected. "stream_maxrate" and change it to 3. To achieve a
higher fps in streaming I also overclocked the Pi to
2. From the raspi-config menu enable ssh 1ghz

3. Go into the desktop and connect to your wifi TROUBLESHOOTING


network from the wifi option on the top right corner
When I tried to run the code in terminal with the
4. Once connected check your Pi's ip address by command "cd Videos"(Because that's where I saved
typing ifconfig in the terminal it) then "python pi_robot.py" it said syntax error so
what I did was open the code in terminal with the
5. Open IDLE 2 from the programming tab from the command "sudo nano pi_robot.py" and erased the
taskbar and copy the code pi_robot and save it lines that already written in python and are not a part
of the code and after that it worked. I don't know what
6. To install the webcam I want you to watch this was wrong so if anyone knows I would be happy to
video made by Anand Nayyar hear an explanation about this in the comments.

https://www.youtube.com/watch?v=BeyBu-Mzeq4

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 3


Download
http://www.instructables.com/ORIG/FNV/NE86/J9SW3U8I/FNVNE86J9SW3U8I.txt

Step 4: Circuit

The circuit is pretty simple and it gets even simpler if you use a L298 motor driver board. If you are using a L298
motor driver board then you just have to wire the gpio pins like in the second schematic.

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 4


1

1. L293D

Step 5: Mounting Everything on the Chassis

Well the pictures tell pretty much everything about how I have assembled it but of course yours will be different if
you use a different chassis. I used double sided foam tape to mount everything on the chassis and try to use
shorter wires so , it looks better.

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 5


Step 6: How to Operate It

To start controlling your robot follow the following 4. Now go back to the terminal and locate where you
steps - had saved your pi_robot.py file. I had saved it in the
Videos folder, so the command is,"cd Videos" then
1. Switch on the Raspberry Pi but do not flip on the "python pi_robot.py". Remember, everything is case
switch that connects the battery pack to the L293D sensitive
yet
5. After that the program will start running. Now flip on
2. Connect to it through ssh using the program putty if the switch, now you should be able to control the
you are on windows robot from the arrow keys of your keyboard

3. Type in the command "sudo motion" and then open 6. Press the forward arrow and check if both the
your internet browser and type in your Pi's IP address motors are moving in the right direction. If one of the
with 8081 at the end like "192.168.45.64:8081" and motors is moving in the wrong direction then switch
you should get the video feed. If it doesn't work then the two motor connections that connect to the L293D
type 8080 instead of 8081

Picture of How to Operate It

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 6


Step 7: Controlling From a Phone

All the steps are the same, you just have download the app "JuiceSSH" from the play store. To control the robot
you need arrow keys but a normal smartphone keyboard doesn't have arrow keys so we need to download an app
Hacker's Keyboard'. Then connect to it like you did in windows.

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 7


Step 8: Some Pictures and Videos

The webcam video quality is descent but the fps is only 2 or 3. The video quality is good when outside but not
when inside. It can drive on offroad terrain but not very well, it could if you use a higher voltage to drive the motors
like with a small 12v battery.

https://www.youtube.com/watch?v=JQShKgD8tz0

https://www.youtube.com/watch?v=VHmZ7ReQUyc

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 8


https://www.youtube.com/watch?v=A139X652OaQ

1 1

1. Photo taken by the robot 1. Photo taken by the robot

Awesome project I have to make one,


Could someone please suggest some good motors for this project?
Why did you (Creator) use 300 rpm motor?
The motors i can find online for sale with 300 Rpm is pretty expensive like 320 dollars each. and
only 24 volt dc.
So i thinking there are some cheaper motors available? I can find some pretty cheap ones with
14500 Rpm with a torque of 46,2 gcm i wonder if that would do the trick?
If someone could help me out i would be grateful, since i´m rather inexperienced.

Once again awesome project, thanks for sharing

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 9


Here are a couple of links - Small Motor and a motor of the size I used OR you could buy a
complete robot chassis. Just search 'robot chassis' and you will also get many other options. Good
luck and if you liked my instructable then vote for me in the Raspberry Pi contest :)

Thanks for the help, you got a vote from me.


For some reason the hyperlinks doesn´t work? could you copy them as url is?

https://www.ebay.com/itm/Arduino-Smart-Car-Robot-Plastic-Tire-Wheel-with-DC-3-6v-Gear-Motor-
for-Robot-IU/273020303457?hash=item3f91473861:g:OEoAAOSw59VZ4IW4 ,
https://www.ebay.com/itm/4WD-Smart-Robot-Car-Chassis-Kits-W-Magneto-Speed-Encoder-For-
Arduino-51-Replace/162809513764?hash=item25e8340724:g:BxAAAOSwLdBaJoFf

Thanks a lot, much appreciated

im having an issue with this. When i connect the rasperry pi to the breadboard in the circuit shown.
the rasperry pi will not power on. no lights, just a short beep then nothing. it powers fine when not
wired up though. any help would be apprehiated. im new to this stuff

You have wired 2 of the wires in the wrong headers. Check your circuit again, if you have any more
problems just me.

Great robot! :D
How long does it run on the 9V batteries?
I've made one using an Arduino and an old smartphone. I my case I use a power bank as the
power source.
https://www.instructables.com/id/WiDC-Wi-Fi-Contro...

it runs for maybe 2 hours maybe

Thanks for the information! :)

Cool project.

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 10


Thanks

Do you have the ams 1117 module?

If you do, please bring it tomorrow.

Nice, I am planning something very similar. I would only like to have the controls withing the
(RasPi-hosted) webpage along with the cam stream. Two sliders (-100 to +100) for the two motors
plus some buttons to fire onboard LEDs. Hell, I could even mount a all boombox speaker and let
the car talk thru espeak. ;)

That being said, how do I put the php + jquery + python together? ;D

Sounds amazing but I can't help you since I have no experience in jquery and php

Well, I will either tinker it myself or order a custom script for a couple of bucks at Fiverr. Until then
ssh and keyboard will have to suffice.
One last note on this: I have a small (Measy?) BT for the Pi ... and likewise a (wireless) nunchuck
controller or gamepad is de facto a keyboard (and obviously, you could also read accelerometer
inputs from a control gauntlet. ;). I think it would be awesome to choose whether I am on a spy
mission (thus with cam stream, keyboard and flat screen) or in combat (using a more convenient
controller).

Raspberry Pi Wifi Controlled Video Streaming Robot: Page 11

Potrebbero piacerti anche