Monday, May 26, 2014

Learning Hadoop

Hello,

So me and my younger brother have started to tinker around with this new tool called "HADOOP".

Now, what's HADOOP:

"Hadoop was created by Doug Cutting and Mike Cafarella[5] in 2005. Cutting, who was working at Yahoo! at the time,[6] named it after his son's toy elephant.[7] It was originally developed to support distribution for the Nutch search engine project.[8]"

So what was the problem which gave birth to Hadoop?

"Doug Cutting, Cloudera's Chief Architect, helped create Apache Hadoop out of necessity as data from the web exploded, and grew far beyond the ability of traditional systems to handle it. Hadoop was initially inspired by papers published by Google outlining its approach to handling an avalanche of data, and has since become the de facto standard for storing, processing and analyzing hundreds of terabytes, and even petabytes of data."

 Hadoop is a software framework, which means it includes a number of components that were specifically designed to solve large-scale distributed data storage, analysis and retrieval tasks.

From the next post onwards, I will start posting on how to install hadoop, configure, what are the modes in which we can use it. 






Thursday, May 8, 2014

TVB gone circuit using Arduino Uno

Hello,

So finally, I successfully made the TVB gone circuit using Arduino UNO. I was trying to do this since week, and finally, was able to finish this yesterday.

A little bit introduction about the TVB gone

"TV-B-Gone is a type of simple universal remote control device for turning off a large majority of the current available brands of television sets. It was created to allow people in a public place to turn off nearby television sets. Its inventor has referred to it as "an environmental management device". The device is part of a key-chain, and, like other remote devices, is battery-powered. Although it can require up to 69 seconds for the device to find the proper code for a particular television receiver, the most popular televisions turn off in the first few seconds.

TV-B-Gone was invented by Mitch Altman, and is sold by his company Cornfield Electronics. Altman was one of the pioneers of Virtual Reality, working with Jaron Lanier at VPL Research, and it was during his research in this field that he started to believe in the hypnotic power of television programs.[citation needed] The standard model TV-B-Gone consists of an infra-red LED, two CR2032 cells and an integrated circuit containing the television power code database, in a plastic case."



Components needed:

Arduino UNO R3, used it because of the simplicity of the project, and besides, this board is readily available, you can place your order from this website: https://www.sparkfun.com/products/11021

Arduino is an open-source physical computing platform based on a simple i/o board and a development environment that implements theProcessing/Wiring language. Arduino can be used to develop stand-alone interactive objects or can be connected to software on your computer (e.g. Flash, Processing, MaxMSP). The open-source IDE can be downloaded for free (currently for Mac OS X, Windows, and Linux)




Push button:The pushbutton is a component that connects two points in a circuit when you press it.

5 mm Infrared LED

                           


An electroluminescent IR LED is a product which requires care in use. IR LEDs are fabricated from narrow band heterostructures with energy gap from 0.25 to 0.4 eV. Infra red transmitter emits IR rays in planar wave front manner.
Eventhough Infra red rays spreads in all directions, it propagates along straight line in forward direction. IR rays have the characteristics of producing secondary wavelets when it collides with any obstacles in its path. This property of IR is used here.

When IR rays gets emitted from LED, it moves in the direction it is angled. When any obstacle interferes in the path, the IR rays get cut and it produces secondary wavelets which propagates mostly in return direction or in a direction opposite to that of the primary waves, which produces the net result like reflection of IR rays


5 mm Light Emitting Diode:A Light emitting diode (LED) is essentially a pn junction diode. When
                                              carriers are injected across a forward-biased junction, it emits incoherent                                                 light. Most of the commercial LEDs are realized using a highly doped n                                                     and a p Junction. 





Circuit schematic:

I did attempt to make the circuit which Mitch Altman invented, but could not get it to work, hence, I changed the circuit, available at the fritzing.org:

http://fritzing.org/projects/tv-b-gone-with-arduino/




However, this schematic has a bug, kindly do not put the push button's wire to the trasnmitter  section of the arduino board because Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - pins cannot be used for digital i/o (digitalRead and digitalWrite) if you are also using serial communication. Since, we are using Serial.begin function to communicate with the computer, hence, these two pins are dedicated to TX/RX, hence, we cannot use these two pins.

So, wire the push button to the digital pin 2 of the arduino board.

Complete connection:

Breadboard's -ve rail: Connect to Arduino's GND

IR Led Negative or short leg: Connect the wire to the breadboard GND rail.

    Red LED Negative or Short leg: Connect the wire to the breadboard GND rail.

   One section of Push button leg: Connect to the GND rail of the bread board, push button's                                                 don't have polarity, hence, connect as per your wish.

   IR Led Long leg or +Ve: Connect to the digital Pin 3 of the Arduino Board, note that, these pins have ~ on their side,                                    it means that these pins can support analog functions also, but we don't require such                                             things for this project.

   Red Led Long leg or +ve: Connect to arduino's digital pin 13

   Push button's another side: Connect to arduino's digital pin 2

   Once the schematic is finished, upload the following sketches from this GITHUB:

     https://github.com/shirriff/Arduino-TV-B-Gone

    NOTE: Kindly do not create any library etc for this, either you can copy-paste the sketches individually, or extract the zip after downloading in the Arduino Sketchbook folder. If we create library, then, we get compile error:

o:(.progmem.data+0x0): multiple definition of `NApowerCodes'
/var/folders/sJ/sJhEJAz6HZiIGNVVaTTBwk+++TI/-Tmp-/build7674028882894173597.tmp/TVB/WORLDcodes.cpp.o:(.progmem.data+0x0): first defined here

o
o:(.progmem.data+0xe6): multiple definition of `EUpowerCodes'
/var/folders/sJ/sJhEJAz6HZiIGNVVaTTBwk+++TI/-Tmp-/build7674028882894173597.tmp/TVB/WORLDcodes.cpp.o:(.progmem.data+0x112): first defined here

o:(.data.num_NAcodes+0x0): multiple definition of `num_NAcodes'
/var/folders/sJ/sJhEJAz6HZiIGNVVaTTBwk+++TI/-Tmp-/build7674028882894173597.tmp/TVB/WORLDcodes.cpp.o:(.data.num_NAcodes+0x0): first defined here

o:(.data.num_EUcodes+0x0): multiple definition of `num_EUcodes'
/var/folders/sJ/sJhEJAz6HZiIGNVVaTTBwk+++TI/-Tmp-/build7674028882894173597.tmp/TVB/WORLDcodes.cpp.o:(.bss.num_EUcodes+0x0): first defined here
l
    Alos, i have used the Windows environment to compile the sketch. When using LINUX or Ubuntu, we have to add additional libraries.

    Once, we have the three files ready, TVB.pde, main.h and Windows.cpp, compile and upload the sketch. If you have received no errors, then, take the prototype near to your Television set, and have fun shutting down the Television which are running and annonying everyone ;).

PS: I stay in India, the code which has been provided has North American and European power codes, but while I designed this simple circuit, I did not have to worry about the power codes, as I was able to make this work successfully. However, while attempting  the circuit which Mr Mitch Altman had created, I have faced issues, may be, I may have to take care of power codes for that stuff. Will keep posting once I revive my work on that.