Labels

Showing posts with label Embedded software projects. Show all posts
Showing posts with label Embedded software projects. Show all posts

Saturday, 9 July 2016

Highway Monitoring System

         
                Highway Monitoring System

I have done a project which will monitor the highways traffic. it’s a pre-programmed system, if we install it on the highway roads, it will detects the number of cars that is passing and we can control the traffic lights and we can give some instructions to the travelers through display, it’s an embedded system that interface the computer vision to real time device like MCU, display and traffic light. We can further improve this project to detect the speed of the vehicle if vehicle exceeds the speed this system can note vehicle number and we can also monitor the toll gate etc.

Here in this project I just use the feature based cascade classifier to detect the vehicles. Haar cascade classifier is best and accurate feature based classifier to detect the particular objects, human beings, face etc.
 in this project i used the recorded video we can use the live stream video also.we need to import the classifier and need to write small logic to draw the shapes on the on the moving object that is recognized by HAAR classifier we can observe how through below image how the classifier is working here i took the rectangular shape around the detected object .
next we need to detect the vehicles and count them that are passing by the road. For that I wrote logic to find center point of the object and I draw a line on two roads so that if the center point of the vehicle passes by the line then count will increase.




Now it’s time to interface it with the MCU and operate the real time objects like traffic lights and display.

traffic lights:


adding display:

You’re always welcome to give me your valuable suggestion through comments, if you need more information regarding this please leave a comment so that I can answer you.

Tuesday, 5 July 2016

Face Detection


                            Face Detection

I have seen an article about the HAAR classifier .which inspires me to work on image processing. image processing nothing but convert the image and video to digital form, digital form to arrays by using these arrays with some logic we can perform some actions that can change the features of the image/video.
Haar classifier is the best and effective object detection method proposed by Paul Viola and Michael Jones. cascade function is  trained by positive and negative images.Haar classifier is developed using Haar wavelets  .this wave lets is similar to fourier transformations if you want to know more about the Haar wavelets and classifiers just open the links below:
With the knowledge of these we can make or train our own Haar classifier.

Here in this project I try to detect the face, eyes for which I use the existing classifier I found it when I Google about the classifier. We can use four edge detection rather than the classifier but it is not as accurate as Haar classifier and object detection not easy in four edge detection so I opt for haar classifier.

Let’s start our project:
Here i used the recorded video,we can use the live stream video also.we need to import the classifier and need to write small logic to draw shape on the feature that is recognized by haar classifier we can observe through below image how this classifier is working .



You’re always welcome to give me your valuable suggestion through comments, if you need more information regarding this please leave a comment so that I can answer you.



Sunday, 3 July 2016

Computer vision or image processing


         Computer vision or image processing

I have done a project which will recognize the moving objects using computer vision we can say image processing
In order to do this project we need to work on some examples like how to import the image/video and convert it to the digital form, digital form to arrays by using these arrays with some logic with required libraries we can perform some actions that can change the features of the image/video.
Let’s start:
First we need to know how to import the image/video and change the color and save image/video using open CV




Next we need to know how to draw shapes and write a text on the image /video



Now we need to learn how to decrease the noise in particular frame/image. Here I am using threshold, gaus , otus. See the difference from the original image to processed images

Now we need to work on finding the edges


We can crop the image in open CV


Now we need to detect the moving object



Finally we will detect the object by using above learned topics.here i try to detect the objects by four edge detections without using any cascading .





Thursday, 23 June 2016

DATA LOGGING OF TWO DIFFERENT SENSORS


    DATA LOGGING OF TWO DIFFERENT SENSORS

I have done data logging system using MSP430G2 and Python. In this project I tried to plot the real time graph of two sensors namely LDR (light dependent resistor) and IR (infrared sensor).
Here in this project I am using matplotlib, numpy, drawnow in the place of drawnow we can use deque for plotting live graph.

In order to do this project I need to have a good knowledge of the above mentioned libraries. So ill do some experiments with these libraries
First of all I need to know how to plot the graphs and what all the command that are required to plot the graph with our specifications.

Now ill plot a simple graph using some random values that strikes my mind..!




