Team-08 Wireless Controlled Car Project

Team members: Divakar Maurya Himanshu Kamboj Vinod Kumar

Grading Template
I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

 00 Executive Summary 00 Installation Instructions 00 User Instructions 00 Highlights 00 Theory of Operation 00 Work Breakdown 00 Future Work 00 Conclusions 00 Demo 00 Not Late Comments: I'm looking forward to seeing this.

Score: 00/100

(Inline Comment)

Executive Summary
Introduction to Project: The goal of this project is to create a Wirelessly Controlled Car using DC motors interfaced with beaglebone/pi/.. It will be controlled from any Input device (for our demonstration, let it be a keyboard). The Control signals will be sent over WiFi.

Working parts: All the hardware parts such as DC motor ,raspberry pis,motor driver,aurduino are working,sensors are working fine. and software parts interfacing the touch screen to car and user interface on touch screen and interaction of car with touch screen are working fine.

Not Working Parts: Since,We have implemenetd the all the features of our project.We don't think there is any part(which is not working) in our project. Conclusion: It has been a great experience to assemble all the required parts (whatever we have till now) and then to decide over the parts which we may be needing immediately or when if something goes wrong.Also move the car with a touch screen.

Instalment Instructions
1.Purchase the appropriate Hardware components such as          car Chasis             1

DC motor              2

L298D motor driver    2

aurduino(mega)        1

leds

power source(3.3 v)   2

raspberry pi          2

touch screen          1

SD Card               2

2.Install Raspbian OS on two sd following the instruction given in installation instruction section.

3.Install the Tkinter package on one raspberry pi (which is connected to touch screen say it 'A').

