Thursday, February 9, 2017

IoT Scaler



Waste less 

(VEGA Technologies) 









waste less is a project which is a help to reduce the daily food wastage and motivate people to save the foods.The proposed design is to measure the food wastage in every minute and display it on the canteen.Displaying details include how much we waste in each day and how much it cost ad how much worth that energy like details.



The scaler includes Arduino board and GSM module to upload the data into the internet.In this case, we did not keep SQL database and we used google sheets to keep and manipulate the data. We keep 50000 entries as the history for our calculation and predictions.we used both google script and google sheet formula for the calculations.

The user interface of the system is web based and It hosted in codeGen server.As technologies, we used Java script, HTML and some graph API for the visualization.




GitHub repo for the source,

https://github.com/E12351/IOT_Scaler.git
https://github.com/E12351/IOT_scaler_Client.git

http://vega.lk/wasteless/dev/dev.html

Wednesday, December 14, 2016


SMS controlled Door Lock using Arduino and GSM module.

we propose a smart digital door lock system for home automation. A digital door lock system is equipment that uses the digital information such as a secret code.A door lock system proposed here consists of GSM module to interact with user remotely, a motor module for opening and closing of the door and some sensor modules for detecting the knocking situations of user.it also allows users to remotely reset the secret code in the lock.The LCD display and keypad help to user to give inputs and see outputs easily.







Saturday, July 16, 2016

Internet Base Robo Controlling



Internet Based robot controlling

iSAFE is the semi-autonomous robot which can control over the internet.During the last few years, the robot population  has increased   dramatically. Robots do indeed  offer considerable advantages if  they are used at the right time, in the right place and for the right task. To fulfill  these conditions, we show how we can use the internet to control a  robot when the client is far away from the home or location. When the user gives the relevant  commands, the robot could move in those directions and    do work  accordingly. Also, the user is able to watch what  the robot is     doing in real  time.

You get the source code from here,
https://github.com/Anjeldethwings/iSAFE





Getting starting with Open Source Project(Mozilla Firefox) Part 1

What's the difference between open source software and other types of software?

Some software has source code that only the person, team, or organization who created it and maintains exclusive control over it can modify. People call this kind of software "proprietary" or "closed source" software. Only the original authors of proprietary software can legally copy, inspect, and alter that software. And in order to use proprietary software, computer users must agree that they will not do anything with the software that the software's authors have not expressly permitted. Microsoft Office and Adobe Photoshop are examples of proprietary software.

Open source software is different. Its authors make its source code available to others who would like to view that code, copy it, learn from it, alter it, or share it. LibreOffice and the Firefox Programs are examples of open source software.

Let's start to form the scratch.

In here we going to start to contribute Mozilla firefox project.So here we go, now we know nothing about firefox so we need to know about Firefox first. Every open source projects have their own mailing list which is used to talk about the project and bugs.First of all, we need to register there,so we can ask them about our issues.Here is the link to the mailing list and we can register there.


After we done with the mailing list now we can move forward, normally when we send a mail it will take a time to get the reply from the people but we can have another option it's IRS.IRC mean 
Internet Relay Chat It is similar to the WhatsApp ,we can see all the members who are in online now and we can send messages public and they will reply us. to use IRC we need to install IRC client it's very easy to follow the link and get one in here we are using Hexchat.

https://hexchat.github.io/downloads.html

In the next post, we will see how to use Hexchat and what to do next.


Friday, June 3, 2016

GPU-accelerated video enhancement application



What is GPU..?

 Already as you known it's a video card. graphics processing unit (GPU), also occasionally called visual processing unit (VPU), is a specialized electronic circuit designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display.

Why GPU..? 

This process is usually slow, so to boost performance, I'm using GPU acceleration via CUDA, NVIDIA’s general C-like programming language. In practice, you can expect a real-time performance in 1080pp video.




GPU is something different than CPU it has lot of cares and it can handle large number of tasks at same time.But it's not much power full as the CPU cores when we processing large number of light weight tasks it will give us better performance than CPU.




further more details about CUDA,


Introduction to the Project

If we consider a video or a movie, some of them have problems such as low brightness, low contrast and not suitable colors. So that factors must be improve to get a better video.
Improving the quality of a video is called video enhancement. Enhancement can be with respect to different properties such as brightness, contrast and color. Histogram equalization is a widely used technique in image processing to do automatic contrast adjustment of an image. Images which are too darker, lighter or flat are having a low contrast.
Histogram equalization increases the contrast automatically to make the quality of the image better. The same process can be used to enhance videos because a video is simply a sequence of still images. The process mostly involves pixel wise operations and for a high resolution image a lot of computations has to be done.

If we consider CPU it has Small number of computation threads being undertaken at high speed, but GPU has a large number of simple computation threads undertaken at a lower speed. In video enhancement the number of computations for a video is significantly high and hence the video rendering on CPU would require long waiting time.
A Graphics Processing Unit that consists of hundreds of cores are ideal in problems like this which involves large number of independent parallel operations. Therefore a GPU implementation is expected to give a massive speedup. Using Compute Unified Device Architecture (CUDA), NVIDIA graphics cards can be easily programmed to be used for such
calculations.

