Wednesday, December 17, 2014

HELLO WORLD! FROM UNITY

Creating a video game require too much programming (mainly 3D graphics programming, which is quite difficult!) and if you don't want to become a professional game designer then there is no reason learning every detail. So instead of starting from scratch and also to speedup the design, it is helpful to use some kind of "game engine". There are lot's of options and you might prefer some game engines over the other. Considering pros and cons of various game engines I decided to use Unity.

Why learn Unity?

  • Lot's of support available at their website
  • Very active community, i.e. you have a lot of flexibility in buying the assets (3D Models and Artwork), so you don't have to build every game asset yourself
  • Lot's of tutorials from various websites like:  http://www.digitaltutors.com/  etc.
It should be clear what Unity is and what it can do for you?

What is Unity?
(Wikipedia) Unity is a cross-platform game creation system developed by Unity Technologies, including a game engine and integrated development environment (IDE). It is used to develop video games for web sites, desktop platforms, consoles, and mobile devices.

So, I decided to make my own 3D game and it really took quite a lot of time. But after making this (below) very simple game I feel quite confident in approaching towards making of a very complex game. I named it "Super Breakout" and this game was made just to learn unity (I didn't create the artwork (textures etc.) myself... ).
Here is the link (It is essential to download .exe as well as data file to play the game)

https://drive.google.com/folderview?id=0BxvpVhIITsEsMFZIVGQ1TGlESFk&usp=sharing












Since Unity doesn't compile a game into a single .exe file, so you would need an external software to further compile all the date and associated files into a single .exe file. Also I didn't want to become a professional game designer, so I decided to leave it as it is.
Lastly, I would like to tell you where to get resources for creating a game. There are plenty of websites out there but the most useful that I found are:

That's it you can now have your name on the show!




Friday, August 8, 2014

MAGIC IN THE DARK!

This post wouldn't be interesting if you already know about IR LED's and what they can do for you, but if you haven't then it would be exciting to get the idea about these magical lights...

IR LED's provide a great way to spy in the night! Since our eyes are not sensitive to infrared light but a camera which doesn't have IR filter in it, can detect it and allow you to see in the dark. All you need is some IR led's , a battery and a camera (your smartphone camera would work fine too). An ir led looks very much similar to a regular led with only difference that it doesn't emit any visible light:

(IR LED's)

Instead of buying these LED's, I thought to test it with the IR led built in a remote of a T.V. And voila it worked!



                                                                 





   Lights Out   ==>







                                                                             
                                                                                                                               

  
After searching on the web I found a lot of vendors selling IR torch, even UV's as well but It's fun to play with IR led's if you haven't done it yet. And also if  you would like to use it on your electronics project like for example: Night vision via Raspberry pi or Arduino, then you experience the usefulness of these simple yet wonderful devices.

Here is an example of a photo taken in the dark (using Raspberry Pi no-ir camera and bunch of ir led's):


So, now you should have got enough idea to use ir led's on your own electronics projects!



Thursday, August 7, 2014

ELECTRONIC SENSORS AND TRANSDUCERS

Sensors and transducers, as the name says, senses the external physical environment by varying some of their properties in accordance with their current physical environment. A lot of the sensors are based on few electrical properties like change in resistance (as in photo-resister), capacitance, closing of circuits as in case of photo-diode or something that depends on the phenomena of electromagnetic induction (as in a microphone).

Various types of sensors:

  • Light sensor: photo-diode and photo-resisters are excellent way to sense light level. A higher intensity of light increases/decreases the resistance and current (in case of photo- resister and diode respectively). Thus measuring the change, we are able to sense the light intensity.            
  • Temperature sensor: Again the easiest type of devices under this category are thermistor and thermocouple. Thermistor is just the temperature varying resister and thermocouple involve a metal junction of two dissimilar metals (a voltage is produced when temperature of any part is changed).
  • Position sensor: Simplest type in this category involves potentiometers and (rotary) encoders. Potentiometer is just a resistor with 3 leads (one of the lead is a wiper that is responsible for variable resistance, since its position determines the amount of resistance). Rotary encoders work very differently, for more info see: http://en.wikipedia.org/wiki/Rotary_encoder     
  • Sound sensor and transducers: Microphone being the simplest type of sound sensor, which converts sound signals to weak (that's why we need amplifiers) electrical signals. Piezoelectric crystal converts the pressure into electrical signals (they offer much more fun).
This is not by any means a complete list of all sensors but if you try one or two of them, you get the general idea of -- what sensors are and how they can be used in your own electronics projects. There are whole range of sensors (and actuators), some of them using mechanics like : MEMS (micro electro mechanical devices), motion sensors, gps, ir distance sensor and so on.
You can buy these sensors from vendors like adafruit.com. They usually embed a tiny microcontroller chip on the sensor board, so that you don't have to do all those conversions (i.e from current/resistance to light intensity). You just only need to know -- how to communicate with these sensors (via MISO and MOSI sort of protocols). And if you don't then there is another option as well--you can buy these sensors only (without microcontroller chip on board) from vendors like analog.com


You can learn more about these sensors and the one described above by following this link:


After reading this post, I hope you'd have got a very good idea of what a sensor is and where it can be used.              

                                      

Thursday, July 31, 2014

UNDERSTANDING THE TELEVISION TECHNOLOGY

Before diving into -- Understanding the modern television, it is often useful to learn about its invention and what main ideas motivated its invention. So, a little bit of history then:

In 1884, German inventor Paul Nipkow got a patent for a mechanical device that could scan a picture. The device included a vertical rotating disc in which there were holes arranged in a spiral form (shown below).



                                           
                                              (few holes are shown for clarity)



When a picture was projected against the disc, it was only possible for the light from one point at a
time to penetrate the disc and to reach a photosensitive cell located on the other side of the disc. By spinning the disc, the light that penetrated the disc described the picture point by point. After one turn of the disc, the complete picture had been scanned. The electrical signal produced by the photosensitive cell is a primitive video signal. At the receiver end, a similar rotating disc with holes is used. This receiver disc rotates with the same speed as the transmitting disc. An electrical source of light that is controlled by the video signal is located behind the receiver disc. A picture can now be viewed in front of the receiver disc.

Nipkow never succeeded in putting his TV system into practice. The electronic components required to do so were simply not available at the time of his invention.

It was the Englishman John Logie Baird who implemented the first cameras and TV sets that really worked, in the 1920s.

Here is video showing his Mechanical TV:







Modern televisions:

(This post would be completed soon, meanwhile I need to learn about the functioning of these T.V's!)


Monday, July 21, 2014

MAKING A VIDEO GAME CONSOLE

This post is intended to explain you how to make your own game console without spending too much money and learn electronics behind its creation. It requires several different parts which you can buy from : http://www.xgamestation.com/view_product.php?id=34
However instead of buying them, I decided to make something similar-that uses same concepts and offers same functionality-on a prototyping board.
The schematic of XGameStation pico edition :




As of now, I am still learning how to make it possible ,so bear with me - it would get completed very soon :)


RASPBERRY PI AS FM TRANSMITTER

This hack was recently developed by some students at Imperial College Robotics Society at London. This is a very simple hack that requires minimum piece of hardware. All you need is raspberry pi, FM radio and a bare piece of wire to act as antenna. Just follow the procedures explained at their website:

In fact, it's not just transmitting at the frequency -set using the command : sudo ./pifm sound.wav 100.0 -but also it is radiating at some other frequencies as well. I don't know the reason for this but this event was reported by various students when they used spectrum analyzer on radio frequencies.
Here are the photos showing how I did this project:



There is certainly no need to mount the antenna right on top of the pin, an external breadboard (with antenna attached) would have worked fine.


Saturday, June 7, 2014

HOSTING A WEBSITE ON RASPBERRY PI

If you don't have any hardware (sensors, relays, etc.) or don't want to experiment with hardware stuff and only want to experiment with computing, then this post is for you.
In this post I would try to explain how easy it is to host a website (WordPress) on raspberry pi. Steps involved in hosting the website are:

  1. Set up Apache Web Server
  2. Install PHP
  3. Install MySQL
  4. Download WordPress
  5. Set up your WordPress Database
  6. WordPress Configuration
  7. Use a dynamic DNS service like: http://www.dnsexit.com/
  8. Installing dynamic DNS client
  9. Setting up static ip address for raspberry pi
  10. Port forward your router (port 80)

It is really time consuming if you have no idea what all these words mean. But rather than understanding each of them, you can follow the procedure without even thinking about them. And since it is rather lengthy procedure, so I am not going to explain every detail of it. If you wish to follow these steps refer to : http://www.raspberrypi.org/learning/web-server-wordpress/worksheet.md
They have all the procedures up to step 6. So after doing the WordPress Configuration, you need to sign up for an account on  http://www.dnsexit.com/ and follow the steps (provided on their website) to install client on raspberry.
And in penultimate step, you need to set up a static ip address and the procedure is very straightforward : http://elinux.org/RPi_Setting_up_a_static_IP_in_Debian
Lastly you would need to port forward your router. Since every router is different, so depending upon your router consider looking at the documentation for port forwarding.
Here is the snapshot of the website that I made--following above procedures--                               



So, guess what - if you followed all the steps correctly, you have your own website running on your own server!