Wednesday, 28 January 2015

NEWS POST #1 - WORLD'S 1ST TELEPORTATION DEVICE (NOT REALLY) :P


Teleportation has been a dream concept for all sci-fi (science-fiction) fans in the world. 
Teleportation is basically travelling the distance within matter of second. The term is referred to vanishing from one place and appearing at different place without traveling any distance. Well, a good news for sci-fi lovers, a researcher from Hasso Pattner Institute in Germany has developed world’s first teleporter.

The teleporter is named as ‘Scotty’, the name is inspired by famous character in Star Trek, chief engineer, Mr Scott. The name is quite popular amongst star trek fans. Whenever Captain Kirk wanted to transport to Starship in Star Trek, he says, “Beam me up, Scotty”. However, Scotty teleporter can only teleport physical objects.

You need to have setup of sender and receiver unit of Scotty for teleporting objects. This setup consists of 2 units of 3D printers, cameras and micro controller. You can place an object in sender unit, enter address of receiver unit and hit the teleport button to teleport the objects. The sender unit captures digital image of object layer-by-layer, it encrypts all those layers using public key of the receiver and transmits it. The sender unit also decomposes the object layer-by-layer while getting scanned. Receiving unit is capable of decrypting the layer in real time and start printing the object right away. Therefore, users can see the object getting appeared layer-by-layer on receiver unit as it gets disappeared on sender side. The official website has a video that explains the mechanics of the system. 

For any further info regarding this, see efytimes.com ;) 

Friday, 12 September 2014

#5 HAMMING CODE GENERATION USING EVEN PARITY


WHAT IS HAMMING CODE ?


Hamming code is a combination of message bits and redundant bits (bits that are added to message data in order to detect as well as correct 1-bit error). Hamming code is used in order to correct single bit error in the data. It can be generated by using both even parity as well as odd parity redundancy. Here, I used even parity in order to generate the hamming code. For detection part, wait for a while :P. 

MATLAB CODE:

clc;

clear all
close all
%HAMMING CODE GENERATION BY PRAJWAL KOTAMRAJU (EVEN PARITY) 
%ENTER THE MESSAGE SIGNAL.. Ex:[0 1 1 0]
m=input('enter the messsage sequence- ');
p=length(m);
disp('length of input sequence is')
disp(p);
%Condition for number of redundancy bits 'r' is given by
% 2^r>=p+r+1
%In order to accomplish this, let us have a loop
for l=1:p
if(2^l >= p+l+1)
    r=l;
    break;
end
end
disp('redundancy bits that are to be added to message bits are ');
disp(r);
%The total hamming code length = redundancy bits+ message length
h=r+p;
%Let us have a 1-D matrix for hamming code with all zeros initially
hc=zeros(1,h);
%Let us also have a matrix for positions of redundant bits
for l=1:r
    rp(l)=2^(l-1);
end
%Now let us 1st place the message bits in respective positions
%What we are exactly doing is, we are placing message bits at positions
%other than redundant bit positions.
t=1;
for l=1:h
    k=0;
    for c=1:r
        if(l==rp(c))
            k=1;
            break;
        end
    end
      if(~k)
      hc(l)=m(t);
      t=t+1;
      end
end
%At this stage we have hamming code with message bits placed at desired
%positions
%Now it's time to find redundancy bits and place them in hamming code
%1st for loop- no. of redundant bits
%2nd for loop- Check bit positions for given 'l' value
%3rd for loop- to group check bits .. like 2 as a group, 4 as a group..
for l=1:r
    q=0;
    for v=rp(l):2*rp(l):h;
         for c=1:rp(l)
             if(v+c-1<=h)
                if(hc(v+c-1)==1)
                   q=q+1;
                end
             end
         end
    end
    if(mod(q,2)~=0)
        hc(rp(l))=1;
    end
end
%Finally the hamming code is given by 
disp('hamming code (even parity) for corresponding message data is ');
disp(hc);




For any further details or for any doubts in case of code, contact me at pj.kotamraju225@gmail.com ,+Prajwal Kotamraju
Good bye for now :D !!

Friday, 29 August 2014