Now I’ll try all the different command that are related to graphs, bar charts, pie charts etc.






Now I’ll try to import the text file and read the 2 different values which are separated ‘delimiter’ from the text file and plot the graph.
Here ‘delimiter’ is single space



 Here ‘delimiter’ is coma “,”




K good! Now I got enough practice to draw the graph, next my task is to import the continuous serial values and plot the graph. Before that we need to fallow few step to attain that.
First of all I need to do check weather can I do any changes to my serial values.     




 It’s possible to do some changes to my serial values. My next task is to add the serial to one another of single sensor




K good now I can plot the graph with these continuous added values by using ‘drawnow’.first ill try to plot for single sensor.


data analysis of 2 sensors (LDR and IR)

 

here i change the plot label to there specified sensors names so that it will more understandable. 


Tuesday, 14 June 2016

Microcontroller interfacing with pygame



             Micro controller interfacing with pygame


In this project I have varied the size of the object according to the sensor values using pygame. It is a testing process for my project called “Game operating with sensors”. so let us see the output and working of this project.
I have divided this project into steps

Step1: First I need to download python along with pygame and pyserial library after that I need to
 import those libraries into python. After that I need to set the display height and width and color and caption


Step2: In this step I need to display the object.


Step3: Now I need to vary the size of the objects according to the sensor value







We can change the position too..


Monday, 13 June 2016

Game operating with sensors


                           
                               Game operating with sensors


I have developed a game which can operate with sensors. For this project I choose MSP30G2 and python
In this project I have developed a game in python and I interface it with MSP430G2 to take the sensor values and according that sensor values I just operated the game which I have developed using python.
For this project we need to install pygame. Here I need to tell you people to the develop the game  we need to have a good knowledge of logic, mathematics, programmng skills,etc. it’s a fun topic to develop game that to with our own logic isn’t it great then let us begin!
I will try to do my project in step wise

Step1: First I need to download python along with pygame and pyserial library after that I need to import those libraries into python. After that I need to set the display height and width and color and caption

Step2: Here in this step I draw the character which plays a major role in my game. As I am developing the snake game I will draw the rectangle for my snake and circle as a food for my snake.


Step3: This is the major step for entire project  i.e.,in this step my task is to move the snake according the sensor value which I am sending throw MSP430G2.


Step4: In this step I will add some rule like boundaries when my snake touches the edges of the screen the screen has to display warning


Step5: We finish with snake part now I will concentrate on food after eating the food snake has to be doubled along with we need to produce more food at random position, For this I imported random library.

Step6: Finally I need to decorate my game by adding “start screen” , “end screen” ,“pause screen” and I need to add the images of  snakehead ,apple and game icon



                             

                                                                                                                                                                                   

I have developed other games in the same way with slight difference in the logic.









I need to work more on this project because I am facing the problem while moving snake/car around using sensors may be i need to prefer more accurate sensors and i need to change some part of logic too even though it a successes for certain extent thought of sharing it with you people it may help some or the other for their project..!
But I am happy to tell you it’s working by using keyboard I will share you the executable files for windows installer with you  so that you can download it and enjoy the game..!

 How to install these games:
Step 1: download the folder and click on setup file install it

Step 2: After installing it go to the> program files(x86) as shown in the above figure>there you will find the folder called deepu game folder for snake  and racer folder for racer game as in t




 Step 3(for snake game): Now open the folder there you will find the snake game file as shown in the below picture. double click on it your game will run
 Step 3(for racer): Now open the folder ther you will find the snake game file as shown in the below picture. double click on it your game will run



finally you will get the game.play according to the instruction and enjoy..



 You’re always welcome to give me your valuable suggestion , if you need more information regarding this project please leave a comment so that I can answer you.

Monday, 23 May 2016

Python app that can control GPIO


                        Python app that can control GPIO

