Pages

Showing posts with label Science. Show all posts
Showing posts with label Science. Show all posts

Saturday, April 1, 2017

How I built My Smart Mirror from scratch

It all started while learning JavaScript. I was looking for some practice projects. I wanted to build something which not just helps me in learning JS but is also interesting enough to keep me motivated. While reading a blog I learnt about the idea of a Smart Mirror. I found it very interesting so I instantly knew I am going to build one.

My smart mirror looks like this:

My Smart Mirror

It displays current temperature, weather summary and humidity at top left. Time, day and date at top right and Namaz timings below it.

Main components:

A two-way mirror:

I couldn’t find any online options for buying a two-way mirror in Delhi. I went to a local hardware store on Vikas Marg and obviously they never heard of anything called “two-way mirror”. Then I explained them my requirements which they understood. They call it something else in India but it is readily available at hardware stores. I bought a 15X10 inches mirror and got holes drilled on all its corners.


An Android based tablet:

Many people have used an old monitor for building a smart mirror. However, I realized that using a monitor makes whole process a bit complex. If you are using a monitor, you need one more device where you will run your app and both of them need to be connected. I simply bought a 7 inches tablet and installed my app on it. It has a limitation that you only get 7 inches space to display content. Anyway, I do not wanted to display a lot of information because it may not leave any space for a user to view his image and it also defeats the purpose of a mirror. I found 7 inches space enough to display all I needed on my mirror.

An android app:

Developing a new app for my requirements was the most technical and time consuming thing. I used JavaScript for all the back-end processing. And later built an Android app using Phonegap framework. I used Openweathermap API for weather updates and PrayerTime API from aladhan.com for Namaz updates.
When the app is ready you simply need to deploy it on the Android tablet and fix your tablet at the back of the mirror. Also cover the unoccupied space with a black chart paper or paint.


Issues I Faced:

I faced issues with my application’s background not matching with that of my mirror. Adjusting background color and brightness fixed it. 
One issue was about installing and configuring my application on the tablet. You can connect a mouse with your tablet using OTG cable for interacting with it.
Also make sure the room/place where you install the mirror is brightly lit. Another drawback of using a display smaller than the size of mirror is that the display will be distinctly visible in darkness. One reason is that I configured it with lights on. You can try auto brightness feature of Android if it works for you.

What’s next:

I have a plan to add news headlines, calendar and traffic updates to my mirror.

Overall it was a great learning experience for me.

Sunday, January 31, 2016

No Cure For Common Cold

I again became a victim of 'common cold'. And like always I got irritated, Mummy asked me to visit a doctor and take some medicine. However, there are more well-wishers in my life now. Like my mother this new well-wisher I am talking about has a big say in my issues now. She is my wife.

Sana, who herself avoids medicine especially antibiotics, advised me to consume home remedy instead of antibiotics. I used to take 'a citrizine' whenever I had cold. I must admit that I am vulnerable to it, I suffer from cold every two months. This time I also decided to avoid medicine. As a result I am sneezing for last two days. But I am sticking to masala tea, coffee and Unanai medicine.

I decided to Google and what I found not only validated Sana's insistence on avoiding antibiotics but also revealed that there is actually no cure for 'common cold':

Antibiotics have no effect against viral infections or against the viruses that cause the common cold.[67] Due to their side effects, antibiotics cause overall harm but are still frequently prescribed.[67][68] Some of the reasons that antibiotics are so commonly prescribed include people's expectations for them, physicians' desire to help, and the difficulty in excluding complications that may be amenable to antibiotics.[69] There are no effective antiviral drugs for the common cold even though some preliminary research has shown benefits.

