Difference between revisions of "S15: Bug Rider"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Team Members & Responsibilities)
(Software Design & Implementation)
Line 163: Line 163:
 
[[File:S15_244_BUGRIDER1_part1.jpg]]  [[File:S15_244_BUGRIDER1_part2.jpg]]
 
[[File:S15_244_BUGRIDER1_part1.jpg]]  [[File:S15_244_BUGRIDER1_part2.jpg]]
  
=== Software Design & Implementation ===
+
=== Software Design ===
 +
'''Image Processing'''
 +
 
 
The Software Design is divided into two parts. The first part of the software is running in the PC end and the second part of the software is running at the SJ One Board.  
 
The Software Design is divided into two parts. The first part of the software is running in the PC end and the second part of the software is running at the SJ One Board.  
 
The first part of the software running at the PC requires the Image Processing.
 
The first part of the software running at the PC requires the Image Processing.
Line 170: Line 172:
 
Image processing is done by using OpenCV libraries in Python.We also use NumPy (Numerical Python) Package which is used by OpenCV for image processing.
 
Image processing is done by using OpenCV libraries in Python.We also use NumPy (Numerical Python) Package which is used by OpenCV for image processing.
  
We capture the Video frames in Python by using VideoCapture() function and convert RGB image to HSV, for extracting a colored object. In HSV, it is more easier to represent a color than RGB color-space. After converting the image to HSV color-space,Image will be thresholded for a range of desired object color. Position of the image is returned by using moments() function of OpenCV library. It gives centroid of the object in terms of  (x,y) co-ordinates. By using the (x,y) co-ordinates, the position of the object is determined in the tracking window and send the SJone Board through Serial Communication.
+
We capture the Video frames in Python by using VideoCapture() function and convert RGB image to HSV (Hue-Saturation-Value), for extracting a colored object. In HSV, it is more easier to represent a color than RGB color-space. After converting the image to HSV color-space,image will be threshold for a range of desired object color. Position of the image is returned by using moments() function of OpenCV library. It gives centroid of the object in terms of  (x,y) co-ordinates. By using the (x,y) co-ordinates, the position of the object is determined in the tracking window and send the SJone Board through Serial Communication.
  
 
pySerial package provides required libraries for serial communication in python. Desired port number is set and data is send using write() function.
 
pySerial package provides required libraries for serial communication in python. Desired port number is set and data is send using write() function.
Line 178: Line 180:
 
[[File:S15_244_BUGRIDER2.jpg]]
 
[[File:S15_244_BUGRIDER2.jpg]]
  
The second part of software will be running in Sjoneboard:
+
The second part of software will be running in SJone board:
  
We use one Sjoneboard for transferring data from PC to another Sjoneboard which is used in RC car for controlling the car.
+
We use one SJone board for transferring data from PC to another SJone board which is used in RC car for controlling the car.
  
The Software which is running in the Sjoneboard which is used for transferring data through UART serial communication from PC contains a task,once the task begins executing, it waits for the serial data from the PC. On receiving the data from PC,it transfer the data to Nordic wireless function which sends the data to other Sjoneboard.
+
The Software which is running in the SJone board which is used for transferring data through UART serial communication from PC contains a task,once the task begins executing, it waits for the serial data from the PC. On receiving the data from PC,it transfer the data to Nordic wireless function which sends the data to other SJone board.
  
Flow Chart - SjOneBoard:
+
Flow Chart - SJone board:
  
 
[[File:S15_244_BUGRIDER3.jpg]]
 
[[File:S15_244_BUGRIDER3.jpg]]

Revision as of 05:37, 25 May 2015

Bug Rider

Abstract

The "Bug Rider" is robotic toy car which is ridden by the fish in the aquarium tank on top of the vehicle!!!! Confused ???