#4 TRAINING YOUR NEURAL NETWORK- (PERCEPTRON BASED)


In machine learning, the perceptron is an algorithm for supervised classification of an input into one of several possible non-binary outputs. It is a type of linear classifier, i.e. a classification algorithm that makes its predictions based on a linear predictor function combining a set of weights with the feature vector. The algorithm allows for online learning, in that it processes elements in the training set one at a time.
The perceptron algorithm dates back to the late 1950s. Its first implementation, in custom hardware, was one of the first artificial neural networks to be produced.

PROGRAM
% Prajwal's Neural Network :P :P 
clear all
close all
clc;s=0;ch=0;
e=input('enter the enable input for training (either 1 or 0): ');
l=input('for bipolar inputs, press "-1". For binary inputs, press "0": ');
x=input('enter the input matrix (order: 4x2): ');
t=input('enter the target matrix (order: 4x1): ');
w=input('enter the weight matrix (order: 2x1): ');
b=input('enter the bias: ');
lr=input('enter the learning rate: ');
it=input('enter the no.of iterations to be performed: ');
y=[0; 0; 0; 0];
if(e==1)
 for s=1:it
     ch=0;
    for q=1:4
        yin=b+x(q,1)*w(1,1)+x(q,2)*w(2,1);
        if(yin<0)
            y(q,1)=l;
        else
            y(q,1)=1;
        end
        if(y(q,1)~=t(q,1))
            w(1,1)=w(1,1)+lr*t(q,1)*x(q,1);
            w(2,1)=w(2,1)+lr*t(q,1)*x(q,2);
            b=b+lr*t(q,1);
        else
            ch=ch+1;
        end       
    end
    if ch==4
        break;
    end
 end
end
disp(s);
disp(w);
disp(y);


Conclusion: 
  • Training your neural network based on the algorithm specified above comes under SUPERVISED LEARNING.
  • In perceptron based learning, we should initialize weights to zero. But you can even initialize them with any random values as shown in simulation.
  • If weights aren't initialized with 0, it becomes another different learning algorithm


For any queries regarding code or anything else regarding any post in my blog, contact me at pj.kotamraju225@gmail.com. See you people with a new conclusion within no time ;) :D

Wednesday, 23 July 2014

#3 THE LOOPHOLES BEHIND VOLTAGE MEASUREMENT USING A MULTIMETER


Being an electronic engineer, we must know how to use a multi-meter and on what basis, multi-meters are chosen while measuring voltage across certain load resistor. Let me start this topic with a simple question. Just have a look at the picture below and give me the voltage across R2.


 Most of us will say that the drop across R2 is 6V because both the resistors are of equal value 'R'. But many of us don't know that the voltage is a function of 'R', when measured using a multi-meter. For example see the simulation results below.




So, from the above figure, we clearly notice that the voltage across R2 is not equal to 6V, although both the resistors .i.e., R1 and R2 are of same value. And we see that the voltage level is decreasing with the increase in the 'R' value. (Refer to 1st figure to see what 'R' is). Why is this happening ?

Simple reason - 

  • When we use an ideal voltmeter/ multi-meter, its internal resistance will be infinite. So, when an ideal voltmeter is placed parallel to a resistor, no current flows through the meter and all the available voltage across the resistor will be measured by it. 
  • When we use a practical one, it will have a finite (but large) internal resistance. So, if 'R' is very small compared to the internal resistance of practical multi-meter, it will show a perfect reading, just as the multi-meter has given a value of 6V in 2nd figure. Note that, even though the a 22k resistor is used, the value isn't 6V - it might be some nano volts less than 6V. But that difference is neglected and 6V is displayed as the output.
Note - Even though the multi-meter shows a different value of voltage across R2 for different values of 'R', the voltage is always 6V. But we don't have an ideal multi-meter that shows this value. The answer for the question I asked at the beginning of this topic is 6V itself and is independent of R, if and only if we have an ideal voltmeter.