I have done a Python app which can control GPIO of a microcontroller.
Here in this project I have tried different options to do a app in python in step by step process .i am trying to control LEDs using different options that provided by python GUI(graphical user interface), here you replace the LEDs with motor  or any output device ( with some drivers IC if required), but the process of doing app is same.
Why python and MSP430G2?
I think MSP430G2 is one of the  best development board by TI (Texas Instruments) with ultra low power microcontroller which is have 5 low powered mode by which battery life can be extended, which is also having 16 bit RISC CPU .So it is more preferable that other MCU’s where you need less battery consumption and maximum code efficiency.
Python is easy language to start with and it can be used for many application  its supports many domains like internet protocols, web developments, Scientific and Numeric Comuting,Desktop GUI, Software development etc.,
I’ll try doing this project in step wise:
Step1: 1st I need to create a simple GUI (graphical user interface) using python, for this you need to import the TKINTER library it is a GUI toolkit which come along with python no need to download it again, in that (TKINTER lib) you have different options to make your own creative GUI application, Tkinter library have various controls, such as buttons, labels and text boxes used in a GUI application. These controls are commonly called widgets.
              



Step2: now I have to create button icon to operate LED, in order to do that we have so many option in that I will go for radio button, in order to display my radio buttons we need to fallow a small syntax
In this step ill import the serial library so that I can operate my on board led by sending data ,When I click on led need to be ‘on’ when I click off led need to be ‘off’.



                                       

Step3: now I will create another button icon with color to operate LED.








 You’re always welcome to give me your valuable suggestion through comments, if you need more information regarding this please leave a comment so that I can answer you.


Saturday, 21 May 2016

Python communicating with MSP430G2


                            Python communicating with MSP430G2

I have done an interfacing with Python with MSP430G2.
 Why python and MSP430G2?
I think MSP430G2 is one of the  best development board by TI (Texas Instruments) with ultra low power microcontroller which is have 5 low powered mode by which battery life can be extended, which is also having 16 bit RISC CPU .So it is more preferable that other MCU’s where you need less battery consumption and maximum code efficiency.
Python is easy language to start with and it can be used for many application  its supports many domains like internet protocols, web developments, Scientific and Numeric Comuting,Desktop GUI,Software development etc.,
In this project I will try to operate the MSP430G2 with programming language called python.i will operate the on board led using python, for this u need MSP430G2 along with python software and pyserial library
I wrote a small code in python to send a character and I wrote another for MSP430 to collect the character that trying to send from the python through serial communications and the result is this!



After this I improve my coding and try to blink on board two led’s that is green and red with some time delay by sending two different characters .one for on the led other for off the led and the result is this !




                                          



Hurray it’s working …!

You’re always welcome to give me your valuable suggestion through comments, if you need more information regarding this please leave a comment so that I can answer you.


Friday, 20 May 2016

Python interfacing with MSP430G2(IR sensor)


                   
              Python interfacing with MSP430G2(IR sensor)

I have done an interfacing with Python with MSP430G2.
 Why python and MSP430G2?
I think MSP430G2 is one of the  best development board by TI (Texas Instruments) with ultra low power microcontroller which is have 5 low powered mode by which battery life can be extended, which is also having 16 bit RISC CPU .So it is more preferable that other MCU’s where you need less battery consumption and maximum code efficiency.
Python is easy language to start with and it can be used for many application  its supports many domains like internet protocols, web developments, Scientific and Numeric Comuting,Desktop GUI,Software development etc.,
In this project I try to read the physical world using programming language called python.
I think you are confused!
Let me explain it. I just try to read the physical world by using the IR sensor. This IR sensor communicates with your controller through serial communication.IR sensor gives the distance of the objects/obstracle, which can be seen in serial monitor. Now I try to display the same values what we are getting in serial monitor in python using pyserial, for this you need python software along pyserial library.
Step1:Msp430 serial communication:
First I Wrote a small code to display the values in serial monitor as shown in the figure
My code and board is working good, I try to print the obstacle distance in serial monitor



Step2: communicating with python
Now I have to import the pyserial library in to python and need to write a small code that can catch value of that is being displayed in serial monitor.
without obstacle IR range:



with obstacle IR range:

                                           



Hurray it’s working …!

You’re always welcome to give me your valuable suggestion through comments, if you need more information regarding this please leave a comment so that I can answer you.