Ok ,So the fish which is placed inside the fish tank placed on top of the car will be moving in random directions and its movement is captured by the camera attached to the supporting frame of the vehicle.The movements are image-processed and the data is given to the "SJ-ONE BOARD" which in turn sends the wireless signals to the "SJ-ONE BOARD" present on the car which finally drives the car in that particular direction as the Hex-Bug's direction.

Below is the sample pictorial representation of the project.


Objectives & Introduction

We are designing a prototype version of Fish on Wheels using a Mobile Camera,RC Vehicle for holding the Fish Tank setup and Sjoneboard for controlling the vehicle.Using the contrast of the fish with the bottom of the fish tank, the position is determined and used to send commands to the Sjoneboard for moving the car into that direction. We use Image Processing in Python for determining the Position of the Fish. Nordiac Wirless is used for wireless communication between RC Vehicle and Laptop. Uart Serial Communication is used for sending commands from Python to Sjoneboard.PWM driver is used for controlling the RC Vehicle.

Team Members & Responsibilities

  • [Vishnuram Venkataswamy Sampathkumar]
    • <Image Processing Module>
  • [Krishna Sai Sevilimedu Veeravalli]
    • <Nordiac Wireless & Serial Communication>
  • [Saketh Ram Bhamidimarri]
    • <Hardware Design and Integration>
  • [Prakash Kurup]
    • <PWM Driver>

Schedule

Team Schedule
Sl. No Start Date End Date Task Status
1 03/31/2015 04/07/2015 Order required components *Completed*
2 04/08/2015 04/14/2015 Image processing for object tracking *Completed*
3 04/15/2015 04/21/2015 PWM driver and motor calibration *Completed*
4 04/22/2015 04/28/2015 Serial communication & Nordic wireless communication *Completed*
5 05/29/2015 05/05/2015 Platform design for the hexbug and building the framework to hold the camera on top *Completed*
6 05/06/2015 05/12/2015 Ultrasonic sensor for obstacle avoidance *Completed*
7 05/13/2015 05/19/2015 Integration of complete system and testing *Completed*
8 05/20/2015 05/26/2015 Final Testing and demo Scheduled

Parts List & Cost

Item# Qty Description Manufacturer Part Number Total Cost
1 1 RC Car New Bright Jeep 9.6V $60.00
2 1 Bluetooth Camera Adesso CyberTrack V10 $40.00
3 2 SJ-One Board NXP LPC1758 SJSU development board, LPC1758 $160.00
4 1 HexBug Innovation First HexBug Larva - Green color $8.96
5 1 Dual H-Bridge Motor Drive Drok L298N $8.48
6 1 Acrylic sheet Tap-Plastics Pure opaque-milky white $24.29
7 3 Camera holding rods Tap-Plastics Plastic material $ 17.40
8 2 Antennas University 10-feet range antennas $ 6.00
9 1 Double-sided tape Tap-Plastics Double sided tape for plastic material $ 5.06
10 3 Welding work and Integration of the framework Tap-Plastics Glass Fibre rods for the support frame $ 20.00
Total Cost $350.19

Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

The main components required for this project are :

(1) A Toy Car of dimensions approximately 25*12 inches which we bought from WALMART.

(2) An Acrylic sheet of dimensions 30*15 milky white color with highest opaqueness for light bought at TAP-PLASTICS.

(3) A framework consisting of vertical rods attached to the front and back of the car and a horizontal rod which can be movable on the vertical rods.The camera will be attached right at the middle of the horizontal rod. The intention of the horizontal rod sliding on the vertical rods is to adjust the height of the camera position relative to the platform.

(4) Ultra-sonic sensors attached at the front portion of the car to provide the obstacle avoidance feature to the car.

(5) The "SJ-ONE" board will be placed underneath the platform,in the slot provided for the batteries of the car.

(6) 9V batteries for Powering "SJ-ONE" board and RC Car.

(7) L298H Motor Driver for Controlling RC Car