4.Write the program to appear button on touch screen and interacting client code.(our code https://github.com/vinodkgupta96/Project/blob/master/7button.py).

5.Write code for server side interaction on second Pi.(https://github.com/vinodkgupta96/Project/blob/master/server.py)

6.follow the setup.py file on github.(https://github.com/vinodkgupta96/gitLearn/blob/master/setup.sh)

7.Follow the User Intstruction on this wiki page.

Packaging
The total photos of making this can be found here:

Above_Samplephotos_of_process_can_be_found_here source :[|[Source]]

These are the essential photos in our project work:

















Installation Instructions
Give step by step instructions on how to install your project.

Installing Raspbian on Raspberry PI

DOWNLOAD THE IMAGE

Official images for recommended Operating Systems are available to download from the Raspberry Pi website: raspberrypi.org/downloads

Alternative distributions are available from third party vendors.

After downloading the .zip file, unzip it to get the image file (.img) for writing to your SD card.

For Linux:

1.Please note that the use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instructions below you could delete your primary Linux partition. Please be careful.

2.Run df -h to see what devices are currently mounted.

3.If your computer has a slot for SD cards, insert the card. If not, insert the card into an SD card reader, then connect the reader to your computer.

4.Run df -h again. The new device that has appeared is your SD card. The left column gives the device name of your SD card; it will be listed as something like /dev/mmcblk0p1 or /dev/sdd1. The last part (p1 or 1 respectively) is the partition number but you want to write to the whole SD card, not just one partition. Therefore you need to remove that part from the name (getting, for example, /dev/mmcblk0 or /dev/sdd) as the device for the whole SD card. Note that the SD card can show up more than once in the output of df; it will do this if you have previously written a Raspberry Pi image to this SD card, because the Raspberry Pi SD images have more than one partition.

5.Now that you've noted what the device name is, you need to unmount it so that files can't be read or written to the SD card while you are copying over the SD image.

6.Run umount /dev/sdd1, replacing sdd1 with whatever your SD card's device name is (including the partition number).

7.If your SD card shows up more than once in the output of df due to having multiple partitions on the SD card, you should unmount all of these partitions.

8.In the terminal, write the image to the card with the command below, making sure you replace the input file if= argument with the path to your .img file, and the /dev/sdd in the output file of= argument with the right device name. This is very important, as you will lose all data on the hard drive if you provide the wrong device name. Make sure the device name is the name of the whole SD card as described above, not just a partition of it; for example sdd, not sdds1 or sddp1; or mmcblk0, not mmcblk0p1.

9.dd bs=4M if=2015-09-24-raspbian-jessie.img of=/dev/sdd Please note that block size set to 4M will work most of the time; if not, please try 1M, although this will take considerably longer.

10.Also note that if you are not logged in as root you will need to prefix this with sudo.

11.The dd command does not give any information of its progress and so may appear to have frozen; it could take more than five minutes to finish writing to the card. If your card reader has an LED it may blink during the write process. To see the progress of the copy operation you can run pkill -USR1 -n -x dd in another terminal, prefixed with sudo if you are not logged in as root. The progress will be displayed in the original window and not the window with the pkill command; it may not display immediately, due to buffering.

12.Instead of dd you can use dcfldd; it will give a progress report about how much has been written.

13.You can check what's written to the SD card by dd-ing from the card back to another image on your hard disk, truncating the new image to the same size as the original, and then running diff (or md5sum) on those two images.

14.The SD card might be bigger than the original image, and dd will make a copy of the whole card. We must therefore truncate the new image to the size of the original image. Make sure you replace the input file if= argument with the right device name. diff should report that the files are identical.

d15.d bs=4M if=/dev/sdd of=from-sd-card.img truncate --reference 2015-09-24-raspbian-jessie.img from-sd-card.img diff -s from-sd-card.img 2015-09-24-raspbian-jessie.img 16.Run sync; this will ensure the write cache is flushed and that it is safe to unmount your SD card.

17.Remove the SD card from the card reader


 * https://github.com/vinodkgupta96/gitLearn/ This is github repositry for detailed description of this project.


 * there is extra hardware aurdino needed,for more details https://www.arduino.cc/en/Guide/HomePage

User Instructions
1.run setup icon and button will appear on touch screen side

2.then setup icon on car side

3.press FORWARD button move the car Forward direction.

4 press BACKWARD button move the car Backward direction.

5 press Speed Up button to speed up the car's speed.

6 press Speed DOWN buttonto speed down the car's speed.

7 press LEFT button move the car left direction.

8 press RIGHT button move the car in right direction.

9 press HORN button to blow the horn.

Highlights
What Our project can do and its possibilty in future.


 * 1) This car can be controlled from any loaction in the world.
 * 2) This car can be used for the surveillance system if it is connected with camera.
 * 3) We can use as a vehicle for carrying the small load such as picking the garbage from one location to throw somewhere.
 * 4) Ease of control: As it is controlled by touch screen which can be placed anywhere even in pocket.There is also possiblity to interface this car with leap motion Which can be controlled by only the motion of hands.
 * 5) we can take service for regular work such watering the flowers daily (we need to such reprogram it ).

Here is youtube videos

YouTube demo1.

YouTube demo2.

Theory of Operation
high level overview of the structure of your software

Raspbian Operating System Raspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware. An operating system is the set of basic programs and utilities that make your Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over 35,000 packages, pre-compiled software bundled in a nice format for easy installation on your Raspberry Pi.

The initial build of over 35,000 Raspbian packages, optimized for best performance on the Raspberry Pi, was completed in June of 2012. However, Raspbian is still under active development with an emphasis on improving the stability and performance of as many Debian packages as possible.

Note: Raspbian is not affiliated with the Raspberry Pi Foundation. Raspbian was created by a small, dedicated team of developers that are fans of the Raspberry Pi hardware, the educational goals of the Raspberry Pi Foundation and, of course, the Debian Project.


 * 1) source https://www.raspbian.org/

Tkinter

Tkinter is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk.

Tkinter is not the only GuiProgramming toolkit for Python. It is however the most commonly used one. CameronLaird calls the yearly decision to keep TkInter "one of the minor traditions of the Python world."

The Tkinter wiki: http://tkinter.unpythonic.net/wiki/

No we are not using Gstreamer.

Yes,multiple task is running.

This is what they do and this is how they interact.

Here is the summary of the key functions from socket - Low-level networking interface:

1.socket.socket: Create a new socket using the given address family, socket type and protocol number.

2.socket.bind(address): Bind the socket to address.

3.socket.listen(backlog): Listen for connections made to the socket. The backlog argument specifies the maximum number of queued connections and should be at least 0; the maximum value is system-dependent (usually 5), the minimum value is forced to 0.

4.socket.accept: The return value is a pair (conn, address) where conn is a new socket object usable to send and receive data on the connection, and address is the address bound to the socket on the other end of the connection. At accept, a new socket is created that is distinct from the named socket. This new socket is used solely for communication with this particular client.

For TCP servers, the socket object used to receive connections is not the same socket used to perform subsequent communication with the client. In particular, the accept system call returns a new socket object that's actually used for the connection. This allows a server to manage connections from a large number of clients simultaneously.

5.socket.send(bytes[, flags]): Send data to the socket. The socket must be connected to a remote socket. Returns the number of bytes sent. Applications are responsible for checking that all data has been sent; if only some of the data was transmitted, the application needs to attempt delivery of the remaining data.

6.socket.colse: Mark the socket closed. all future operations on the socket object will fail. The remote end will receive no more data (after queued data is flushed). Sockets are automatically closed when they are garbage-collected, but it is recommended to close them explicitly. Note that the server socket doesn't receive any data. It just produces client sockets. Each clientsocket is created in response to some other client socket doing a connect to the host and port we're bound to. As soon as we've created that clientsocket, we go back to listening for more connections.

Work Breakdown
Software Part: 1.Installed the Raspbian OS for two raspberry pi.Both raspberry pis are having different configuration. Because of we need only one touch screen for one raspberry pi(demand of project). (done by Vinod Kumar)

2.Created the 9buttons on using Tkinter package avialable for python 2.7-3.1 .(done by Vinod Kumar)

3.We have connected the car (server) and touch screen with pi (client ) to remote wifi (router).(done by Vinod Kumar)

4.We interaacted the car with touch screen ,both are connected with same wifi.(done by Vinod Kumar,Himanshu Kamboj)

Hardware Part:

1.Connected the DC motor with Car Chasis. ( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar)

2.Controlling the DC Motor with L298D motror drive.( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar)

3.Interface the driver with aurduino(mega).( done by Divakar Maurya,Himanshu kamboj)

4.Connecting the touch screen with raspberry pi.( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar)

5.Controlling the output coming from touch screen to car via wifi.( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar)

6.connecting with sensors.( done by Divakar Maurya)

Assembly of Hardware and Software Part:

1.Integrated the Touch screen with button and client side socket program.( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar)

2.Integrated the car with server side socket programming in order to take the input coming from touch screen.( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar) 3.Tested the Car with appropriate input and output.( done by Divakar Maurya,Himanshu kamboj,Vinod Kumar)

Documentation Part:

#All the documentation from uploading the project proposal,project code image ... to making the wiki ,are done.( done by Vinod Kumar)

We have completed our promises given in Project Proposal And we have completed our Project less than the expected week.

Future Work
As we have fufilled our Project Proposal.There is no any remaining part.But still we can add or modify in order to acheive the eficincy and features

1.We can use advanced version of touch screen instead of using capactitive touch screen for better sensitivity.

2.There is extra feature ,can add to control the car using leap motion sensor.

3.The car can not only be run on ground but also can move in air(as we do quad copter ).

4.The car can also be run on a trajectory(for example Parabolic path).

5.The car can be used in daily work (watering the flower daily ).Just need to reprogram it.

Conclusions
After Completing the Our project We concluded various things:

1.We learnt how to select appropriate hardware components(keeping in mind for future use in project).

2.We didn't expect that some small parts are very important in order to complete the project.

3.There was also short circuiting due to we lost the component.Stiil we stand by our project and its proposed features.

4.We learnt how to interact two machine using router.

5.We also got the idea of socket progarming and various protocol while implememting this.

6.Over all ,We got strength to work in group and assign the work individually oor in group to complete within time.