In this project, we implemented a software that runs on a GPU to enhance a given color video using histogram equalization technique.

Designing the project

• Accept a H.264/MP4 video file specified by the user as an input

We basically use open CV to process the video file. open CV is a basic image processing library which is used to read video file as a 3D matrix.

• Convert RGB values of the frames to HSI

There are so many techniques to enhance videos but in our case we used histogram equalization to enhance the video. So we firstly read RGB values from the frame by frame in the video and converted in to HSI values. Then using that HSI values we processed the histogram equalization algoritham.





• Do the histogram equalization

In histogram equalization first we consider a frame. We read its pixel values as a matrix. Then we got the frequency of each pixel value. Then we use histogram equation to get the equalized pixel values and replaced them with original values. We did this process frame by frame.
{formulas for histogram equalization : h(v)= [cdf - cdf(min)/M x N - cdf(min) ] x (L-1) }



• Do the CUDA implementation

First we analyzed the parallizable parts in the code. Then we make kernels for those parallizable parts. After that we using Cuda ocupancy calculator we get optimize block sizes and thread numbers and use them in the code.

• Optimization and output the enhanced video as the same file format and initial resolution


We increased the work done by each kernel. Also number of times that the kernels are used is reduced. We allocated memory once at the beginning of an application and then reuse that memory in each kernel invocation. We used row wise matrix operations.

First of all you need NVIDIA vga card which can run cuda programs in it.In my case i'm using tesla card.

https://github.com/Anjeldethwings/GPU-accelerated-video-enhancement-application

you can find the code using above link.

Wednesday, January 6, 2016

Arduino Bluetooth RC Car (Android Controlled) 


Hello. In this project i'm going to make a Arduino Controlled car using HC-05 bluetooth module.
Before starting, make sure that you have:
  • Arduino uno board
  • L293D motor driver
  • HC-05 Bluetooth module
  • Motors ( in my case i'm using 4 gear motors )
  • power regulator
  • Rechargeable battery.

1. Circuit Diagram


I uploaded similer circuit diagram which i used.In my case i used Arduino Mega bord.Above diagram i did nnt mention about the power unit in my robot i used buck converter.i think you know about these things.


  • Make sure your bluetooth module is connected corectly as my diagram it should be RX in to TX and TX in to RX like that.




2.It's quite simple if you complete basic things to programme.

First of all you should initialize the D2,D3,D4,D5 in to some digital pins to control the motors and to control the speed you should  initialize 2 PWM pins.It's not need any way you can just give some 5v to those two pins in the motor drive it will work fine then you cant change the speed.

to the controlling part i'am using this android app and it's very simple to use.if you click on the button it will send some specific ASCII values to the arduino and there is another feature of this app it will remainly send that value if you hold the button it will stop after you release the finger.it's  the best app i ever seen in the play store for this purpose

https://play.google.com/store/apps/details?id=braulio.calle.bluetoothRCcontroller&hl=en

int in1 = 9;
int in2 = 10;
int in3 = 11;
int in4 = 12;
int speedPinA = 8;
int speedPinB = 13;

int inByte = 0;   
//---------------------------------------------------------------
void setup(){
  
 Serial.begin(9600);
//----------------------------
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  pinMode(speedPinA,OUTPUT);
  pinMode(speedPinB,OUTPUT);
}
void forwd(){
        analogWrite(speedPinA, 250);
        analogWrite(speedPinB, 250);
        
        digitalWrite(in1,LOW);
        digitalWrite(in2, HIGH);
        
        digitalWrite(in3,HIGH);
        digitalWrite(in4, LOW);
}

void Left(){
        analogWrite(speedPinA, 250);
        analogWrite(speedPinB, 250);
        
        digitalWrite(in1,LOW);
        digitalWrite(in2, HIGH);
        
        digitalWrite(in3,LOW);//-------
        digitalWrite(in4, HIGH);
}
void backwrd(){
   analogWrite(speedPinA, 250);
   analogWrite(speedPinB, 250);
   
        digitalWrite(in1,HIGH);
        digitalWrite(in2, LOW);
        
        digitalWrite(in3,LOW);
        digitalWrite(in4, HIGH);
}
void Right(){
   analogWrite(speedPinA, 250);
   analogWrite(speedPinB, 250);
        
        digitalWrite(in1,HIGH);
        digitalWrite(in2, LOW); //----
        
        digitalWrite(in3,HIGH);
        digitalWrite(in4,LOW);
}
void all_stop(){
        digitalWrite(in1,LOW);
        digitalWrite(in2, LOW);
        
        digitalWrite(in3,LOW);
        digitalWrite(in4, LOW);
}

void loop(){
   if (Serial.available() > 0) {   
       
    inByte = Serial.read(); 
    Serial.println(inByte);
 //--------------------------------------------------------------
    if(inByte == 76){
        Right();
        inByte = 0;     
    }
    if(inByte == 82 ){
        Left();
        inByte = 0;
    }
    //----------------------------------------------------------------
      if(inByte == 70){ 
        forwd();
        inByte = 0;     
    }
    if(inByte == 66){
        backwrd();
        inByte = 0;
    } 
    if(inByte == 83 ){
        all_stop();
    }
  }



3.Finished



Enjoy it.....!