:Wikipedia (https://en.wikipedia.org/wiki/Common_cold)

Sunday, November 9, 2014

Interstellar - The Movie Review

Interstellar is a science fiction adventure film directed by Christopher Nolan. The movie is based in near future when earth is no more habitable so NASA decides to send space travelers in search of new places which are able to sustain humanity.


Although, I was not waiting for its release, not even heard about it till the previous day. But I agreed to join my friends because I needed a dose of entertainment after a long and tiring day in office(on Saturday). I may not be following Nolan religiously but I am aware that his movies require a functional brain.

About the movie:
  • This movie is the only application of "Theory Of Relativity", which I unsuccessfully tried to understand during engineering.
  • Please learn the basics about Relativity, Quantum Mechanics, Murphy's Law and Universe before booking tickets.
  • Even if you are not from Science background please participate in clapping after the movie. You can later justify that you loved the direction and physical portrayal of time.
  • One of those movies which give you homework.
  • If you are a Salman fan and watch movies only for Entertainment. Go to the same multiplex and watch "The Shaukeens" on the other floor. Later, smile at people who come out confused after watching Interstellar.
  • Like a typical Sci-fi and Nolan movie, it too leaves many questions unanswered.

(Spoilers begin)
As explained by my friend Daud,the most interesting question is the loop. In the end, Cooper is able to save humanity by transmitting the message through Gravitation. But he transmitted the message from future to save humanity in the past. If he is in future, how could he survived the past. To make it simple, the question is who saved whom? Is it people from future who sent a message, saved their past. Or people in the past saved their future.
Who came first hen or the egg?

Saturday, February 8, 2014

Internet is full of Entertainment

At one conversation about "Religion vs Science", someone commented:

"Can you show me a software? Can you show me gravity? Can you show me electricity? You would just show me the effects. So, why do you want to see a soul to believe in it?"

There is lot more entertainment over internet than we can ever imagine. hmm... Yes, knowledge too exists.

Wednesday, February 5, 2014

Dreams and Reality are Related

There is something with dreams. At-least some of them in some way represent future. Few days ago, I met one of my childhood friends in a dream. The same day I received his friend request on facebook.

I don't understand how this works. And its not like all my dreams come true. Most of them are all rubbish. All major religions believe that divine messages are delivered through dreams. However, no religion would make sinners like me eligible for receiving divine knowledge.

Science also have an explanation for this. Its called "Deja vu". According to Wikipedia, "It is the phenomenon of having the strong sensation that an event or experience currently being experienced has been experienced in the past, whether it has actually happened or not".

Whatever it may mean but it really feels good when your dreams become reality.

Sunday, January 19, 2014

Something is wrong

Like all Science students, I have this habit to ask "Why?" before accepting anything. I need a reason before storing any new thought or theory in my memory. During college days, Logic, Reasoning and Calculation occupied most of my abnormal brain. For years, my brain's firewall stopped me from exploring my artistic and romantic side. As soon as I came out of college many more questions regarding religion, politics, history and culture started to stack up and attack the firewall. All this made me feel very uneducated.

Photo Credit:  Dullhunk
Education is all about knowing everything about something and something about everything.
Eventually, I decided to shift my interest more towards arts and literature. Enrolled for learning Spanish, but failed to accommodate the classes into my corporate routine. To keep going I started reading everything except science. Internet came to my rescue and the destruction began.

In a few months I found myself reading more Urdu poetry than anything and its magic started working. Although I was not very fluent in Urdu but online dictionaries made it easy to understand. I also started enjoying Qawwali, Gazals and Thumri. All my favorite singers got replaced by Nusrat Fateh Ali Khan, Jagjit Singh, Iqbal Bano and Rekha Bhardwaj among others.

I call it destruction because I am spending lots of time listening music and reading many unrelated theories about everything. I wonder if I am really gaining anything other than confusion. Do I really know where am I going? Unlike Science, there are no limits in Arts, no boundaries, no resistance for imagination. Although brain is sending regular warnings but somehow I am enjoying this journey.

"Jo radd hue thay jahan main kai sadi pehle,
   Woh log hum pe musallat hain is zamanay main." 
 : JaunElia