Team-08 Wireless Controlled Car Project

From eLinux.org
Revision as of 01:00, 27 November 2015 by Vinodkgupta96 (talk | contribs) (Highlights)
Jump to: navigation, search

thumb‎ Embedded Linux Class by Mark A. Yoder


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:

basic structure car chasis connected with DC motor inside it
loaded with aurduino and raspberry pi and driver
This is raspberry pi with raspbian(in SD CARD)
pi with wifi module
5 touch screen
Pi with touch screen
Another Pi connected with wifi module and SD CARD
Both raspberry pi

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

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

List the major tasks in your project and who did what.

Also list here what doesn't work yet and when you think it will be finished and who is finishing it.

Future Work

For now, we will try to operate the car sending directions over WiFi signals. Once it is completed, we may use IR sensors to avoid collisions, different coloured LEDs to tell about different ongoing processes.

Conclusions

If we are left with some time after completion of all the aforementioned processes, we will try to regulate the speed of motors in a stepped way (like gear system in Car). We are very excited about that part of project.




thumb‎ Embedded Linux Class by Mark A. Yoder