Hardware Interface

  • The "SJ-ONE BOARD" is used for the control of DC motor and SERVO motor control using Pulse Width Modulation(PWM).
  • The DC motor and the SERVO motors are connected to the "SJ-ONE BOARD" using jumper cables.
  • An Antenna is attached to the "SJ-ONE BOARD" which is used for the communication with the other "SJ-ONE BOARD" connected to the laptop through Nordic Wireless Communication.
  • The wireless Camera attached to the horizontal section of the framework will be capturing the movement of the Hex-Bug toy and transmitting the data to the laptop via bluetooth.
  • The ultra-Sonic Sensors which are placed at the front portion of the vehicle for the obstacle-avoidance feature is connected to the "SJ-ONE BOARD" through jumper cables.
  • Below is the sample pictorial representation of the project:

S15 244 BUGRIDER1 part1.jpg S15 244 BUGRIDER1 part2.jpg

Software Design

Image Processing

The Software Design is divided into two parts. The first part of the software is running in the PC end and the second part of the software is running at the SJ One Board. The first part of the software running at the PC requires the Image Processing. Image Processing:

Image processing is done by using OpenCV libraries in Python.We also use NumPy (Numerical Python) Package which is used by OpenCV for image processing.

We capture the Video frames in Python by using VideoCapture() function and convert RGB image to HSV (Hue-Saturation-Value), for extracting a colored object. In HSV, it is more easier to represent a color than RGB color-space. After converting the image to HSV color-space,image will be threshold for a range of desired object color. Position of the image is returned by using moments() function of OpenCV library. It gives centroid of the object in terms of (x,y) co-ordinates. By using the (x,y) co-ordinates, the position of the object is determined in the tracking window and send the SJone Board through Serial Communication.

pySerial package provides required libraries for serial communication in python. Desired port number is set and data is send using write() function.

Flow Chart - Image Processing

S15 244 BUGRIDER2.jpg

The second part of software will be running in SJone board:

We use one SJone board for transferring data from PC to another SJone board which is used in RC car for controlling the car.

The Software which is running in the SJone board which is used for transferring data through UART serial communication from PC contains a task,once the task begins executing, it waits for the serial data from the PC. On receiving the data from PC,it transfer the data to Nordic wireless function which sends the data to other SJone board.

Flow Chart - SJone board:

S15 244 BUGRIDER3.jpg

Testing & Technical Challenges

My Issue #1

We faced some issues which we would like to mention and how we overcame those.

Hardware items: After the idea was finalized and the how-to-do stuff was imagined and designed,the initial problem was to where to find the materials,the hardware tools which would exactly meet the requirements of the project. After searching various hardware stores,we would a really nice place called the "TAP-PLASTICS" where the technician named Kevin was really helpful in his suggestions and the improvisations which can be used.

My Issue #2

Image Processing Module: It took some time for us to finalize the HSV platform for detecting the Fish.We initially tried converted the image to Grey Scale Platform,but we failed to track the image.Finding a Platform for Image Processing also took sometime,as we initially tried to use C++ for Image Processing Platform,but we failed to apply image processing algorithms which in future, we will work on it.

Conclusion

The whole project experience was fun and very educational. At first we thought that Image Processing algorithms are available online, so just editing them will make our project work.But we learned a hard lesson that ,lot of our time would be saved if we write our own code instead of editing them.We learned to configure and use Nordiac wireless module.We got to know how PWM Driver and Serial Communication works.

The project can be expanded by making it as an standlone project.We are learning to write a driver for interfacing the camera to the microprocessor,which soon we will be implementing in our project.

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

We,the team of Bug-Rider would like to wholeheartedly thank our friend,our guide and our Professor "Preet Pal Kang" for guiding us,encouraging us to do these projects and imparting knowledge and wisdom to us in our academics as well as for our career.Thank You "Preet".

References Used

(1) http://www.socialledge.com/sjsu/index.php?title=Main_Page

(2) https://learn.adafruit.com/series/learn-arduino

Appendix

You can list the references you used.