So the conclusions for this topic are-
  1. The multi-meter selected, should have it's internal resistance to be atleast 10^6 times of that of the 'R' value to have an accurate reading of voltage. We should select the multi-meter, which has got such internal resistance. 
  2. Irrespective of 'R', the voltage is 6V. But the problem lies within the measurement (within multi-meter)
  3. If ideal multi-meter is available (hypothesis), we would have got 6V in all the cases of 'R'
If you have any queries, post a comment. You can as well contact me at +Prajwal Kotamraju  , pj.kotamraju225@gmail.com


Sunday, 13 July 2014

#2 SIMPLE ELECTRONIC LETTER INDICATOR USING LABVIEW


Here, in this small project, whenever an interrupt is placed between the photo-transistor (L14F1) and green LED, a message will be displayed that the letter has been dropped and the indicator light will be turned on. The block diagram (LABVIEW block diagram), the circuit (on bread board) and the simulation results are as shown below.  



  • The above circuit is implemented on the bread board and the output voltage across the photo transistor is given to the 'aI0' channel on NI myDAQ.
  • After this, a block diagram is implemented in NI Labview using DAQ assistant as an interface between hardware and software as shown below.


  • From the block diagram, we see that if the voltage across the PT L14F1 exceeds 10V, indication light will be turned ON and a message will be displayed - "THE LETTER HAS BEEN DROPPED".
  • Here is the practical circuit interfaced with myDAQ





Outputs are as shown below. When the letter isn't placed, indication light will be in OFF state. When any interrupt like letter is placed, indication light will be ON and message will be displayed.

When letter isn't placed

Interrupt is placed between LED and L14F1

Message is displayed as shown and indication light is turned ON

When these PT and LED are mounted on the inner walls of letterbox, and the info is passed in a wireless fashion, user will be able to understand that there is a letter for him even when he is in his house and is infront of PC.

Thank you, for any further information, contact me at +Prajwal Kotamraju 



Tuesday, 8 July 2014

#1 TEMPERATURE DETECTION USING LM35 AND NI MYDAQ

Temperature measurement in today’s industrial environment encompasses a wide variety of needs and applications. To meet this wide array of needs the process controls industry has developed a large number of sensors and devices to handle this demand. In this experiment you will have an opportunity to understand the concepts and uses of many of the common transducers, and actually run an experiment using a selection of these devices. Temperature is a very critical and widely measured variable for most mechanical engineers. Many processes must have either a monitored or controlled temperature. This can range from the simple monitoring of the water temperature of an engine or load device, or as complex as the temperature of a weld in a laser welding application. More difficult measurements such as the temperature of smoke stack gas from a power generating station or blast furnace or the exhaust gas of a rocket may be need to be monitored. Much more common are the temperatures of fluids in processes or process support applications, or the temperature of solid objects such as metal plates, bearings and shafts in a piece of machinery. 

In my application, I used LM35 as a temperature sensor, whose output voltage varies linearly with respect to temperature, and is directly proportional to temperature. Let us 1st discuss about this sensor LM35-

1. Detectable range -   -55 deg.C to 150 deg.C
2. Linear with 0.5 deg.C ensured accuracy at +25 deg.C




  • In this project, +Vs used is 15 V
  • The output at 36 deg.C is 0.36V and the output at 21 deg.C is 0.21 V
  • The above equations serve as the design equations for the block diagram of LABVIEW.
INTERFACE WITH NI MYDAQ :


The above figure shows the interface of the sensor circuit with Mydaq. After connecting the circuit as shown in the figure, the analog output is taken by AI 0 channel of Mydaq, the supply voltage to LM35 is given from the fixed voltage +15V from Mydaq. 

After the completion of interface, with the help of Labview, the data which is into the analog input of Daq is processed and calibrated to show the correct temperature by multiplying the output of Daq assistant with a numeric constant '100'.


Output of the project is shown as below- 


When the temperature is less than 40 deg.C, green light will be visible as shown above


 When the temperature exceeds 40 deg.C , red light will be visible and a dialogue box appears as shown in the figure indicating 'DANGER'

This concludes the project work on Temperature detection using LM35 and NI Mydaq. For further information about this project and about LABVIEW block diagram, contact me -  +Prajwal Kotamraju